boxen 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
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.1.1"
5
+ gem.version = "1.1.2"
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)."
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.add_dependency "hiera", "~> 1.0.0"
18
18
  gem.add_dependency "highline", "~> 1.6"
19
19
  gem.add_dependency "json_pure", [">= 1.7.7", "< 2.0"]
20
- gem.add_dependency "librarian-puppet", "~> 0.9"
20
+ gem.add_dependency "librarian-puppet", "~> 0.9.9"
21
21
  gem.add_dependency "octokit", "~> 1.15"
22
22
  gem.add_dependency "puppet", "~> 3.0"
23
23
 
data/lib/boxen/flags.rb CHANGED
@@ -32,6 +32,7 @@ module Boxen
32
32
  @stealth = false
33
33
  @disable_services = false
34
34
  @enable_services = false
35
+ @restart_services = false
35
36
  @list_services = false
36
37
  @color = true
37
38
 
@@ -66,6 +67,10 @@ module Boxen
66
67
  @enable_services = true
67
68
  end
68
69
 
70
+ o.on "--restart-services", "Restart Boxen services." do
71
+ @restart_services = true
72
+ end
73
+
69
74
  o.on "--list-services", "List Boxen services." do
70
75
  @list_services = true
71
76
  end
@@ -166,6 +171,10 @@ module Boxen
166
171
  @enable_services
167
172
  end
168
173
 
174
+ def restart_services?
175
+ @restart_services
176
+ end
177
+
169
178
  def list_services?
170
179
  @list_services
171
180
  end
data/lib/boxen/runner.rb CHANGED
@@ -93,6 +93,18 @@ module Boxen
93
93
  exit
94
94
  end
95
95
 
96
+ # --restart-services restarts all services
97
+
98
+ if flags.restart_services?
99
+ Boxen::Service.list.each do |service|
100
+ puts "Restarting #{service}..."
101
+ service.disable
102
+ service.enable
103
+ end
104
+
105
+ exit
106
+ end
107
+
96
108
  end
97
109
 
98
110
  def process_args
@@ -66,6 +66,23 @@ class BoxenRunnerTest < Boxen::Test
66
66
  end
67
67
  end
68
68
 
69
+ def test_restart_services
70
+ config = Boxen::Config.new
71
+ flags = Boxen::Flags.new('--restart-services')
72
+ runner = Boxen::Runner.new config, flags
73
+
74
+ services = Array.new(3) { mock('service') }
75
+ services.each do |service|
76
+ service.expects(:disable).once
77
+ service.expects(:enable).once
78
+ end
79
+ Boxen::Service.stubs(:list).returns(services)
80
+
81
+ assert_raises(SystemExit) do
82
+ runner.process
83
+ end
84
+ end
85
+
69
86
  def test_list_services
70
87
  config = Boxen::Config.new
71
88
  flags = Boxen::Flags.new('--list-services')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 1
9
- version: 1.1.1
8
+ - 2
9
+ version: 1.1.2
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-04-10 00:00:00 -07:00
18
+ date: 2013-04-25 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -88,7 +88,8 @@ dependencies:
88
88
  segments:
89
89
  - 0
90
90
  - 9
91
- version: "0.9"
91
+ - 9
92
+ version: 0.9.9
92
93
  type: :runtime
93
94
  version_requirements: *id005
94
95
  - !ruby/object:Gem::Dependency