Class: Loader

Inherits:
Object show all
Defined in:
lib/maws/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_path, config_config_path) ⇒ Loader

Returns a new instance of Loader.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/maws/loader.rb', line 12

def initialize(base_path, config_config_path)
  @base_path = base_path
  @cc_path = config_config_path
  @commands_path = File.expand_path("commands/", File.dirname(__FILE__))

  # stores all config
  @config = mash
  @command = nil

  Loader.config_file_must_exist!('main', @cc_path)

  @command_options_parser = CommandOptionsParser.new(@config)
end

Instance Method Details

#load_and_runObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/maws/loader.rb', line 26

def load_and_run
  load_config
  load_command
  initialize_command

  parse_command_line_options
  verify_command

  @maws = Maws.new(@config, @command)
  @command.maws = @maws

  @maws.run!
end