Class: Vito::Recipe
- Inherits:
-
Object
- Object
- Vito::Recipe
- Defined in:
- lib/vito/recipe.rb
Direct Known Subclasses
Vito::Recipes::Git, Vito::Recipes::Rbenv, Vito::Recipes::Ruby
Instance Method Summary collapse
- #depends_on_recipe(recipe, options = {}) ⇒ Object
-
#initialize(options, connection) ⇒ Recipe
constructor
A new instance of Recipe.
-
#program_version(version_command) ⇒ Object
Helper methods.
- #query(command) ⇒ Object
- #run ⇒ Object
- #run_command(command) ⇒ Object
Constructor Details
#initialize(options, connection) ⇒ Recipe
Returns a new instance of Recipe.
3 4 5 6 |
# File 'lib/vito/recipe.rb', line 3 def initialize(, connection) @options = @connection = connection end |
Instance Method Details
#depends_on_recipe(recipe, options = {}) ⇒ Object
12 13 14 |
# File 'lib/vito/recipe.rb', line 12 def depends_on_recipe(recipe, = {}) Installation.new(recipe, , @connection).install end |
#program_version(version_command) ⇒ Object
Helper methods
should be extracted later
27 28 29 |
# File 'lib/vito/recipe.rb', line 27 def program_version(version_command) Vito::Utils::ProgramVersion.new(version_command, @connection) end |
#query(command) ⇒ Object
20 21 22 |
# File 'lib/vito/recipe.rb', line 20 def query(command) @connection.query(command) end |
#run ⇒ Object
8 9 10 |
# File 'lib/vito/recipe.rb', line 8 def run raise "#{self.class.name} recipe needs to define a #run method" end |
#run_command(command) ⇒ Object
16 17 18 |
# File 'lib/vito/recipe.rb', line 16 def run_command(command) @connection.run(command) end |