racker 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.1.1 (2014-03-06)
2
+
3
+ New Features:
4
+ * Added command line option to surpress output.
5
+ * Added the ability to set the knockout prefix from the command line.
6
+
7
+ Bug Fixes:
8
+ * Do not create empty Packer namespace entries if the Racker template does not contain the namespace.
9
+ * Changed default knockout prefix from `--` to `~~` as it conflicted with certain Virtualbox builder keys.
10
+
1
11
  ## 0.1.0 (2014-02-23)
2
12
 
3
13
  * Initial public release
data/lib/racker/cli.rb CHANGED
@@ -44,7 +44,8 @@ module Racker
44
44
  log.debug('Processing complete.')
45
45
 
46
46
  # Thats all folks!
47
- puts "Processing complete! Packer file generated: #{options[:output]}"
47
+ puts "Processing complete!" unless options[:quiet]
48
+ puts "Packer file generated: #{options[:output]}" unless options[:quiet]
48
49
 
49
50
  return 0
50
51
  end
@@ -71,8 +72,10 @@ module Racker
71
72
  def options
72
73
  @options ||= {
73
74
  log_level: :warn,
75
+ knockout: '~~',
74
76
  output: '',
75
- templates: [],
77
+ templates: [],
78
+ quiet: false,
76
79
  }
77
80
  end
78
81
 
@@ -84,6 +87,14 @@ module Racker
84
87
  options[:log_level] = v
85
88
  end
86
89
 
90
+ opts.on('-k', '--knockout PREFIX', 'Set the knockout prefix (Default: ~~)') do |v|
91
+ options[:knockout] = v || '~~'
92
+ end
93
+
94
+ opts.on('-q', '--quiet', 'Disable unnecessary output') do |v|
95
+ options[:quiet] = v || '~~'
96
+ end
97
+
87
98
  opts.on_tail('-h', '--help', 'Show this message') do
88
99
  puts option_parser
89
100
  Kernel.exit!(0)
@@ -58,7 +58,7 @@ module Racker
58
58
 
59
59
  # Overlay the templates
60
60
  templates.each do |template|
61
- current_template = current_template.deep_merge!(template, {:knockout_prefix => '--'})
61
+ current_template = current_template.deep_merge!(template, {:knockout_prefix => @options[:knockout]})
62
62
  end
63
63
 
64
64
  # Compact the residual template to remove nils
@@ -76,7 +76,7 @@ module Racker
76
76
  def load(templates)
77
77
  return capture_templates do
78
78
  templates.each do |template|
79
- puts "Loading template file: #{template}"
79
+ puts "Loading template file: #{template}" unless @options[:quiet]
80
80
  Kernel.load template
81
81
  end
82
82
  end
@@ -22,10 +22,10 @@ module Racker
22
22
  packer = Smash.new
23
23
 
24
24
  # Variables
25
- packer['variables'] = self['variables'].dup
25
+ packer['variables'] = self['variables'].dup unless self['variables'].nil? || self['variables'].empty?
26
26
 
27
27
  # Builders
28
- packer['builders'] = []
28
+ packer['builders'] = [] unless self['builders'].nil? || self['builders'].empty?
29
29
  log.info("Processing builders...")
30
30
  self['builders'].each do |name,config|
31
31
  log.info("Processing builder: #{name} with type: #{config['type']}")
@@ -38,7 +38,7 @@ module Racker
38
38
  end
39
39
 
40
40
  # Provisioners
41
- packer['provisioners'] = []
41
+ packer['provisioners'] = [] unless self['provisioners'].nil? || self['provisioners'].empty?
42
42
  log.info("Processing provisioners...")
43
43
  self['provisioners'].sort.map do |index, provisioners|
44
44
  provisioners.each do |name,config|
@@ -48,7 +48,7 @@ module Racker
48
48
  end
49
49
 
50
50
  # Post-Processors
51
- packer['post-processors'] = []
51
+ packer['post-processors'] = [] unless self['postprocessors'].nil? || self['postprocessors'].empty?
52
52
  log.info("Processing post-processors...")
53
53
  self['postprocessors'].each do |name,config|
54
54
  log.debug("Processing post-processor: #{name}")
@@ -5,7 +5,7 @@ module Racker
5
5
  module Version
6
6
  MAJOR = 0
7
7
  MINOR = 1
8
- PATCH = 0
8
+ PATCH = 1
9
9
  BUILD = nil
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-23 00:00:00.000000000 Z
12
+ date: 2014-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
319
  version: '0'
320
320
  segments:
321
321
  - 0
322
- hash: 4299649763344913573
322
+ hash: 3813436931022595451
323
323
  requirements: []
324
324
  rubyforge_project:
325
325
  rubygems_version: 1.8.23