Class: RoCommands::Processes

Inherits:
Base show all
Defined in:
lib/ro_commands/processes.rb

Instance Method Summary collapse

Methods inherited from Base

describe, inherited, method_added, meths, start, usage

Methods included from Bash

#_bash, #add_time, #bash, #bash_capture, #bash_capture_array, #bash_lines, #bash_per, #bash_system, #bundle_exec, #err, err, #handle_path, #kernel_system, out, #out, #status, status

Instance Method Details

#kill(keyword) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/ro_commands/processes.rb', line 4

def kill(keyword)
  `ps aux | grep #{keyword}`.split("\n").each do |process|
    puts process
    pid = process.scan(/\d+/).first
    bash "kill #{pid}"
  end
end