vagrant_bootstrap 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module VagrantBootstrap
13
13
  STDERR.puts "FATAL: #{dir} already exists!"
14
14
  exit
15
15
  end
16
- render "Vagrantfile.erb", "#{dir}/Vagrantfile", opts
16
+ render opts.template_file, "#{dir}/Vagrantfile", opts
17
17
  end
18
18
 
19
19
  private
@@ -7,6 +7,8 @@ module VagrantBootstrap
7
7
  class CLI
8
8
 
9
9
  DEFAULT_BRIDGE = 'br0'
10
+ DEFAULT_TEMPLATE_FILE = 'Vagrantfile.erb'
11
+
10
12
  BANNER = <<-EOS
11
13
  Easily generate a Vagrantfile in a namespaced directory
12
14
 
@@ -26,11 +28,14 @@ hostname of the VM, e.g. 'vgbs taco' will yield a directory and hostname of
26
28
  opt :bridge, 'The bridge to attach the VM to', :default => DEFAULT_BRIDGE
27
29
  opt :quiet, "Don't output anything unless there's a problem", :default => false
28
30
  opt :verbose, "More verbose output", :default => false
31
+ opt :template_file, 'Specify a different template file', :type => String
29
32
  end
30
33
  opts = OpenStruct.new(trollopts)
31
34
 
32
- # normalize name
35
+ # sanitize options
33
36
  opts.name = VagrantBootstrap.vm_name(ARGV[0])
37
+ opts.template_file = DEFAULT_TEMPLATE_FILE if opts.template_file.nil?
38
+
34
39
  puts "Your vagrant is called #{opts.name}" unless opts.quiet
35
40
  VagrantBootstrap::Bootstrap.new opts
36
41
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantBootstrap
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: