boxen 1.0.2 → 1.1.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "boxen"
5
- gem.version = "1.0.2"
5
+ gem.version = "1.1.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)."
@@ -165,6 +165,14 @@ module Boxen
165
165
 
166
166
  attr_writer :profile
167
167
 
168
+ # Enable puppet reports ? Default is `false`.
169
+
170
+ def report?
171
+ !!@report
172
+ end
173
+
174
+ attr_writer :report
175
+
168
176
  # An Array of Boxen::Project entries, one for each project Boxen
169
177
  # knows how to manage.
170
178
  #
@@ -27,6 +27,7 @@ module Boxen
27
27
  @help = false
28
28
  @pretend = false
29
29
  @profile = false
30
+ @report = false
30
31
  @projects = false
31
32
  @stealth = false
32
33
  @disable_services = false
@@ -45,6 +46,10 @@ module Boxen
45
46
  @pretend = true
46
47
  end
47
48
 
49
+ o.on "--report", "Enable puppet reports." do
50
+ @report = true
51
+ end
52
+
48
53
  o.on "--env", "Show useful environment variables." do
49
54
  @env = true
50
55
  end
@@ -128,6 +133,7 @@ module Boxen
128
133
  config.password = password if password
129
134
  config.pretend = pretend?
130
135
  config.profile = profile?
136
+ config.report = report?
131
137
  config.srcdir = srcdir if srcdir
132
138
  config.stealth = stealth?
133
139
  config.user = user if user
@@ -184,6 +190,10 @@ module Boxen
184
190
  @profile
185
191
  end
186
192
 
193
+ def report?
194
+ @report
195
+ end
196
+
187
197
  def projects?
188
198
  @projects
189
199
  end
@@ -47,7 +47,7 @@ module Boxen
47
47
  # For some reason Puppet tries to set up a bunch of rrd stuff
48
48
  # (user, group) unless reports are completely disabled.
49
49
 
50
- flags << "--no-report"
50
+ flags << "--no-report" unless config.report?
51
51
  flags << "--detailed-exitcodes"
52
52
 
53
53
  flags << "--show_diff"
@@ -70,6 +70,8 @@ module Boxen
70
70
 
71
71
  FileUtils.rm_f config.logfile
72
72
 
73
+ FileUtils.rm_rf "#{config.puppetdir}/var/reports" if config.report?
74
+
73
75
  FileUtils.mkdir_p File.dirname config.logfile
74
76
  FileUtils.touch config.logfile
75
77
 
@@ -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(:report=).with true
18
19
  expects(:srcdir=).with "srcdir"
19
20
  expects(:stealth=).with true
20
21
  expects(:user=).with "user"
@@ -25,7 +26,7 @@ class BoxenFlagsTest < Boxen::Test
25
26
 
26
27
  flags = Boxen::Flags.new "--debug", "--help", "--login", "login",
27
28
  "--no-fde", "--no-pull", "--no-issue", "--noop", "--password", "password",
28
- "--pretend", "--profile", "--projects", "--user", "user", "--homedir",
29
+ "--pretend", "--profile", "--report", "--projects", "--user", "user", "--homedir",
29
30
  "homedir", "--srcdir", "srcdir", "--logfile", "logfile"
30
31
 
31
32
  assert_same config, flags.apply(config)
@@ -162,6 +163,11 @@ class BoxenFlagsTest < Boxen::Test
162
163
  assert flags("--profile").profile?
163
164
  end
164
165
 
166
+ def test_report
167
+ refute flags.report?
168
+ assert flags("--report").report?
169
+ end
170
+
165
171
  def test_projects
166
172
  refute flags.projects?
167
173
  assert flags("--projects").projects?
@@ -16,6 +16,7 @@ class BoxenPuppeteerTest < Boxen::Test
16
16
  stubs(:repodir).returns "repodir"
17
17
  stubs(:debug?).returns true
18
18
  stubs(:pretend?).returns true
19
+ stubs(:report?).returns false
19
20
  stubs(:color?).returns false
20
21
  end
21
22
 
@@ -48,6 +49,7 @@ class BoxenPuppeteerTest < Boxen::Test
48
49
  stubs(:logfile).returns "logfile"
49
50
  stubs(:pretend?).returns false
50
51
  stubs(:profile?).returns false
52
+ stubs(:report?).returns false
51
53
  stubs(:puppetdir).returns "puppetdir"
52
54
  stubs(:repodir).returns "test/fixtures/repo"
53
55
  stubs(:color?).returns true
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
+ - 1
7
8
  - 0
8
- - 2
9
- version: 1.0.2
9
+ version: 1.1.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-03-05 00:00:00 -08:00
18
+ date: 2013-04-01 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency