[Groonga-commit] ranguba/groonga-client at 9a817ce [master] Use instance variable instead of Hash access

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Oct 27 16:38:32 JST 2017


Kouhei Sutou	2017-10-27 16:38:32 +0900 (Fri, 27 Oct 2017)

  New Revision: 9a817ce8642f4829fa21c88b1124edf8d0c0edb1
  https://github.com/ranguba/groonga-client/commit/9a817ce8642f4829fa21c88b1124edf8d0c0edb1

  Message:
    Use instance variable instead of Hash access

  Modified files:
    lib/groonga/client/command-line/groonga-client-index-check.rb

  Modified: lib/groonga/client/command-line/groonga-client-index-check.rb (+9 -8)
===================================================================
--- lib/groonga/client/command-line/groonga-client-index-check.rb    2017-10-27 16:35:39 +0900 (69882f2)
+++ lib/groonga/client/command-line/groonga-client-index-check.rb    2017-10-27 16:38:32 +0900 (8badf41)
@@ -43,7 +43,7 @@ module Groonga
             options = {
               :check_missing_source => @check_missing_source,
               :check_index_integrity => @check_index_integrity,
-              :target => targets
+              :targets => targets,
             }
             checker = Checker.new(client, options)
             checker.check
@@ -100,6 +100,7 @@ module Groonga
           def initialize(client, options)
             @client = client
             @options = options
+            @targets = @options[:targets]
             @exit_code = 0
           end
 
@@ -154,11 +155,11 @@ module Groonga
           end
 
           def check_target_table?(table_name)
-            unless @options[:target].count > 0
+            unles****@targe***** > 0
               return true
             end
-            if @options[:target].kind_of?(Array)
-              @options[:target].each do |name|
+            if****@targe*****_of?(Array)
+              @targets.each do |name|
                 table_part = name.split(".").first
                 return true if table_name == table_part
               end
@@ -167,15 +168,15 @@ module Groonga
           end
 
           def check_target_column?(column)
-            unless @options[:target].count > 0
+            unles****@targe***** > 0
               return column["type"] == "index"
             else
               unless column["type"] == "index"
                 return false
               end
             end
-            if @options[:target].kind_of?(Array)
-              @options[:target].each do |name|
+            if****@targe*****_of?(Array)
+              @targets.each do |name|
                 return true if name == "#{column['domain']}.#{column['name']}" or
                   name == column["domain"]
               end
@@ -267,7 +268,7 @@ module Groonga
             end
             if target_columns.empty?
               @exit_code = 1
-              abort_run("Failed to check <#{@options[:target].join(',')}> because there is no such a LEXCON.INDEX.")
+              abort_run("Failed to check <#{@targets.join(',')}> because there is no such a LEXCON.INDEX.")
             end
             broken_indexes = []
             target_columns.each do |column|
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171027/1a0fb085/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index