Class: Mediakit::Drivers::FakeDriver
- Inherits:
-
PopenDriver
- Object
- Base
- PopenDriver
- Mediakit::Drivers::FakeDriver
- Defined in:
- lib/mediakit/drivers.rb
Instance Attribute Summary collapse
-
#error_output ⇒ Object
Returns the value of attribute error_output.
-
#exit_status ⇒ Object
Returns the value of attribute exit_status.
-
#last_command ⇒ Object
Returns the value of attribute last_command.
-
#nice ⇒ Object
Returns the value of attribute nice.
-
#output ⇒ Object
Returns the value of attribute output.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Attributes inherited from Base
Instance Method Summary collapse
- #reset ⇒ Object
-
#run(*args) ⇒ String
fake driver for testing.
Methods inherited from PopenDriver
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mediakit::Drivers::Base
Instance Attribute Details
#error_output ⇒ Object
Returns the value of attribute error_output.
66 67 68 |
# File 'lib/mediakit/drivers.rb', line 66 def error_output @error_output end |
#exit_status ⇒ Object
Returns the value of attribute exit_status.
66 67 68 |
# File 'lib/mediakit/drivers.rb', line 66 def exit_status @exit_status end |
#last_command ⇒ Object
Returns the value of attribute last_command.
66 67 68 |
# File 'lib/mediakit/drivers.rb', line 66 def last_command @last_command end |
#nice ⇒ Object
Returns the value of attribute nice.
66 67 68 |
# File 'lib/mediakit/drivers.rb', line 66 def nice @nice end |
#output ⇒ Object
Returns the value of attribute output.
66 67 68 |
# File 'lib/mediakit/drivers.rb', line 66 def output @output end |
#timeout ⇒ Object
Returns the value of attribute timeout.
66 67 68 |
# File 'lib/mediakit/drivers.rb', line 66 def timeout @timeout end |
Instance Method Details
#reset ⇒ Object
85 86 87 |
# File 'lib/mediakit/drivers.rb', line 85 def reset @last_command, @output, @error_output, @exit_status, @timeout, @nice = nil end |
#run(args) ⇒ String #run(*args, options) ⇒ String
fake driver for testing
76 77 78 79 80 81 82 83 |
# File 'lib/mediakit/drivers.rb', line 76 def run(*args) @last_command = command(*args) , rest_args = (args.dup) @timeout = [:timeout] if [:timeout] @nice = [:nice] if [:nice] [(output || ''), (error_output || ''), (exit_status || true)] end |