Class: Sportsflix::Utils::Executor
- Inherits:
-
Object
- Object
- Sportsflix::Utils::Executor
- Defined in:
- lib/sportsflix/utils/exec.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Executor
constructor
A new instance of Executor.
- #run(cmd) ⇒ Object
Constructor Details
#initialize(options) ⇒ Executor
Returns a new instance of Executor.
5 6 7 |
# File 'lib/sportsflix/utils/exec.rb', line 5 def initialize() @verbose = [:verbose] end |
Instance Method Details
#run(cmd) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/sportsflix/utils/exec.rb', line 9 def run(cmd) puts "[Running] #{cmd}" if @verbose output = `#{cmd}` { :output => output, :success? => $?.success?, } end |