Class: BubBot::CLI

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

Constant Summary collapse

DEFAULT_CONFIG_FILENAME =
'bub_bot.yml'

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CLI

Returns a new instance of CLI.



5
6
7
8
9
# File 'lib/bub_bot/cli.rb', line 5

def initialize(args)
  @args = args

  @filename = args[0] || DEFAULT_CONFIG_FILENAME
end

Instance Method Details

#startObject



11
12
13
14
15
16
17
# File 'lib/bub_bot/cli.rb', line 11

def start
  print_usage && return unless check_usage

  configure_from_file(@filename)

  BubBot.start
end