boxen 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "boxen"
5
- gem.version = "1.2.1"
5
+ gem.version = "1.3.0"
6
6
  gem.authors = ["John Barnette", "Will Farrington"]
7
7
  gem.email = ["jbarnette@github.com", "wfarr@github.com"]
8
8
  gem.description = "Manage Mac development boxes with love (and Puppet)."
@@ -175,6 +175,14 @@ module Boxen
175
175
 
176
176
  attr_writer :profile
177
177
 
178
+ # Enable the Puppet future parser? Default is `false`.
179
+
180
+ def future_parser?
181
+ !!@future_parser
182
+ end
183
+
184
+ attr_writer :future_parser
185
+
178
186
  # Enable puppet reports ? Default is `false`.
179
187
 
180
188
  def report?
@@ -107,6 +107,10 @@ module Boxen
107
107
  @profile = true
108
108
  end
109
109
 
110
+ o.on "--future-parser", "Enable the Puppet future parser" do
111
+ @future_parser = true
112
+ end
113
+
110
114
  o.on "--projects", "Show available projects." do
111
115
  @projects = true
112
116
  end
@@ -130,19 +134,20 @@ module Boxen
130
134
  # Apply these flags to `config`. Returns `config`.
131
135
 
132
136
  def apply(config)
133
- config.debug = debug?
134
- config.fde = fde? if config.fde?
135
- config.homedir = homedir if homedir
136
- config.logfile = logfile if logfile
137
- config.login = login if login
138
- config.password = password if password
139
- config.pretend = pretend?
140
- config.profile = profile?
141
- config.report = report?
142
- config.srcdir = srcdir if srcdir
143
- config.stealth = stealth?
144
- config.user = user if user
145
- config.color = color?
137
+ config.debug = debug?
138
+ config.fde = fde? if config.fde?
139
+ config.homedir = homedir if homedir
140
+ config.logfile = logfile if logfile
141
+ config.login = login if login
142
+ config.password = password if password
143
+ config.pretend = pretend?
144
+ config.profile = profile?
145
+ config.future_parser = future_parser?
146
+ config.report = report?
147
+ config.srcdir = srcdir if srcdir
148
+ config.stealth = stealth?
149
+ config.user = user if user
150
+ config.color = color?
146
151
 
147
152
  config
148
153
  end
@@ -199,6 +204,10 @@ module Boxen
199
204
  @profile
200
205
  end
201
206
 
207
+ def future_parser?
208
+ @future_parser
209
+ end
210
+
202
211
  def report?
203
212
  @report
204
213
  end
@@ -68,6 +68,10 @@ module Boxen
68
68
  flags << "--summarize"
69
69
  end
70
70
 
71
+ if config.future_parser?
72
+ flags << "--parser=future"
73
+ end
74
+
71
75
  flags << "--debug" if config.debug?
72
76
  flags << "--noop" if config.pretend?
73
77
 
@@ -117,6 +117,13 @@ class BoxenConfigTest < Boxen::Test
117
117
  assert @config.profile?
118
118
  end
119
119
 
120
+ def test_future_parser?
121
+ refute @config.future_parser?
122
+
123
+ @config.future_parser = true
124
+ assert @config.future_parser?
125
+ end
126
+
120
127
  def test_projects
121
128
  files = Dir["#{@config.repodir}/modules/projects/manifests/*.pp"]
122
129
  assert_equal files.size, @config.projects.size
@@ -15,6 +15,7 @@ class BoxenFlagsTest < Boxen::Test
15
15
  expects(:password=).with "password"
16
16
  expects(:pretend=).with true
17
17
  expects(:profile=).with true
18
+ expects(:future_parser=).with true
18
19
  expects(:report=).with true
19
20
  expects(:srcdir=).with "srcdir"
20
21
  expects(:stealth=).with true
@@ -26,8 +27,9 @@ class BoxenFlagsTest < Boxen::Test
26
27
 
27
28
  flags = Boxen::Flags.new "--debug", "--help", "--login", "login",
28
29
  "--no-fde", "--no-pull", "--no-issue", "--noop", "--password", "password",
29
- "--pretend", "--profile", "--report", "--projects", "--user", "user", "--homedir",
30
- "homedir", "--srcdir", "srcdir", "--logfile", "logfile"
30
+ "--pretend", "--profile", "--future-parser", "--report", "--projects",
31
+ "--user", "user", "--homedir", "homedir", "--srcdir", "srcdir",
32
+ "--logfile", "logfile"
31
33
 
32
34
  assert_same config, flags.apply(config)
33
35
  end
@@ -163,6 +165,11 @@ class BoxenFlagsTest < Boxen::Test
163
165
  assert flags("--profile").profile?
164
166
  end
165
167
 
168
+ def test_future_parser
169
+ refute flags.future_parser?
170
+ assert flags("--future-parser").future_parser?
171
+ end
172
+
166
173
  def test_report
167
174
  refute flags.report?
168
175
  assert flags("--report").report?
@@ -12,6 +12,7 @@ class BoxenPuppeteerTest < Boxen::Test
12
12
  stubs(:homedir).returns "homedir"
13
13
  stubs(:logfile).returns "logfile"
14
14
  stubs(:profile?).returns true
15
+ stubs(:future_parser?).returns true
15
16
  stubs(:puppetdir).returns "puppetdir"
16
17
  stubs(:repodir).returns "repodir"
17
18
  stubs(:debug?).returns true
@@ -30,6 +31,7 @@ class BoxenPuppeteerTest < Boxen::Test
30
31
  assert_flag "--noop", flags
31
32
  assert_flag "--summarize", flags
32
33
  assert_flag "--color=false", flags
34
+ assert_flag "--parser=future", flags
33
35
 
34
36
  assert_flag_value "--confdir", :anything, flags
35
37
  assert_flag_value "--group", "admin", flags
@@ -51,6 +53,7 @@ class BoxenPuppeteerTest < Boxen::Test
51
53
  stubs(:logfile).returns "logfile"
52
54
  stubs(:pretend?).returns false
53
55
  stubs(:profile?).returns false
56
+ stubs(:future_parser?).returns false
54
57
  stubs(:report?).returns false
55
58
  stubs(:puppetdir).returns "puppetdir"
56
59
  stubs(:repodir).returns "test/fixtures/repo"
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 2
8
- - 1
9
- version: 1.2.1
7
+ - 3
8
+ - 0
9
+ version: 1.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Barnette
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-13 00:00:00 -07:00
18
+ date: 2013-05-22 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency