Class: Webhookd::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/webhookd/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/webhookd/cli.rb', line 7

def name
  @name
end

Instance Method Details

#start(*args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/webhookd/cli.rb', line 11

def start(*args)
  port_option = args.include?('-p') ? '' : ' -p 8088'
  args = args.join(' ')
  command = "thin -R #{get_rackup_config} start#{port_option} #{args}"
  command.prepend "export CONFIG_FILE=#{options[:config_file]}; " if options[:config_file]
  begin
    run_command(command)
  rescue SystemExit, Interrupt
    puts "Program interrupted"
    exit
  end
end

#stopObject



25
26
27
28
# File 'lib/webhookd/cli.rb', line 25

def stop
  command = "thin -R #{get_rackup_config} stop"
  run_command(command)
end