Class: Groonga::QueryLog::Command::CheckCommandVersionCompatibility
- Inherits:
-
Object
- Object
- Groonga::QueryLog::Command::CheckCommandVersionCompatibility
- Defined in:
- lib/groonga/query-log/command/check-command-version-compatibility.rb
Instance Method Summary collapse
-
#initialize ⇒ CheckCommandVersionCompatibility
constructor
A new instance of CheckCommandVersionCompatibility.
- #run(command_line) ⇒ Object
Constructor Details
#initialize ⇒ CheckCommandVersionCompatibility
Returns a new instance of CheckCommandVersionCompatibility.
25 26 27 |
# File 'lib/groonga/query-log/command/check-command-version-compatibility.rb', line 25 def initialize @options = CommandVersionCompatibilityChecker::Options.new end |
Instance Method Details
#run(command_line) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/groonga/query-log/command/check-command-version-compatibility.rb', line 29 def run(command_line) input_paths = create_parser.parse(command_line) checker = CommandVersionCompatibilityChecker.new(@options) checker.start do compatible = true if input_paths.empty? compatible = false unless checker.check($stdin) else input_paths.each do |input_path| File.open(input_path) do |input| compatible = false unless checker.check(input) end end end compatible end end |