Class: Vito::Recipe

Inherits:
Object
  • Object
show all
Defined in:
lib/vito/recipe.rb

Instance Method Summary collapse

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(options, connection)
  @options = 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, options = {})
  Installation.new(recipe, options, @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

#runObject



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