Class: JsTestDriver::Runner::Command
- Inherits:
-
Object
- Object
- JsTestDriver::Runner::Command
- Defined in:
- lib/js_test_driver/runner.rb
Instance Method Summary collapse
-
#initialize(executable) ⇒ Command
constructor
A new instance of Command.
- #option(name, value = nil) ⇒ Object
- #run ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(executable) ⇒ Command
211 212 213 |
# File 'lib/js_test_driver/runner.rb', line 211 def initialize(executable) @command = "#{executable}" end |
Instance Method Details
#option(name, value = nil) ⇒ Object
215 216 217 218 219 |
# File 'lib/js_test_driver/runner.rb', line 215 def option(name, value = nil) value = "'#{value}'" if value && value =~ /\s/ @command = [@command, name, value].compact.join(' ') self end |
#run ⇒ Object
221 222 223 224 |
# File 'lib/js_test_driver/runner.rb', line 221 def run puts "Running #{self.to_s} with DISPLAY=#{ENV['DISPLAY']}" system(self.to_s) end |
#to_s ⇒ Object
226 227 228 |
# File 'lib/js_test_driver/runner.rb', line 226 def to_s return @command end |