vagrant-lxc-ng/lib/vagrant-lxc/driver/builder.rb
2013-07-28 02:17:07 -03:00

21 lines
507 B
Ruby

require_relative 'fetch_ip_with_attach'
require_relative 'fetch_ip_from_dnsmasq'
module Vagrant
module LXC
class Driver
class Builder
def self.build(id, shell)
version = CLI.new(shell).version.match(/^(\d+\.\d+)\./)[1].to_f
Driver.new(id, shell).tap do |driver|
mod = version >= 0.8 ?
Driver::FetchIpWithAttach :
Driver::FetchIpFromDsnmasq
driver.extend(mod)
end
end
end
end
end
end