[logaling-commit] logaling/logaling-command [loga-new-no-project] Use PersonalProject instead of ImportedProject

Back to archive index

null+****@clear***** null+****@clear*****
Thu Aug 9 15:04:09 JST 2012


SUZUKI Miho	2012-08-09 15:04:09 +0900 (Thu, 09 Aug 2012)

  New Revision: 9f4ad2f9bdf9f1312018c838a86beda93eae54ca
  https://github.com/logaling/logaling-command/commit/9f4ad2f9bdf9f1312018c838a86beda93eae54ca

  Log:
    Use PersonalProject instead of ImportedProject

  Modified files:
    lib/logaling/project.rb
    lib/logaling/repository.rb

  Modified: lib/logaling/project.rb (+11 -0)
===================================================================
--- lib/logaling/project.rb    2012-08-09 10:23:56 +0900 (87e6478)
+++ lib/logaling/project.rb    2012-08-09 15:04:09 +0900 (3fefaa5)
@@ -87,6 +87,17 @@ module Logaling
       name, source_language, target_language, type = File.basename(@path).split(/\./)
       [GlossarySource.create(@path, glossary(source_language, target_language))]
     end
+  end
+
+  class PersonalProject < Project
+    def name
+      File.basename(@path).split(/\./).first
+    end
+
+    def glossary_sources
+      name, source_language, target_language, type = File.basename(@path).split(/\./)
+      [GlossarySource.create(@path, glossary(source_language, target_language))]
+    end
 
     def glossary_source_path
       File.dirname(@path)

  Modified: lib/logaling/repository.rb (+1 -1)
===================================================================
--- lib/logaling/repository.rb    2012-08-09 10:23:56 +0900 (d0e784d)
+++ lib/logaling/repository.rb    2012-08-09 15:04:09 +0900 (6ed91ad)
@@ -91,7 +91,7 @@ module Logaling
         Logaling::Project.new(project_path, self)
       end
       projects += user_glossary_paths.map do |user_glossary_path|
-        Logaling::ImportedProject.new(user_glossary_path, self)
+        Logaling::PersonalProject.new(user_glossary_path, self)
       end
       projects += imported_glossary_paths.map do |imported_project_path|
         Logaling::ImportedProject.new(imported_project_path, self)
-------------- next part --------------
An HTML attachment was scrubbed...
Télécharger 



More information about the logaling-commit mailing list
Back to archive index