Sha256: d09c2c304f4212fcfe85a118167b27b29f95cecb0e050cb09e471e9d89cfbd70

Contents?: true

Size: 850 Bytes

Versions: 4

Compression:

Stored size: 850 Bytes

Contents

module VagrantPlugins
  module Invade
    module InvadeModule
      module Provision

        class Shell <  InvadeModule

          attr_reader :result
          attr_accessor :machine_name, :shell_data

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

          def build
            b = binding

            begin

              # Get machine name
              machine_name = @machine_name
              data = @shell_data

              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

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-invade-0.8.0 lib/vagrant-invade/module/provision/shell/shell.rb
vagrant-invade-0.7.0 lib/vagrant-invade/module/provision/shell/shell.rb
vagrant-invade-0.6.4 lib/vagrant-invade/module/provision/shell/shell.rb
vagrant-invade-0.6.3 lib/vagrant-invade/module/provision/shell/shell.rb