Sha256: 233c4f3c3d1058c8b1e26e6a3282c715c79ccdca13f884c6d37bcc1f855838da

Contents?: true

Size: 922 Bytes

Versions: 1

Compression:

Stored size: 922 Bytes

Contents

module VagrantPlugins
  module Invade
    module InvadeModule
      module Vagrant

        class Vagrantfile < InvadeModule

          attr_reader :result
          attr_accessor :vagrantfile_data

          def initialize(vagrantfile_data, result: nil)
            @vagrantfile_data  = vagrantfile_data
            @result   = result
          end

          def build
            b = binding

            begin

              # Set variables for template files
              global_hostmanager = @vagrantfile_data['hostmanager']
              global_nfs = @vagrantfile_data['nfs']
              machines = @vagrantfile_data['machines']

              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

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-invade-0.7.0 lib/vagrant-invade/module/vagrant/vagrantfile/vagrantfile.rb