Class: Runbook::Statements::Assert

Inherits:
Runbook::Statement show all
Defined in:
lib/runbook/statements/assert.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#parent

Instance Method Summary collapse

Methods inherited from Runbook::Statement

#render, #run

Methods included from Hooks::Invoker

#_execute_after_hooks, #_execute_around_hooks, #_execute_before_hooks, #invoke_with_hooks

Methods inherited from Node

#dynamic!, #dynamic?, #parent_entity, #visited!, #visited?

Constructor Details

#initialize(cmd, cmd_ssh_config: nil, cmd_raw: false, interval: 1, timeout: 0, attempts: 0, abort_statement: nil, timeout_statement: nil) ⇒ Assert

Returns a new instance of Assert.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/runbook/statements/assert.rb', line 12

def initialize(
  cmd,
  cmd_ssh_config: nil,
  cmd_raw: false,
  interval: 1,
  timeout: 0,
  attempts: 0,
  abort_statement: nil,
  timeout_statement: nil
)
  @cmd = cmd
  @cmd_ssh_config = cmd_ssh_config
  @cmd_raw = cmd_raw
  @interval = interval
  @timeout = timeout
  @attempts = attempts
  if timeout_statement
    Runbook.deprecator.deprecation_warning(:timeout_statement, :abort_statement)
  end
  @abort_statement = abort_statement || timeout_statement
end

Instance Attribute Details

#abort_statementObject (readonly)

Returns the value of attribute abort_statement.



5
6
7
# File 'lib/runbook/statements/assert.rb', line 5

def abort_statement
  @abort_statement
end

#attemptsObject (readonly)

Returns the value of attribute attempts.



4
5
6
# File 'lib/runbook/statements/assert.rb', line 4

def attempts
  @attempts
end

#cmdObject (readonly)

Returns the value of attribute cmd.



3
4
5
# File 'lib/runbook/statements/assert.rb', line 3

def cmd
  @cmd
end

#cmd_rawObject (readonly)

Returns the value of attribute cmd_raw.



3
4
5
# File 'lib/runbook/statements/assert.rb', line 3

def cmd_raw
  @cmd_raw
end

#cmd_ssh_configObject (readonly)

Returns the value of attribute cmd_ssh_config.



3
4
5
# File 'lib/runbook/statements/assert.rb', line 3

def cmd_ssh_config
  @cmd_ssh_config
end

#intervalObject (readonly)

Returns the value of attribute interval.



4
5
6
# File 'lib/runbook/statements/assert.rb', line 4

def interval
  @interval
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



4
5
6
# File 'lib/runbook/statements/assert.rb', line 4

def timeout
  @timeout
end

Instance Method Details

#timeout_statementObject



7
8
9
10
# File 'lib/runbook/statements/assert.rb', line 7

def timeout_statement
  Runbook.deprecator.deprecation_warning(:timeout_statement, :abort_statement)
  @abort_statement
end