[logaling-commit] logaling/logaling-command [master] Compare project name in block instead of #reject

Zurück zum Archiv-Index

SUZUKI Miho null+****@clear*****
Fri Aug 17 16:13:49 JST 2012


SUZUKI Miho	2012-08-17 16:13:49 +0900 (Fri, 17 Aug 2012)

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

  Log:
    Compare project name in block instead of #reject

  Modified files:
    lib/logaling/repository.rb

  Modified: lib/logaling/repository.rb (+2 -3)
===================================================================
--- lib/logaling/repository.rb    2012-08-17 10:23:24 +0900 (64cc0e6)
+++ lib/logaling/repository.rb    2012-08-17 16:13:49 +0900 (9521be0)
@@ -132,9 +132,8 @@ module Logaling
     end
 
     def find_glossary(project_name, source_language, target_language)
-      project_candidates = projects.reject { |project| project.name != project_name }
-      project = project_candidates.detect do |project|
-        project.has_glossary?(source_language, target_language)
+      project = projects.detect do |project|
+        project.has_glossary?(source_language, target_language) if project.name == project_name
       end
       project ? project.glossary(source_language, target_language) : nil
     end
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Zurück zum Archiv-Index