Class: Invoker::CLI
- Inherits:
-
Thor
show all
- Defined in:
- lib/invoker/cli.rb
Defined Under Namespace
Classes: Pinger, Question, Tail, TailWatcher
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.start(*args) ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'lib/invoker/cli.rb', line 6
def self.start(*args)
cli_args = args.flatten
if default_start_command?(cli_args)
args = [cli_args.unshift("start")]
end
super(*args)
end
|
Instance Method Details
#add(name) ⇒ Object
58
59
60
|
# File 'lib/invoker/cli.rb', line 58
def add(name)
unix_socket.send_command('add', process_name: name)
end
|
#add_http(name, port, ip = nil) ⇒ Object
63
64
65
|
# File 'lib/invoker/cli.rb', line 63
def add_http(name, port, ip = nil)
unix_socket.send_command('add_http', process_name: name, port: port, ip: ip)
end
|
#list ⇒ Object
92
93
94
95
96
97
98
99
100
|
# File 'lib/invoker/cli.rb', line 92
def list
unix_socket.send_command('list') do |response_object|
if options[:raw]
Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_raw_text }
else
Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_table }
end
end
end
|
#log(process_name) ⇒ Object
74
75
76
|
# File 'lib/invoker/cli.rb', line 74
def log(process_name)
system("egrep -a '^#{process_name}' #{Invoker.daemon.log_file}")
end
|
#reload(name) ⇒ Object
82
83
84
85
|
# File 'lib/invoker/cli.rb', line 82
def reload(name)
signal = options[:signal] || 'INT'
unix_socket.send_command('reload', process_name: name, signal: signal)
end
|
#remove(name) ⇒ Object
106
107
108
109
|
# File 'lib/invoker/cli.rb', line 106
def remove(name)
signal = options[:signal] || 'INT'
unix_socket.send_command('remove', process_name: name, signal: signal)
end
|
#start(file = nil) ⇒ Object
#stop ⇒ Object
112
113
114
|
# File 'lib/invoker/cli.rb', line 112
def stop
Invoker.daemon.stop
end
|
#tail(*names) ⇒ Object
68
69
70
71
|
# File 'lib/invoker/cli.rb', line 68
def tail(*names)
tailer = Invoker::CLI::Tail.new(names)
tailer.run
end
|