boxen 1.2.1 → 1.3.0
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/boxen.gemspec +1 -1
- data/lib/boxen/config.rb +8 -0
- data/lib/boxen/flags.rb +22 -13
- data/lib/boxen/puppeteer.rb +4 -0
- data/test/boxen_config_test.rb +7 -0
- data/test/boxen_flags_test.rb +9 -2
- data/test/boxen_puppeteer_test.rb +3 -0
- metadata +4 -4
data/boxen.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "boxen"
|
5
|
-
gem.version = "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)."
|
data/lib/boxen/config.rb
CHANGED
@@ -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?
|
data/lib/boxen/flags.rb
CHANGED
@@ -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
|
134
|
-
config.fde
|
135
|
-
config.homedir
|
136
|
-
config.logfile
|
137
|
-
config.login
|
138
|
-
config.password
|
139
|
-
config.pretend
|
140
|
-
config.profile
|
141
|
-
config.
|
142
|
-
config.
|
143
|
-
config.
|
144
|
-
config.
|
145
|
-
config.
|
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
|
data/lib/boxen/puppeteer.rb
CHANGED
data/test/boxen_config_test.rb
CHANGED
@@ -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
|
data/test/boxen_flags_test.rb
CHANGED
@@ -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", "--
|
30
|
-
"
|
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
|
-
-
|
8
|
-
-
|
9
|
-
version: 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-
|
18
|
+
date: 2013-05-22 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|