Class: Fyi

Inherits:
Object
  • Object
show all
Defined in:
lib/fyi.rb,
lib/fyi/config.rb,
lib/fyi/version.rb,
lib/fyi/notifiers/log.rb,
lib/fyi/notifiers/email.rb

Overview

See /bin/fyi for documentation.

Defined Under Namespace

Classes: Config, Notifier

Constant Summary collapse

VERSION =
'1.1.1'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Fyi

Returns a new instance of Fyi.



13
14
15
16
# File 'lib/fyi.rb', line 13

def initialize(command)
  @command = command
  @config = Config.new
end

Class Method Details

.run(command) ⇒ Object



9
10
11
# File 'lib/fyi.rb', line 9

def self.run(command)
  new(command).run
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
# File 'lib/fyi.rb', line 18

def run
  start_stopwatch
  status, stdout, stderr = systemu @command
  stop_stopwatch
  status.exitstatus.to_i == 0 ? run_succeeded(stdout, stderr) : run_failed(stdout, stderr)
rescue Object => e
  run_failed('', e.to_s)
end