Class: Evm::Recipe
- Inherits:
-
Object
- Object
- Evm::Recipe
- Defined in:
- lib/evm/recipe.rb
Defined Under Namespace
Classes: Dsl
Constant Summary collapse
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(recipe_file) ⇒ Recipe
constructor
A new instance of Recipe.
- #read ⇒ Object
Constructor Details
permalink #initialize(recipe_file) ⇒ Recipe
Returns a new instance of Recipe.
15 16 17 18 19 20 21 22 |
# File 'lib/evm/recipe.rb', line 15 def initialize(recipe_file) @recipe_file = recipe_file dsl = Dsl.new dsl.instance_eval(read) @name = dsl.name end |
Instance Attribute Details
permalink #name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/evm/recipe.rb', line 5 def name @name end |
Class Method Details
permalink .all ⇒ Object
[View source]
33 34 35 36 37 |
# File 'lib/evm/recipe.rb', line 33 def all Dir.glob(File.join(RECIPES_PATH, '*.rb')).map do |recipe_file| Recipe.new(recipe_file) end end |
permalink .find(name) ⇒ Object
[View source]
29 30 31 |
# File 'lib/evm/recipe.rb', line 29 def find(name) all.find { |recipe| recipe.name == name } end |
Instance Method Details
permalink #read ⇒ Object
[View source]
24 25 26 |
# File 'lib/evm/recipe.rb', line 24 def read File.read(@recipe_file) end |