class FluentBinlogReader

Constants

HELP_TEXT
SUBCOMMAND

Public Class Methods

new(argv = ARGV) click to toggle source
# File lib/fluent/command/binlog_reader.rb, line 38
def initialize(argv = ARGV)
  @argv = argv
end

Public Instance Methods

call() click to toggle source
# File lib/fluent/command/binlog_reader.rb, line 42
def call
  command_class = BinlogReaderCommand.const_get(command)
  command_class.new(@argv).call
end

Private Instance Methods

command() click to toggle source
# File lib/fluent/command/binlog_reader.rb, line 49
def command
  command = @argv.shift
  if !command || !SUBCOMMAND.include?(command)
    usage "Required subcommand : #{SUBCOMMAND.join(' | ')}"
  end

  command.split('_').map(&:capitalize).join('')
end
usage(msg = nil) click to toggle source
# File lib/fluent/command/binlog_reader.rb, line 58
def usage(msg = nil)
  puts HELP_TEXT
  puts "Error: #{msg}" if msg
  exit 1
end