SUZUKI Miho
null+****@clear*****
Thu Jan 17 11:00:24 JST 2013
SUZUKI Miho 2013-01-17 11:00:24 +0900 (Thu, 17 Jan 2013) New Revision: 4f978c77faa9d8305c11e525ad0408df178c5ef6 https://github.com/logaling/logaling-command/commit/4f978c77faa9d8305c11e525ad0408df178c5ef6 Log: Fix incompatible api problem for rroonga 2.1.0 Modified files: lib/logaling/glossary_db.rb logaling-command.gemspec Modified: lib/logaling/glossary_db.rb (+11 -4) =================================================================== --- lib/logaling/glossary_db.rb 2012-12-25 11:26:21 +0900 (37da575) +++ lib/logaling/glossary_db.rb 2013-01-17 11:00:24 +0900 (3f83a40) @@ -130,6 +130,7 @@ module Logaling {:key=>"glossary", :order=>'ascending'}, {:key=>"source_term", :order=>'ascending'}, {:key=>"target_term", :order=>'ascending'}]) + records = records.collect {|record| record.value } options = {:width => 5000, :html_escape => true, @@ -161,6 +162,7 @@ module Logaling {:key=>"_score", :order=>'descending'}, {:key=>"source_term", :order=>'ascending'}, {:key=>"target_term", :order=>'ascending'}]) + records = records.collect {|record| record.value } options = {:width => 5000, :html_escape => true, @@ -192,6 +194,7 @@ module Logaling {:key => "source_term", :order => order}, {:key => "target_term", :order => order} ]) + records = records.collect {|record| record.value } struct_result(records) end @@ -227,9 +230,11 @@ module Logaling end def get_all_glossary_sources - source_paths = Groonga["glossary_sources"].sort([ + records = Groonga["glossary_sources"].sort([ {:key=>"_key", :order=>'ascending'} - ]).map{|record| [record.key, record.project_type]} + ]) + records = records.collect {|record| record.value } + source_paths = records.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)) @@ -246,9 +251,11 @@ module Logaling end def get_all_glossary - Groonga["glossaries"].sort([ + records = Groonga["glossaries"].sort([ {:key=>"_key", :order=>'ascending'} - ]).map{|record| record.key} + ]) + records = records.collect {|record| record.value } + records.map{|record| record.key} end private Modified: logaling-command.gemspec (+1 -1) =================================================================== --- logaling-command.gemspec 2012-12-25 11:26:21 +0900 (c2989ae) +++ logaling-command.gemspec 2013-01-17 11:00:24 +0900 (850b881) @@ -38,7 +38,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'thor', ['>= 0.14.6'] s.add_runtime_dependency 'bundler', ['>= 1.0'] - s.add_runtime_dependency 'rroonga', ['>= 2.0.3'] + s.add_runtime_dependency 'rroonga', ['>= 2.1.0'] s.add_runtime_dependency 'rainbow' s.add_runtime_dependency 'nokogiri' s.add_runtime_dependency 'activesupport' -------------- next part -------------- An HTML attachment was scrubbed... Télécharger