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
31 32 33 34 35 |
# File 'lib/automatic/recipe.rb', line 31 def each_plugin @procedure.plugins.each {|plugin| yield plugin } end |
#load_recipe(path) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/automatic/recipe.rb', line 21 def load_recipe(path) dir = File.join((File.('~/.automatic/config/')), path) path = dir if File.exist?(dir) @procedure = Hashie::Mash.new(YAML.load(File.read(path))) log_level = @procedure.global && @procedure.global.log && @procedure.global.log.level Automatic::Log.level(log_level) Automatic::Log.puts("info", "Loading Recipe: #{path}") @procedure end |