Kouhei Sutou
null+****@clear*****
Fri Oct 27 18:10:09 JST 2017
Kouhei Sutou 2017-10-27 18:10:09 +0900 (Fri, 27 Oct 2017) New Revision: c56b006e9652babef20988d04e9f68b0b09bb438 https://github.com/ranguba/groonga-client/commit/c56b006e9652babef20988d04e9f68b0b09bb438 Message: Extract common methods Modified files: lib/groonga/client/command-line/groonga-client-index-check.rb lib/groonga/client/command-line/groonga-client-index-recreate.rb lib/groonga/client/command-line/runner.rb Modified: lib/groonga/client/command-line/groonga-client-index-check.rb (+0 -24) =================================================================== --- lib/groonga/client/command-line/groonga-client-index-check.rb 2017-10-27 18:07:41 +0900 (92fbd3e) +++ lib/groonga/client/command-line/groonga-client-index-check.rb 2017-10-27 18:10:09 +0900 (e8edb7a) @@ -84,30 +84,6 @@ module Groonga succeeded end - def table_list - execute_command(:table_list) - end - - def column_list(table_name) - execute_command(:column_list, - :table => table_name) - end - - def column_create(table_name, name, flags, type, source) - execute_command(:column_create, - :table => table_name, - :name => name, - :flags => flags, - :type => type, - :source => source) - end - - def column_remove(table_name, column_name) - execute_command(:column_remove, - :table => table_name, - :name => column_name) - end - def check_target_table?(table_name) unles****@targe***** > 0 return true Modified: lib/groonga/client/command-line/groonga-client-index-recreate.rb (+0 -29) =================================================================== --- lib/groonga/client/command-line/groonga-client-index-recreate.rb 2017-10-27 18:07:41 +0900 (c1661f1) +++ lib/groonga/client/command-line/groonga-client-index-recreate.rb 2017-10-27 18:10:09 +0900 (be01833) @@ -91,35 +91,6 @@ module Groonga true end - def config_get(key) - execute_command(:config_get, :key => key).body - end - - def config_set(key, value) - execute_command(:config_set, :key => key, :value => value).body - end - - def object_exist?(name) - execute_command(:object_exist, :name => name).body - end - - def column_rename(table, name, new_name) - execute_command(:column_rename, - :table => table, - :name => name, - :new_name => new_name).body - end - - def column_list(table) - execute_command(:column_list, :table => table) - end - - def column_remove(table, column) - execute_command(:column_remove, - :table => table, - :name => column) - end - def column_create_similar(table, column_name, base_column_name) info = execute_command(:schema)["#{table}.#{base_column_name}"] arguments = info.command.arguments.merge("name" => column_name) Modified: lib/groonga/client/command-line/runner.rb (+42 -0) =================================================================== --- lib/groonga/client/command-line/runner.rb 2017-10-27 18:07:41 +0900 (e9e7535) +++ lib/groonga/client/command-line/runner.rb 2017-10-27 18:10:09 +0900 (3bd3623) @@ -42,6 +42,48 @@ module Groonga end response end + + def config_get(key) + execute_command(:config_get, :key => key).body + end + + def config_set(key, value) + execute_command(:config_set, :key => key, :value => value).body + end + + def object_exist?(name) + execute_command(:object_exist, :name => name).body + end + + def table_list + execute_command(:table_list) + end + + def column_list(table) + execute_command(:column_list, :table => table) + end + + def column_create(table_name, name, flags, type, source) + execute_command(:column_create, + :table => table_name, + :name => name, + :flags => flags, + :type => type, + :source => source).body + end + + def column_remove(table, column) + execute_command(:column_remove, + :table => table, + :name => column).body + end + + def column_rename(table, name, new_name) + execute_command(:column_rename, + :table => table, + :name => name, + :new_name => new_name).body + end end end end -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171027/56f077bb/attachment-0001.htm