lib/invoker/process_manager.rb in invoker-1.5.4 vs lib/invoker/process_manager.rb in invoker-1.5.5

- old
+ new

@@ -28,11 +28,11 @@ # Start a process given their name # @param process_name [String] Command label of process specified in config file. def start_process_by_name(process_name) if process_running?(process_name) - Invoker::Logger.puts "\nProcess '#{process_name}' is already running".color(:red) + Invoker::Logger.puts "\nProcess '#{process_name}' is already running".colorize(:red) return false end process_info = Invoker.config.process(process_name) start_process(process_info) if process_info @@ -47,11 +47,11 @@ worker = workers[remove_message.process_name] command_label = remove_message.process_name return false unless worker signal_to_use = remove_message.signal || 'INT' - Invoker::Logger.puts("Removing #{command_label} with signal #{signal_to_use}".color(:red)) + Invoker::Logger.puts("Removing #{command_label} with signal #{signal_to_use}".colorize(:red)) kill_or_remove_process(worker.pid, signal_to_use, command_label) end # Receive a message from user to restart a Process # @param [Invoker::IPC::Message::Reload] @@ -126,11 +126,11 @@ raise Invoker::Errors::ToomanyOpenConnections if @thread_group.enclosed? thread = Thread.new do Process.wait(pid) message = "Process with command #{command_label} exited with status #{$?.exitstatus}" - Invoker::Logger.puts("\n#{message}".color(:red)) + Invoker::Logger.puts("\n#{message}".colorize(:red)) Invoker.notify_user(message) Invoker.commander.trigger(command_label, :exit) end @thread_group.add(thread) end @@ -147,10 +147,10 @@ def kill_or_remove_process(pid, signal_to_use, command_label) process_kill(pid, signal_to_use) true rescue Errno::ESRCH - Invoker::Logger.puts("Killing process with #{pid} and name #{command_label} failed".color(:red)) + Invoker::Logger.puts("Killing process with #{pid} and name #{command_label} failed".colorize(:red)) remove_worker(command_label, false) false end def process_kill(pid, signal_to_use)