class Wocker::Vagrantfile

Public Class Methods

new(interface: nil, choco: false, restart:false) click to toggle source
# File lib/wocker/vagrantfile.rb, line 5
def initialize(interface: nil, choco: false, restart:false)
  @interface = interface
  @choco = choco
  @restart = restart
end

Public Instance Methods

create_from_wockerfile!(*args) click to toggle source
# 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