[logaling-commit] logaling/logaling-command [master] Extract Project#imported?

Back to archive index

SHIMADA Koji null+****@clear*****
Thu Sep 20 13:51:04 JST 2012


SHIMADA Koji	2012-09-20 13:51:04 +0900 (Thu, 20 Sep 2012)

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

  Log:
    Extract Project#imported?

  Modified files:
    lib/logaling/command/application.rb
    lib/logaling/project.rb

  Modified: lib/logaling/command/application.rb (+1 -1)
===================================================================
--- lib/logaling/command/application.rb    2012-09-20 13:45:20 +0900 (74e41db)
+++ lib/logaling/command/application.rb    2012-09-20 13:51:04 +0900 (c7fc476)
@@ -188,7 +188,7 @@ module Logaling::Command
       check_logaling_home_exists
       project =****@repos*****_project(@config.glossary)
       raise Logaling::ProjectNotFound unless project
-      raise Logaling::ProjectNotFound if project.class.name == 'Logaling::ImportedProject'
+      raise Logaling::ProjectNotFound if project.imported?
       glossary = project.glossary(@config.source_language, @config.target_language)
       if glossary.bilingual_pair_exists?(source_term, target_term)
         raise Logaling::TermError, "term '#{source_term}: #{target_term}' already exists in '#{@config.glossary}'"

  Modified: lib/logaling/project.rb (+8 -0)
===================================================================
--- lib/logaling/project.rb    2012-09-20 13:45:20 +0900 (80aa935)
+++ lib/logaling/project.rb    2012-09-20 13:51:04 +0900 (c31dd12)
@@ -76,6 +76,10 @@ module Logaling
       glossaries.any? {|glossary| glossary.to_s == [name, source_language, target_language].join('.') }
     end
 
+    def imported?
+      false
+    end
+
     private
     def all_glossary_source_path
       Dir.glob(File.join(glossary_source_path, "*"))
@@ -95,6 +99,10 @@ module Logaling
     def glossary_source_path
       File.dirname(@path)
     end
+
+    def imported?
+      true
+    end
   end
 
   class PersonalProject < Project
-------------- next part --------------
An HTML attachment was scrubbed...
Descargar 



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