class FluentBinlogReader
Constants
- HELP_TEXT
- SUBCOMMAND
Public Class Methods
new(argv = ARGV)
click to toggle source
# File lib/fluent/command/binlog_reader.rb, line 40 def initialize(argv = ARGV) @argv = argv end
Public Instance Methods
call()
click to toggle source
# File lib/fluent/command/binlog_reader.rb, line 44 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 51 def command command = @argv.shift if command if command == '--version' puts "#{File.basename($PROGRAM_NAME)} #{Fluent::VERSION}" exit 0 elsif !SUBCOMMAND.include?(command) usage "'#{command}' is not supported: Required subcommand : #{SUBCOMMAND.join(' | ')}" end else 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 67 def usage(msg = nil) puts HELP_TEXT puts "Error: #{msg}" if msg exit 1 end