Kouhei Sutou
null+****@clear*****
Tue Dec 20 16:34:41 JST 2016
Kouhei Sutou 2016-12-20 16:34:41 +0900 (Tue, 20 Dec 2016) New Revision: bd04b97d1442d669f3d3673adc1ed11f003e4529 https://github.com/ranguba/groonga-client-model/commit/bd04b97d1442d669f3d3673adc1ed11f003e4529 Message: Support loading db/schema.grn Modified files: groonga-client-model.gemspec lib/groonga_client_model/test_helper.rb test/apps/rails5/Gemfile.lock Modified: groonga-client-model.gemspec (+1 -1) =================================================================== --- groonga-client-model.gemspec 2016-12-20 14:13:17 +0900 (08ddbad) +++ groonga-client-model.gemspec 2016-12-20 16:34:41 +0900 (0e31b0e) @@ -43,7 +43,7 @@ Gem::Specification.new do |spec| spec.files += Dir.glob("doc/text/*") spec.test_files += Dir.glob("test/**/*") - spec.add_runtime_dependency("groonga-client", ">= 0.3.5") + spec.add_runtime_dependency("groonga-client", ">= 0.3.6") spec.add_runtime_dependency("groonga-command-parser") spec.add_runtime_dependency("activemodel") Modified: lib/groonga_client_model/test_helper.rb (+25 -0) =================================================================== --- lib/groonga_client_model/test_helper.rb 2016-12-20 14:13:17 +0900 (fb4b980) +++ lib/groonga_client_model/test_helper.rb 2016-12-20 16:34:41 +0900 (8799406) @@ -22,6 +22,31 @@ module GroongaClientModel included do include Groonga::Client::TestHelper + + setup do + return if @groonga_server_runner.using_running_server? + + if defined?(Rails) + base_dir = Rails.root + else + base_dir = Pathname.pwd + end + schema_grn = base_dir + "db" + "schema.grn" + return unless schema_grn.exist? + + Client.open do |client| + parser = Groonga::Command::Parser.new + parser.on_command do |command| + client.execute(command) + end + schema_grn.open do |schema| + schema.each_line do |line| + parser << line + end + end + parser.finish + end + end end end end Modified: test/apps/rails5/Gemfile.lock (+16 -18) =================================================================== --- test/apps/rails5/Gemfile.lock 2016-12-20 14:13:17 +0900 (0ccfe0b) +++ test/apps/rails5/Gemfile.lock 2016-12-20 16:34:41 +0900 (bdf950e) @@ -1,17 +1,18 @@ PATH remote: ../../../../groonga-client specs: - groonga-client (0.3.5) + groonga-client (0.3.7) gqtp (>= 1.0.4) groonga-command (>= 1.2.8) + groonga-command-parser (>= 1.0.7) hashie PATH remote: ../../../ specs: - groonga-client-model (0.9.0) + groonga-client-model (0.9.2) activemodel - groonga-client (>= 0.3.4) + groonga-client (>= 0.3.6) groonga-command-parser GEM @@ -63,28 +64,25 @@ GEM coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.11.1) - concurrent-ruby (1.0.2) + coffee-script-source (1.12.2) + concurrent-ruby (1.0.3) debug_inspector (0.0.2) erubis (2.7.0) execjs (2.7.0) - factory_girl (4.5.0) + factory_girl (4.8.0) activesupport (>= 3.0.0) - factory_girl_rails (4.6.0) - factory_girl (~> 4.5.0) + factory_girl_rails (4.8.0) + factory_girl (~> 4.8.0) railties (>= 3.0.0) ffi (1.9.14) - ffi-yajl (2.2.3) - libyajl2 (~> 1.2) globalid (0.3.7) activesupport (>= 4.1.0) gqtp (1.0.6) groonga-command (1.3.1) json - groonga-command-parser (1.0.5) - ffi - ffi-yajl + groonga-command-parser (1.0.7) groonga-command (>= 1.0.9) + json-stream hashie (3.4.6) i18n (0.7.0) jbuilder (2.6.1) @@ -95,7 +93,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.0.2) - libyajl2 (1.2.0) + json-stream (0.2.1) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -108,7 +106,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) - minitest (5.10.0) + minitest (5.10.1) multi_json (1.12.1) nio4r (1.2.1) nokogiri (1.6.8.1) @@ -140,11 +138,11 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (11.3.0) + rake (12.0.0) rb-fsevent (0.9.8) rb-inotify (0.9.7) ffi (>= 0.5.0) - sass (3.4.22) + sass (3.4.23) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) @@ -156,7 +154,7 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (3.7.0) + sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.0) -------------- next part -------------- HTML����������������������������... 下载