rubygems-test 0.1.7 → 0.1.8

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.
File without changes
@@ -186,53 +186,56 @@ class Gem::Commands::TestCommand < Gem::Command
186
186
  Dir.chdir(spec.full_gem_path) do
187
187
 
188
188
  if spec.files.include?(".gemtest")
189
- open_proc = proc do |pid, stdin, stdout, stderr|
190
- reader_proc = proc do |orig_handles|
191
-
192
- current_handles = orig_handles.dup
193
-
194
- handles, _, _ = IO.select(current_handles, nil, nil, 0.1)
195
- buf = ""
196
-
197
- handles.each do |io|
198
- begin
199
- io.readpartial(16384, buf)
200
- rescue EOFError
201
- buf += io.read rescue ""
202
- current_handles.reject!(io)
203
- rescue IOError
204
- current_handles.reject!(io)
205
- end
206
- end if handles
207
-
208
- [buf, current_handles]
209
- end
210
-
211
- begin
212
- loop do
213
- handles = [stdout, stderr]
214
- buf, handles = reader_proc.call(handles)
215
- output += buf
216
- print buf
217
- break unless handles
189
+ reader_proc = proc do |orig_handles|
190
+ current_handles = orig_handles.dup
191
+
192
+ handles, _, _ = IO.select(current_handles, nil, nil, 0.1)
193
+ buf = ""
194
+
195
+ handles.each do |io|
196
+ begin
197
+ io.readpartial(16384, buf)
198
+ rescue EOFError
199
+ buf += io.read rescue ""
200
+ current_handles.reject! { |x| x == io }
201
+ rescue IOError
202
+ current_handles.reject! { |x| x == io }
218
203
  end
219
- rescue StandardError
220
- break
204
+ end if handles
205
+
206
+ [buf, current_handles]
207
+ end
208
+
209
+ outer_reader_proc = proc do |stdout, stderr|
210
+ loop do
211
+ handles = [stdout, stderr]
212
+ buf, handles = reader_proc.call(handles)
213
+ output += buf
214
+ print buf
215
+ break if handles.empty?
221
216
  end
222
217
  end
223
218
 
224
219
  # jruby stuffs it under IO, so we'll use that if it's available
225
- # XXX I'm fairly sure that JRuby's gems don't support plugins, so this is
226
- # left untested.
227
220
  klass =
228
221
  if IO.respond_to?(:popen4)
229
- IO
230
- else
222
+ IO.popen4(rake_path, 'test', '--trace') do |pid, stdin, stdout, stderr|
223
+ outer_reader_proc.call(stdout, stderr)
224
+ end
225
+ exit_status = $?
226
+ elsif RUBY_VERSION > '1.9'
231
227
  require 'open4'
232
- Open4
228
+ exit_status = Open4.popen4(rake_path, 'test', '--trace') do |stdin, stdout, stderr, thr|
229
+ outer_reader_proc.call(stdout, stderr)
230
+ thr
231
+ end
232
+ else
233
+ require 'open4-vendor'
234
+ exit_status = Open4.popen4(rake_path, 'test', '--trace') do |pid, stdin, stdout, stderr|
235
+ outer_reader_proc.call(stdout, stderr)
236
+ end
233
237
  end
234
238
 
235
- exit_status = klass.popen4(rake_path, "test", '--trace', &open_proc)
236
239
 
237
240
  if config["upload_results"] or
238
241
  (!config.has_key?("upload_results") and ask_yes_no("Upload these results to rubygems.org?", true))
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-test
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 7
10
- version: 0.1.7
8
+ - 8
9
+ version: 0.1.8
11
10
  platform: ruby
12
11
  authors:
13
12
  - Erik Hollensbe
@@ -27,7 +26,6 @@ dependencies:
27
26
  requirements:
28
27
  - - ">="
29
28
  - !ruby/object:Gem::Version
30
- hash: 3
31
29
  segments:
32
30
  - 0
33
31
  version: "0"
@@ -41,7 +39,6 @@ dependencies:
41
39
  requirements:
42
40
  - - ">="
43
41
  - !ruby/object:Gem::Version
44
- hash: 3
45
42
  segments:
46
43
  - 0
47
44
  version: "0"
@@ -62,7 +59,7 @@ files:
62
59
  - gems/Rakefile
63
60
  - gems/template.gemspec
64
61
  - gems/test/test_pass.rb
65
- - lib/open4.rb
62
+ - lib/open4-vendor.rb
66
63
  - lib/rubygems/commands/test_command.rb
67
64
  - lib/rubygems/on_install_test.rb
68
65
  - lib/rubygems_plugin.rb
@@ -85,7 +82,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
82
  requirements:
86
83
  - - ">="
87
84
  - !ruby/object:Gem::Version
88
- hash: 3
89
85
  segments:
90
86
  - 0
91
87
  version: "0"
@@ -94,7 +90,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
90
  requirements:
95
91
  - - ">="
96
92
  - !ruby/object:Gem::Version
97
- hash: 3
98
93
  segments:
99
94
  - 0
100
95
  version: "0"