lib/invoker/runner.rb in invoker-0.1.2 vs lib/invoker/runner.rb in invoker-1.0.0
- old
+ new
@@ -12,10 +12,12 @@
end
def self.run_command(selected_command)
return unless selected_command
case selected_command.command
+ when 'setup'
+ setup_pow(selected_command)
when 'start'
start_server(selected_command)
when 'add'
add_command(selected_command)
when 'reload'
@@ -27,12 +29,16 @@
else
Invoker::Logger.puts "Invalid command"
end
end
+ def self.setup_pow(selected_command)
+ Invoker::Power::Setup.install()
+ end
+
def self.start_server(selected_command)
- config = Invoker::Parsers::Config.new(selected_command.file)
+ config = Invoker::Parsers::Config.new(selected_command.file, selected_command.port)
Invoker.const_set(:CONFIG, config)
warn_about_terminal_notifier()
commander = Invoker::Commander.new()
Invoker.const_set(:COMMANDER, commander)
commander.start_manager()
@@ -69,10 +75,10 @@
def self.warn_about_terminal_notifier
if RUBY_PLATFORM.downcase.include?("darwin")
command_path = `which terminal-notifier`
if !command_path || command_path.empty?
- Invoker::Logger.puts("You can enable OSX notification for processes by installing terminal-notifier gem".red)
+ Invoker::Logger.puts("You can enable OSX notification for processes by installing terminal-notifier gem".color(:red))
end
end
end
end