lib/vagrant-invade/builder/vagrantfile.rb in vagrant-invade-0.4.8 vs lib/vagrant-invade/builder/vagrantfile.rb in vagrant-invade-0.5.0

- old
+ new

@@ -5,24 +5,25 @@ require 'erubis' class Vagrantfile attr_reader :result - attr_accessor :definitions + attr_accessor :vagrantfile_data - def initialize(definitions, result: nil) - @definitions = definitions + def initialize(vagrantfile_data, result: nil) + @vagrantfile_data = vagrantfile_data @result = result end def build b = binding template_file = "#{TEMPLATE_PATH}/v2.erb" begin - # definitions for vagrantfile to build - definitions = @definitions + # Set variables for template files + hostmanager = @vagrantfile_data['hostmanager'] + machines = @vagrantfile_data['machine'] eruby = Erubis::Eruby.new(File.read(template_file)) @result = eruby.result b rescue TypeError, SyntaxError, SystemCallError => e raise(e)