Class: Divvy::Provisioner
- Inherits:
-
Object
- Object
- Divvy::Provisioner
- Defined in:
- lib/divvy/provisioner.rb
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#target_package ⇒ Object
readonly
Returns the value of attribute target_package.
Instance Method Summary collapse
-
#initialize(host, target_package, server_options) ⇒ Provisioner
constructor
A new instance of Provisioner.
- #run ⇒ Object
Constructor Details
#initialize(host, target_package, server_options) ⇒ Provisioner
Returns a new instance of Provisioner.
3 4 5 6 7 |
# File 'lib/divvy/provisioner.rb', line 3 def initialize(host, target_package, ) @target_package = Divvy.packages[target_package] raise "Package #{target_package} not found!" unless @target_package @server = Server.new(host, ) end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
9 10 11 |
# File 'lib/divvy/provisioner.rb', line 9 def server @server end |
#target_package ⇒ Object (readonly)
Returns the value of attribute target_package.
9 10 11 |
# File 'lib/divvy/provisioner.rb', line 9 def target_package @target_package end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/divvy/provisioner.rb', line 11 def run start_time = Time.now print_package(target_package) install_plan = normalize(target_package) puts "Normalized install order: #{install_plan.map { |package| package.name }.join(', ')}" install_plan.each do |package| PackageRunner.new(server, package).process end puts "Took #{Time.now - start_time} seconds" end |