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.



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

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

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

Instance Method Details

#executeObject



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

def execute
  load_boot_file

  if config_file
    validate_config_file!
    Phobos.configure(config_file)
  end

  Phobos.add_listeners(listeners_file) if listeners_file

  validate_listeners!

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