Sha256: 6c883d333be262083366bd2d05c18c7ec62146a117e54754ee73046d8b6dab3b

Contents?: true

Size: 946 Bytes

Versions: 7

Compression:

Stored size: 946 Bytes

Contents

module VagrantPlugins
  module Invade
    module Builder

      require 'erubis'

      class SSH

        attr_reader :result
        attr_accessor :machine_name, :ssh_data

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

        def build
          b = binding
          template_file = "#{TEMPLATE_PATH}/ssh/ssh.erb"

          begin

            # Get machine name
            machine_name = @machine_name

            # Values for vm section
            forward_agent = @ssh_data['forward_agent']
            enabled = @ssh_data['enabled']
            path = @ssh_data['path']

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-invade-0.5.5 lib/vagrant-invade/builder/ssh.rb
vagrant-invade-0.5.4 lib/vagrant-invade/builder/ssh.rb
vagrant-invade-0.5.3 lib/vagrant-invade/builder/ssh.rb
vagrant-invade-0.5.2 lib/vagrant-invade/builder/ssh.rb
vagrant-invade-0.5.1 lib/vagrant-invade/builder/ssh.rb
vagrant-invade-0.5.0 lib/vagrant-invade/builder/ssh.rb
vagrant-invade-0.4.8 lib/vagrant-invade/builder/ssh.rb