Sha256: 437e3ee637185088d41feef7728d2b5d1ffe736737c74098c6a8eecd757e9348

Contents?: true

Size: 1.2 KB

Versions: 6

Compression:

Stored size: 1.2 KB

Contents

module VagrantPlugins
  module Invade
    module InvadeModule
      module Vagrant

        class Machine < InvadeModule

          attr_reader :result
          attr_accessor :machine_data

          def initialize(machine_name, machine_data, result: nil)
            @machine_name = machine_name
            @machine_data  = machine_data
            @result   = result
          end

          def build
            b = binding

            begin

              # Machine name
              machine_name = @machine_name

              # Data to build machine entry
              vm = @machine_data['vm']
              network = @machine_data['network']
              ssh = @machine_data['ssh']
              provider = @machine_data['provider']
              synced_folder = @machine_data['synced_folder']
              plugin = @machine_data['plugin']
              provision = @machine_data['provision']
              nfs = @machine_data['nfs']

              eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__)))
              @result = eruby.result b
            rescue TypeError, SyntaxError, SystemCallError => e
              raise(e)
            end
          end
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-invade-0.8.0 lib/vagrant-invade/module/vagrant/machine/machine.rb
vagrant-invade-0.7.0 lib/vagrant-invade/module/vagrant/machine/machine.rb
vagrant-invade-0.6.4 lib/vagrant-invade/module/vagrant/machine/machine.rb
vagrant-invade-0.6.3 lib/vagrant-invade/module/vagrant/machine/machine.rb
vagrant-invade-0.6.2 lib/vagrant-invade/module/vagrant/machine/machine.rb
vagrant-invade-0.6.1 lib/vagrant-invade/module/vagrant/machine/machine.rb