class Runbook::AirbrusshContext

Attributes

current_task_name[R]
history[R]

Public Class Methods

new(config=Airbrussh.configuration) click to toggle source
# File lib/runbook/airbrussh_context.rb, line 5
def initialize(config=Airbrussh.configuration)
  @history = []
end

Public Instance Methods

position(command) click to toggle source
# File lib/runbook/airbrussh_context.rb, line 16
def position(command)
  history.rindex(command.to_s)
end
register_new_command(command) click to toggle source
# File lib/runbook/airbrussh_context.rb, line 9
def register_new_command(command)
  hist_entry = command.to_s
  first_execution = history.last != hist_entry
  history << hist_entry if first_execution
  first_execution
end
set_current_task_name(task_name) click to toggle source
# File lib/runbook/airbrussh_context.rb, line 20
def set_current_task_name(task_name)
  @current_task_name = task_name
  history.clear
end