SUZUKI Miho
null+****@clear*****
Fri Nov 9 16:27:22 JST 2012
SUZUKI Miho 2012-11-09 16:27:22 +0900 (Fri, 09 Nov 2012) New Revision: 0bb4d618e39ce82120630aba01d54d8d4770fff0 https://github.com/logaling/logaling-command/commit/0bb4d618e39ce82120630aba01d54d8d4770fff0 Log: Change structure of data Modified files: lib/logaling/glossary_db.rb Modified: lib/logaling/glossary_db.rb (+2 -4) =================================================================== --- lib/logaling/glossary_db.rb 2012-11-09 14:17:53 +0900 (444e3c4) +++ lib/logaling/glossary_db.rb 2012-11-09 16:27:22 +0900 (f03e6e1) @@ -229,10 +229,8 @@ module Logaling def get_all_glossary_sources source_paths = Groonga["glossary_sources"].sort([ {:key=>"_key", :order=>'ascending'} - ]).map{|record| {record.key => record.project_type}} - source_paths.map do |tmp_hash| - source_path = tmp_hash.keys.first - project_type = tmp_hash.values.first + ]).map{|record| [record.key, record.project_type]} + source_paths.map do |source_path, project_type| glossary_name, source_language, target_language = File.basename(source_path).split(/\./) project = Logaling.const_get(project_type).new(Logaling::Project.find_path(source_path)) glossary = Glossary.new(glossary_name, source_language, target_language, project) -------------- next part -------------- An HTML attachment was scrubbed... 다운로드