Class: Groonga::QueryLog::Command::FormatRegressionTestLogs
- Inherits:
-
Object
- Object
- Groonga::QueryLog::Command::FormatRegressionTestLogs
- Defined in:
- lib/groonga/query-log/command/format-regression-test-logs.rb
Instance Method Summary collapse
-
#initialize ⇒ FormatRegressionTestLogs
constructor
A new instance of FormatRegressionTestLogs.
- #run(command_line) ⇒ Object
Constructor Details
#initialize ⇒ FormatRegressionTestLogs
Returns a new instance of FormatRegressionTestLogs.
32 33 |
# File 'lib/groonga/query-log/command/format-regression-test-logs.rb', line 32 def initialize end |
Instance Method Details
#run(command_line) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/groonga/query-log/command/format-regression-test-logs.rb', line 35 def run(command_line) parser = OptionParser.new parser. += " PATH1 PATH2 ..." parser.version = VERSION paths = parser.parse!(command_line) if paths.empty? format_log($stdin, "-") else paths.each do |path| if File.directory?(path) Find.find(path) do |sub_path| next unless File.file?(sub_path) File.open(sub_path) do |file| format_log(file, sub_path) end end else File.open(path) do |file| format_log(file, path) end end end end true end |