Sha256: 5aa751b6d76f1d8a23f96e5afd314b712fbb29e86f6c18bc87e581281fd553b3

Contents?: true

Size: 1.12 KB

Versions: 21

Compression:

Stored size: 1.12 KB

Contents

module VagrantPlugins
  module Invade
    module Builder
      module Network
        require 'erubis'

        class PrivateNetwork

          attr_reader :result
          attr_accessor :machine_name, :private_network_data

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

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

            begin
              # Get machine name
              machine_name = @machine_name

              # Values for network section
              ip = @private_network_data['ip']
              ip ? dhcp = nil : dhcp = @private_network_data['dhcp']
              auto_config = @private_network_data['auto_config']

              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
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vagrant-invade-0.5.5 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.5.4 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.5.3 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.5.2 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.5.1 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.5.0 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.8 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.7 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.6 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.5 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.4 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.3 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.2 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.1 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.0 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.4.0.pre.alpha lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.3.4 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.3.3 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.3.2 lib/vagrant-invade/builder/network/private_network.rb
vagrant-invade-0.3.0 lib/vagrant-invade/builder/network/private_network.rb