Class: Automatic::Recipe
- Inherits:
-
Object
- Object
- Automatic::Recipe
- Defined in:
- lib/automatic/recipe.rb
Instance Attribute Summary collapse
-
#procedure ⇒ Object
readonly
Returns the value of attribute procedure.
Instance Method Summary collapse
- #each_plugin ⇒ Object
-
#initialize(path = "") ⇒ Recipe
constructor
A new instance of Recipe.
- #load_recipe(path) ⇒ Object
Constructor Details
#initialize(path = "") ⇒ Recipe
Returns a new instance of Recipe.
17 18 19 |
# File 'lib/automatic/recipe.rb', line 17 def initialize(path = "") load_recipe(path) end |
Instance Attribute Details
#procedure ⇒ Object (readonly)
Returns the value of attribute procedure.
15 16 17 |
# File 'lib/automatic/recipe.rb', line 15 def procedure @procedure end |
Instance Method Details
#each_plugin ⇒ Object
28 29 30 31 32 |
# File 'lib/automatic/recipe.rb', line 28 def each_plugin @procedure.plugins.each {|plugin| yield plugin } end |
#load_recipe(path) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/automatic/recipe.rb', line 21 def load_recipe(path) dir = File.join((File.('~/.automatic/config/')), path) path = dir if File.exist?(dir) Automatic::Log.puts("info", "Loading: #{path}") @procedure = Hashie::Mash.new(YAML.load(File.read(path))) end |