Class: Outback::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/outback/task.rb

Direct Known Subclasses

ShellTask

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTask

Returns a new instance of Task.



13
14
15
16
17
# File 'lib/outback/task.rb', line 13

def initialize
  @rollout, @rollback = lambda {}
  @stdout = StringIO.new
  @stderr = StringIO.new
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/outback/task.rb', line 10

def name
  @name
end

#stderrObject

Returns the value of attribute stderr.



11
12
13
# File 'lib/outback/task.rb', line 11

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



11
12
13
# File 'lib/outback/task.rb', line 11

def stdout
  @stdout
end

Instance Method Details

#rollback(&block) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/outback/task.rb', line 27

def rollback( &block )
  if block_given?
    @rollback = block
  else
    run @rollback
  end
end

#rollout(&block) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/outback/task.rb', line 19

def rollout( &block )
  if block_given?
    @rollout = block
  else
    run @rollout
  end
end