Class: Wocker::Vagrantfile
- Inherits:
-
Object
- Object
- Wocker::Vagrantfile
- Defined in:
- lib/wocker/vagrantfile.rb
Instance Method Summary collapse
- #create_from_wockerfile!(*args) ⇒ Object
-
#initialize(interface: nil, choco: false, restart: false) ⇒ Vagrantfile
constructor
A new instance of Vagrantfile.
Constructor Details
#initialize(interface: nil, choco: false, restart: false) ⇒ Vagrantfile
Returns a new instance of Vagrantfile.
5 6 7 8 9 |
# File 'lib/wocker/vagrantfile.rb', line 5 def initialize(interface: nil, choco: false, restart:false) @interface = interface @choco = choco @restart = restart end |
Instance Method Details
#create_from_wockerfile!(*args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/wocker/vagrantfile.rb', line 11 def create_from_wockerfile! *args v = VagrantfileTemplate.new v.wocker_from = Wockerfile.from v.wocker_runs = Wockerfile.runs v.wocker_ports = Wockerfile.ports v.wocker_interface = @interface v.wocker_installs = [] v.wocker_restart = @restart if @choco v.wocker_installs << File.join(Wocker.gem_root_path, "scripts", "wocker-install-chocolatey.ps1") end File.write "Vagrantfile", v.render(File.read(File.join(Wocker.gem_root_path, "templates", "Vagrantfile"))) end |