Class: Fyi
- Inherits:
-
Object
- Object
- Fyi
- 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
Constant Summary collapse
- VERSION =
'1.2.0'
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
9 10 11 |
# File 'lib/fyi.rb', line 9 def self.run(command) new(command).run end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fyi.rb', line 18 def run start_stopwatch # Append ";" to command to force Ruby to invoke via shell. # # Open3.capture3 -> Open3.popen3 -> Process.spawn # Process.spawn is similar to Kernel.system # Kernel.system is similar to Kernel.exec. stdout, stderr, status = Open3.capture3 "#{@command};" stop_stopwatch status.success? ? run_succeeded(stdout, stderr) : run_failed(stdout, stderr) rescue Object => e run_failed('', e.to_s) end |