Class: Safit::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/safit/cli.rb

Instance Method Summary collapse

Instance Method Details

#doneObject



43
44
45
# File 'lib/safit/cli.rb', line 43

def done
  Safit::Gntp.notify 'done'
end

#exec(*command) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/safit/cli.rb', line 30

def exec(*command)
  cmd = command.join(' ')

  Kernel.fork do
    Process.exec cmd
  end

  Process.wait
  Safit::Gntp.notify $?.success? ? "DONE: #{cmd}" : "FAIL: #{cmd}"
  exit $?.exitstatus
end

#notify(message) ⇒ Object



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

def notify(message)
  Safit::Gntp.notify message
end