rubygems-test 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/rubygems/commands/test_command.rb +31 -5
- metadata +2 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -95,11 +95,20 @@ class Gem::Commands::TestCommand < Gem::Command
|
|
95
95
|
# Locate rake itself, prefer gems version.
|
96
96
|
#
|
97
97
|
def find_rake
|
98
|
-
|
98
|
+
|
99
|
+
rake_finder = proc do |rake_name|
|
100
|
+
Gem.bin_path('rake') rescue File.join(RbConfig::CONFIG["bindir"], rake_name || 'rake')
|
101
|
+
end
|
102
|
+
|
103
|
+
rake_path = rake_finder.call(nil)
|
99
104
|
|
100
105
|
unless File.exist?(rake_path)
|
101
|
-
|
102
|
-
|
106
|
+
rake_path = rake_finder.call('rake.bat')
|
107
|
+
|
108
|
+
unless File.exist?(rake_path)
|
109
|
+
alert_error "Couldn't find rake; rubygems-test will not work without it. Aborting."
|
110
|
+
raise Gem::RakeNotFoundError, "Couldn't find rake; rubygems-test will not work without it."
|
111
|
+
end
|
103
112
|
end
|
104
113
|
|
105
114
|
return rake_path
|
@@ -262,6 +271,23 @@ class Gem::Commands::TestCommand < Gem::Command
|
|
262
271
|
|
263
272
|
rake_args = [rake_path, 'test', '--trace']
|
264
273
|
|
274
|
+
rake_args_concatenator = proc do |ra|
|
275
|
+
ra.unshift(File.join(RbConfig::CONFIG["bindir"], 'ruby'))
|
276
|
+
end
|
277
|
+
|
278
|
+
case RUBY_PLATFORM
|
279
|
+
when /mingw/
|
280
|
+
rake_args_concatenator.call(rake_args)
|
281
|
+
rake_args = rake_args.join(' ')
|
282
|
+
when /mswin/
|
283
|
+
# if we don't run rake.bat (system rake for 1.9 as opposed to gems),
|
284
|
+
# run it with ruby.
|
285
|
+
if rake_args[0] =~ /rake$/
|
286
|
+
rake_args_concatenator.call(rake_args)
|
287
|
+
end
|
288
|
+
rake_args = rake_args.join(' ')
|
289
|
+
end
|
290
|
+
|
265
291
|
# jruby stuffs it under IO, so we'll use that if it's available
|
266
292
|
# if we're on 1.9, use open3 regardless of platform.
|
267
293
|
# If we're not:
|
@@ -279,10 +305,10 @@ class Gem::Commands::TestCommand < Gem::Command
|
|
279
305
|
outer_reader_proc.call(stdout, stderr)
|
280
306
|
thr.value
|
281
307
|
end
|
282
|
-
elsif RUBY_PLATFORM =~ /mingw/
|
308
|
+
elsif RUBY_PLATFORM =~ /mingw|mswin/
|
283
309
|
begin
|
284
310
|
require 'win32/open3'
|
285
|
-
Open3.popen3(
|
311
|
+
Open3.popen3(*rake_args) do |stdin, stdout, stderr|
|
286
312
|
outer_reader_proc.call(stdout, stderr)
|
287
313
|
end
|
288
314
|
exit_status = $?
|