Class: Stove::Runner

Inherits:
Object
  • Object
show all
Includes:
Logify, Mixin::Instanceable, Mixin::Optionable
Defined in:
lib/stove/runner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixin::Optionable

extended, included

Methods included from Mixin::Instanceable

extended, included

Constructor Details

#initializeRunner

Returns a new instance of Runner.



28
29
30
# File 'lib/stove/runner.rb', line 28

def initialize
  @validations = []
end

Instance Attribute Details

#cookbookObject (readonly)

Returns the value of attribute cookbook.



14
15
16
# File 'lib/stove/runner.rb', line 14

def cookbook
  @cookbook
end

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/stove/runner.rb', line 15

def options
  @options
end

#validationsObject (readonly)

Returns the value of attribute validations.



16
17
18
# File 'lib/stove/runner.rb', line 16

def validations
  @validations
end

Class Method Details

.action(id) ⇒ Object



8
9
10
11
# File 'lib/stove/runner.rb', line 8

def action(id)
  actions << id
  filters[id] = { before: [], after: [] }
end

Instance Method Details

#run(cookbook, options = {}) ⇒ Object



32
33
34
35
36
37
# File 'lib/stove/runner.rb', line 32

def run(cookbook, options = {})
  @cookbook, @options = cookbook, options

  run_validations
  run_actions
end