sunshine 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.2.2 / 2010-10-13
2
+
3
+ * Bugfixes:
4
+
5
+ * Added support for ruby 1.9.2
6
+
1
7
  === 1.2.1 / 2010-10-05
2
8
 
3
9
  * Improvements:
data/lib/sunshine.rb CHANGED
@@ -25,7 +25,7 @@ module Sunshine
25
25
 
26
26
  ##
27
27
  # Sunshine version.
28
- VERSION = '1.2.1'
28
+ VERSION = '1.2.2'
29
29
 
30
30
  ##
31
31
  # Path to the list of installed sunshine apps.
data/lib/sunshine/app.rb CHANGED
@@ -1138,7 +1138,7 @@ module Sunshine
1138
1138
  method = options[:no_threads] ? :each : :threaded_each
1139
1139
  auto_session = !options[:no_session]
1140
1140
 
1141
- block = lambda do
1141
+ block = lambda do |*|
1142
1142
  send(method, search_options) do |server_app|
1143
1143
 
1144
1144
  if block_given?
@@ -1151,7 +1151,7 @@ module Sunshine
1151
1151
  end
1152
1152
 
1153
1153
 
1154
- msg_block = lambda do
1154
+ msg_block = lambda do |*|
1155
1155
  if message
1156
1156
  Sunshine.logger.info(:app, message, &block)
1157
1157
 
data/test/test_helper.rb CHANGED
@@ -21,8 +21,6 @@ unless MockObject === Sunshine.shell
21
21
  Sunshine.shell.mock :write, :return => nil
22
22
  end
23
23
 
24
- YAML.extend MockObject unless MockObject === YAML
25
-
26
24
  unless Sunshine::Dependency.include? MockObject
27
25
  Sunshine::Dependency.send(:include, MockObject)
28
26
  end
@@ -361,13 +361,12 @@ class TestApp < Test::Unit::TestCase
361
361
  check_ruby => [:err, ""]},
362
362
  {:sudo => yum_sudo}
363
363
 
364
- @app.install_deps 'ruby', nginx_dep
364
+ @app.install_deps 'ruby', nginx_dep, :no_threads => true
365
365
 
366
366
 
367
367
  each_remote_shell do |ds|
368
368
  [nginx_dep, ruby_dep].each do |dep|
369
- check =
370
- "test \"$(yum list installed #{dep.pkg} | grep -c #{dep.pkg})\" -ge 1"
369
+ check = dep.instance_variable_get "@check"
371
370
  install = dep.instance_variable_get "@install"
372
371
 
373
372
  assert_ssh_call check, ds, :sudo => yum_sudo
@@ -392,14 +391,15 @@ class TestApp < Test::Unit::TestCase
392
391
  set_mock_response_for @app, 1, {check => [:err, ""]}, {:sudo => gem_sudo}
393
392
  end
394
393
 
395
- @app.install_deps 'rake', bundler_dep
394
+ @app.install_deps 'rake', bundler_dep, :no_threads => true
396
395
 
397
396
  each_remote_shell do |ds|
398
397
  [rake_dep, bundler_dep].each do |dep|
399
398
 
399
+ check = dep.instance_variable_get "@check"
400
400
  install = dep.instance_variable_get "@install"
401
401
 
402
- assert_ssh_call checks[dep], ds, :sudo => gem_sudo
402
+ assert_ssh_call check, ds, :sudo => gem_sudo
403
403
  assert_ssh_call install, ds, :sudo => gem_sudo
404
404
  end
405
405
  end
@@ -24,13 +24,13 @@ class TestShell < Test::Unit::TestCase
24
24
 
25
25
  def test_ask
26
26
  @shell.ask "input something!"
27
- assert 1, @shell.input.method_call_count(:ask)
27
+ assert_equal 1, @shell.input.method_call_count(:ask)
28
28
  end
29
29
 
30
30
 
31
31
  def test_close
32
32
  @shell.close
33
- assert 1, @shell.output.method_call_count(:close)
33
+ assert_equal 1, @shell.output.method_call_count(:close)
34
34
  end
35
35
 
36
36
 
@@ -162,8 +162,11 @@ class TestSunshine < Test::Unit::TestCase
162
162
  end
163
163
 
164
164
  def mock_yaml_load_file
165
- YAML.mock :load_file, :args => [Sunshine::USER_CONFIG_FILE],
166
- :return => Sunshine::DEFAULT_CONFIG
165
+ YAML.instance_eval do
166
+ undef load_file
167
+ def load_file file
168
+ Sunshine::DEFAULT_CONFIG
169
+ end
170
+ end
167
171
  end
168
-
169
172
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunshine
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 2
9
- - 1
10
- version: 1.2.1
8
+ - 2
9
+ version: 1.2.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jeremie Castagna
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-10-12 00:00:00 -07:00
17
+ date: 2010-10-13 00:00:00 -07:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 21
30
28
  segments:
31
29
  - 1
32
30
  - 0
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 31
46
43
  segments:
47
44
  - 1
48
45
  - 0
@@ -58,7 +55,6 @@ dependencies:
58
55
  requirements:
59
56
  - - ">="
60
57
  - !ruby/object:Gem::Version
61
- hash: 1
62
58
  segments:
63
59
  - 1
64
60
  - 5
@@ -74,7 +70,6 @@ dependencies:
74
70
  requirements:
75
71
  - - ">="
76
72
  - !ruby/object:Gem::Version
77
- hash: 31
78
73
  segments:
79
74
  - 1
80
75
  - 2
@@ -90,7 +85,6 @@ dependencies:
90
85
  requirements:
91
86
  - - ">="
92
87
  - !ruby/object:Gem::Version
93
- hash: 7
94
88
  segments:
95
89
  - 2
96
90
  - 0
@@ -106,7 +100,6 @@ dependencies:
106
100
  requirements:
107
101
  - - ">="
108
102
  - !ruby/object:Gem::Version
109
- hash: 19
110
103
  segments:
111
104
  - 2
112
105
  - 6
@@ -227,7 +220,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
220
  requirements:
228
221
  - - ">="
229
222
  - !ruby/object:Gem::Version
230
- hash: 3
223
+ hash: 3148348221185696029
231
224
  segments:
232
225
  - 0
233
226
  version: "0"
@@ -236,7 +229,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
229
  requirements:
237
230
  - - ">="
238
231
  - !ruby/object:Gem::Version
239
- hash: 3
240
232
  segments:
241
233
  - 0
242
234
  version: "0"