Class: CfScript::Executor::Recorder

Inherits:
Object
  • Object
show all
Defined in:
lib/cf_script/executor/recorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(executor = nil) ⇒ Recorder

Returns a new instance of Recorder.



4
5
6
7
# File 'lib/cf_script/executor/recorder.rb', line 4

def initialize(executor = nil)
  @executions = []
  @executor   = executor || CfScript.config.runtime.executor
end

Instance Attribute Details

#executionsObject (readonly)

Returns the value of attribute executions.



2
3
4
# File 'lib/cf_script/executor/recorder.rb', line 2

def executions
  @executions
end

Instance Method Details

#dumpObject



15
16
17
# File 'lib/cf_script/executor/recorder.rb', line 15

def dump
  puts @executions.join("\n")
end

#execute(env, command_line) ⇒ Object



9
10
11
12
13
# File 'lib/cf_script/executor/recorder.rb', line 9

def execute(env, command_line)
  @executions << command_line

  @executor.execute(env, command_line)
end