Class: Phobos::CLI::Start

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Start

Returns a new instance of Start.



6
7
8
9
10
11
12
13
14
15
# File 'lib/phobos/cli/start.rb', line 6

def initialize(options)
  unless options[:skip_config]
    @config_file = File.expand_path(options[:config])
  end
  @boot_file = File.expand_path(options[:boot])

  if options[:listeners]
    @listeners_file = File.expand_path(options[:listeners])
  end
end

Instance Method Details

#executeObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/phobos/cli/start.rb', line 17

def execute
  load_boot_file

  if config_file
    validate_config_file!
    Phobos.configure(config_file)
  end

  if listeners_file
    Phobos.add_listeners(listeners_file)
  end

  validate_listeners!

  Phobos::CLI::Runner.new.run!
end