[Groonga-commit] droonga/drnbench at ffa6828 [master] Give all options to the utility method

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Mon Oct 6 13:38:42 JST 2014


SHIMODA "Piro" Hiroshi	2014-10-06 13:38:42 +0900 (Mon, 06 Oct 2014)

  New Revision: ffa68288f4ab317226cc0bdb097e8d5749136049
  https://github.com/droonga/drnbench/commit/ffa68288f4ab317226cc0bdb097e8d5749136049

  Message:
    Give all options to the utility method

  Modified files:
    bin/drnbench-extract-searchterms

  Modified: bin/drnbench-extract-searchterms (+4 -4)
===================================================================
--- bin/drnbench-extract-searchterms    2014-10-06 12:29:02 +0900 (e75f0d7)
+++ bin/drnbench-extract-searchterms    2014-10-06 13:38:42 +0900 (2594dad)
@@ -45,24 +45,24 @@ def escape_for_param(value)
   CGI.escape(value.to_s)
 end
 
-def output_column_value(select_result, column_index)
+def output_column_value(select_result, options)
   select_result = JSON.parse(select_result)
   body = select_result[1]
   search_result = body.first
   records = search_result[2..-1]
   records.each do |record|
-    value = record[column_index]
+    value = record[options.column_index]
     value = escape_for_param(value) if options.escape
     puts(value)
   end
 end
 
 if groonga_select_result_files.empty?
-  output_column_value($stdin.read, options.column_index)
+  output_column_value($stdin.read, options)
 else
   groonga_select_result_files.each do |select_result_file|
     File.open(select_result_file) do |input|
-      output_column_value(input.read, options.column_index)
+      output_column_value(input.read, options)
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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