Class: Fyi
- Inherits:
-
Object
- Object
- Fyi
- Defined in:
- lib/fyi.rb,
lib/fyi/config.rb,
lib/fyi/notifiers/log.rb,
lib/fyi/notifiers/email.rb
Overview
See /bin/fyi for documentation.
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(command) ⇒ Fyi
constructor
A new instance of Fyi.
- #run ⇒ Object
Constructor Details
Class Method Details
.run(command) ⇒ Object
10 11 12 |
# File 'lib/fyi.rb', line 10 def self.run(command) new(command).run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fyi.rb', line 19 def run # Borrowed from CI Joe. out, err, status = '', '', nil status = Open4.popen4(@command) do |@pid, stdin, stdout, stderr| err, out = stderr.read.strip, stdout.read.strip end status.exitstatus.to_i == 0 ? run_succeeded(out) : run_failed(out, err) rescue Object => e run_failed('', e.to_s) end |