Sha256: 9bfe537b2acd3f0b0c2d59f321ad6dbff12d6494548fc49b1bccf3009e2b65c2
Contents?: true
Size: 1.36 KB
Versions: 2
Compression:
Stored size: 1.36 KB
Contents
module VagrantPlugins module Invade module InvadeModule module Network class Private < InvadeModule require 'ipaddr' 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 # Delete all nil keys @private_network_data.compact ip = @private_network_data['ip'] # Handle IP address exceptions if ip @private_network_data.delete('type') # Netmask only makes sense if IP is ipv6 if @private_network_data['netmask'] && !IPAddr.new(ip).ipv6? @private_network_data.delete('netmask') end end begin # Get machine name machine_name = @machine_name network_data = @private_network_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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vagrant-invade-0.8.0 | lib/vagrant-invade/module/network/private/private.rb |
vagrant-invade-0.7.0 | lib/vagrant-invade/module/network/private/private.rb |