Class: Outback::TaskHelper
- Inherits:
-
Object
- Object
- Outback::TaskHelper
- Defined in:
- lib/outback/task_helper.rb
Instance Method Summary collapse
-
#initialize(task) ⇒ TaskHelper
constructor
A new instance of TaskHelper.
- #puts(*args) ⇒ Object
- #sys(*args) ⇒ Object
Constructor Details
#initialize(task) ⇒ TaskHelper
Returns a new instance of TaskHelper.
5 6 7 |
# File 'lib/outback/task_helper.rb', line 5 def initialize( task ) @task = task end |
Instance Method Details
#puts(*args) ⇒ Object
15 16 17 |
# File 'lib/outback/task_helper.rb', line 15 def puts( *args ) @task.stdout.puts *args end |
#sys(*args) ⇒ Object
9 10 11 12 13 |
# File 'lib/outback/task_helper.rb', line 9 def sys( *args ) pid, i, o, e = Open4.popen4(*args) o.each_line { |l| @task.stdout.print "[#{pid}] #{l}" } e.each_line { |l| @task.stderr.print "E [#{pid}] #{l}" } end |