Class: FluentdRegexpTester::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/fluentd_regexp_tester/cli.rb

Instance Method Summary collapse

Instance Method Details

#test(regexp, input) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fluentd_regexp_tester/cli.rb', line 11

def test(regexp, input)
  error, parsed, parsed_time = FluentdRegexpTester.parse(input, regexp)
  if error != nil
    STDERR.puts error
    exit!
  end
  if parsed == nil
    STDERR.puts "Failed to parse '#{input}' with '#{regexp}'"
    exit!
  end
  puts parsed.inspect
  puts parsed_time.to_s
end

#versionObject



26
27
28
# File 'lib/fluentd_regexp_tester/cli.rb', line 26

def version
  puts FluentdRegexpTester::VERSION
end