rubygems-update 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (150) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +4 -5
  3. data/{test/foo/discover.rb → .gemtest} +0 -0
  4. data/ChangeLog +13 -0
  5. data/History.txt +35 -1
  6. data/Manifest.txt +89 -88
  7. data/README.rdoc +21 -10
  8. data/Rakefile +31 -17
  9. data/UPGRADING.rdoc +81 -0
  10. data/ci_build.sh +27 -0
  11. data/cruise_config.rb +20 -13
  12. data/lib/rbconfig/datadir.rb +1 -1
  13. data/lib/rubygems.rb +102 -45
  14. data/lib/rubygems/builder.rb +5 -11
  15. data/lib/rubygems/command_manager.rb +0 -1
  16. data/lib/rubygems/commands/check_command.rb +2 -17
  17. data/lib/rubygems/commands/cleanup_command.rb +1 -1
  18. data/lib/rubygems/commands/dependency_command.rb +5 -18
  19. data/lib/rubygems/commands/environment_command.rb +5 -4
  20. data/lib/rubygems/commands/fetch_command.rb +0 -1
  21. data/lib/rubygems/commands/generate_index_command.rb +1 -10
  22. data/lib/rubygems/commands/help_command.rb +0 -5
  23. data/lib/rubygems/commands/query_command.rb +4 -24
  24. data/lib/rubygems/commands/setup_command.rb +4 -19
  25. data/lib/rubygems/commands/sources_command.rb +15 -37
  26. data/lib/rubygems/commands/specification_command.rb +1 -2
  27. data/lib/rubygems/commands/unpack_command.rb +19 -7
  28. data/lib/rubygems/commands/update_command.rb +29 -44
  29. data/lib/rubygems/config_file.rb +25 -19
  30. data/lib/rubygems/custom_require.rb +4 -6
  31. data/lib/rubygems/dependency.rb +1 -43
  32. data/lib/rubygems/dependency_installer.rb +1 -1
  33. data/lib/rubygems/doc_manager.rb +3 -1
  34. data/lib/rubygems/ext/builder.rb +3 -1
  35. data/lib/rubygems/ext/rake_builder.rb +10 -2
  36. data/lib/rubygems/format.rb +7 -4
  37. data/lib/rubygems/gem_runner.rb +1 -1
  38. data/lib/rubygems/indexer.rb +11 -74
  39. data/lib/rubygems/install_update_options.rb +13 -8
  40. data/lib/rubygems/installer.rb +139 -95
  41. data/{test/gem_installer_test_case.rb → lib/rubygems/installer_test_case.rb} +41 -2
  42. data/{test/mockgemui.rb → lib/rubygems/mock_gem_ui.rb} +8 -1
  43. data/lib/rubygems/old_format.rb +2 -1
  44. data/lib/rubygems/package.rb +17 -2
  45. data/lib/rubygems/package/tar_input.rb +7 -3
  46. data/lib/rubygems/package/tar_output.rb +2 -0
  47. data/lib/rubygems/package/tar_reader/entry.rb +4 -0
  48. data/{test/gem_package_tar_test_case.rb → lib/rubygems/package/tar_test_case.rb} +5 -2
  49. data/lib/rubygems/package_task.rb +6 -4
  50. data/lib/rubygems/remote_fetcher.rb +10 -2
  51. data/lib/rubygems/require_paths_builder.rb +2 -1
  52. data/lib/rubygems/server.rb +3 -44
  53. data/lib/rubygems/source_index.rb +3 -216
  54. data/lib/rubygems/spec_fetcher.rb +15 -63
  55. data/lib/rubygems/specification.rb +1 -1
  56. data/{test/gemutilities.rb → lib/rubygems/test_case.rb} +219 -90
  57. data/lib/rubygems/test_utilities.rb +7 -20
  58. data/lib/rubygems/uninstaller.rb +27 -28
  59. data/lib/rubygems/user_interaction.rb +81 -42
  60. data/lib/rubygems/validator.rb +0 -73
  61. data/test/{bogussources.rb → rubygems/bogussources.rb} +0 -0
  62. data/test/{data → rubygems/data}/gem-private_key.pem +0 -0
  63. data/test/{data → rubygems/data}/gem-public_cert.pem +0 -0
  64. data/test/{fake_certlib → rubygems/fake_certlib}/openssl.rb +0 -0
  65. data/test/rubygems/foo/discover.rb +0 -0
  66. data/test/{functional.rb → rubygems/functional.rb} +0 -0
  67. data/test/{insure_session.rb → rubygems/insure_session.rb} +0 -0
  68. data/test/{plugin → rubygems/plugin}/exception/rubygems_plugin.rb +0 -0
  69. data/test/{plugin → rubygems/plugin}/load/rubygems_plugin.rb +0 -0
  70. data/test/{plugin → rubygems/plugin}/standarderror/rubygems_plugin.rb +0 -0
  71. data/test/{private_key.pem → rubygems/private_key.pem} +0 -0
  72. data/test/{public_cert.pem → rubygems/public_cert.pem} +0 -0
  73. data/test/rubygems/{commands → rubygems/commands}/crash_command.rb +0 -0
  74. data/test/{rubygems_plugin.rb → rubygems/rubygems_plugin.rb} +0 -0
  75. data/test/rubygems/sff/discover.rb +0 -0
  76. data/test/{simple_gem.rb → rubygems/simple_gem.rb} +2 -2
  77. data/test/{test_config.rb → rubygems/test_config.rb} +2 -2
  78. data/test/{test_gem.rb → rubygems/test_gem.rb} +12 -2
  79. data/test/{test_gem_builder.rb → rubygems/test_gem_builder.rb} +2 -2
  80. data/test/{test_gem_command.rb → rubygems/test_gem_command.rb} +3 -3
  81. data/test/{test_gem_command_manager.rb → rubygems/test_gem_command_manager.rb} +15 -6
  82. data/test/{test_gem_commands_build_command.rb → rubygems/test_gem_commands_build_command.rb} +2 -2
  83. data/test/{test_gem_commands_cert_command.rb → rubygems/test_gem_commands_cert_command.rb} +2 -2
  84. data/test/{test_gem_commands_check_command.rb → rubygems/test_gem_commands_check_command.rb} +2 -2
  85. data/test/{test_gem_commands_contents_command.rb → rubygems/test_gem_commands_contents_command.rb} +3 -3
  86. data/test/{test_gem_commands_dependency_command.rb → rubygems/test_gem_commands_dependency_command.rb} +4 -4
  87. data/test/{test_gem_commands_environment_command.rb → rubygems/test_gem_commands_environment_command.rb} +12 -3
  88. data/test/{test_gem_commands_fetch_command.rb → rubygems/test_gem_commands_fetch_command.rb} +2 -2
  89. data/test/{test_gem_commands_generate_index_command.rb → rubygems/test_gem_commands_generate_index_command.rb} +7 -11
  90. data/test/{test_gem_commands_install_command.rb → rubygems/test_gem_commands_install_command.rb} +2 -2
  91. data/test/{test_gem_commands_list_command.rb → rubygems/test_gem_commands_list_command.rb} +2 -2
  92. data/test/{test_gem_commands_lock_command.rb → rubygems/test_gem_commands_lock_command.rb} +2 -2
  93. data/test/{test_gem_commands_outdated_command.rb → rubygems/test_gem_commands_outdated_command.rb} +2 -2
  94. data/test/{test_gem_commands_owner_command.rb → rubygems/test_gem_commands_owner_command.rb} +5 -5
  95. data/test/{test_gem_commands_pristine_command.rb → rubygems/test_gem_commands_pristine_command.rb} +2 -2
  96. data/test/{test_gem_commands_push_command.rb → rubygems/test_gem_commands_push_command.rb} +3 -3
  97. data/test/{test_gem_commands_query_command.rb → rubygems/test_gem_commands_query_command.rb} +2 -2
  98. data/test/{test_gem_commands_server_command.rb → rubygems/test_gem_commands_server_command.rb} +2 -2
  99. data/test/{test_gem_commands_sources_command.rb → rubygems/test_gem_commands_sources_command.rb} +8 -8
  100. data/test/{test_gem_commands_specification_command.rb → rubygems/test_gem_commands_specification_command.rb} +3 -3
  101. data/test/{test_gem_commands_stale_command.rb → rubygems/test_gem_commands_stale_command.rb} +2 -2
  102. data/test/{test_gem_commands_uninstall_command.rb → rubygems/test_gem_commands_uninstall_command.rb} +16 -10
  103. data/test/{test_gem_commands_unpack_command.rb → rubygems/test_gem_commands_unpack_command.rb} +42 -2
  104. data/test/{test_gem_commands_update_command.rb → rubygems/test_gem_commands_update_command.rb} +2 -2
  105. data/test/{test_gem_commands_which_command.rb → rubygems/test_gem_commands_which_command.rb} +3 -3
  106. data/test/{test_gem_config_file.rb → rubygems/test_gem_config_file.rb} +2 -2
  107. data/test/{test_gem_dependency.rb → rubygems/test_gem_dependency.rb} +3 -27
  108. data/test/{test_gem_dependency_installer.rb → rubygems/test_gem_dependency_installer.rb} +2 -2
  109. data/test/{test_gem_dependency_list.rb → rubygems/test_gem_dependency_list.rb} +3 -3
  110. data/test/{test_gem_doc_manager.rb → rubygems/test_gem_doc_manager.rb} +2 -2
  111. data/test/{test_gem_ext_configure_builder.rb → rubygems/test_gem_ext_configure_builder.rb} +4 -4
  112. data/test/{test_gem_ext_ext_conf_builder.rb → rubygems/test_gem_ext_ext_conf_builder.rb} +46 -2
  113. data/test/{test_gem_ext_rake_builder.rb → rubygems/test_gem_ext_rake_builder.rb} +2 -2
  114. data/test/{test_gem_format.rb → rubygems/test_gem_format.rb} +24 -6
  115. data/test/{test_gem_gem_path_searcher.rb → rubygems/test_gem_gem_path_searcher.rb} +2 -2
  116. data/test/{test_gem_gem_runner.rb → rubygems/test_gem_gem_runner.rb} +2 -2
  117. data/test/{test_gem_gemcutter_utilities.rb → rubygems/test_gem_gemcutter_utilities.rb} +4 -4
  118. data/test/{test_gem_indexer.rb → rubygems/test_gem_indexer.rb} +4 -121
  119. data/test/{test_gem_install_update_options.rb → rubygems/test_gem_install_update_options.rb} +3 -3
  120. data/test/{test_gem_installer.rb → rubygems/test_gem_installer.rb} +106 -13
  121. data/test/{test_gem_local_remote_options.rb → rubygems/test_gem_local_remote_options.rb} +2 -2
  122. data/test/{test_gem_package_tar_header.rb → rubygems/test_gem_package_tar_header.rb} +2 -2
  123. data/test/{test_gem_package_tar_input.rb → rubygems/test_gem_package_tar_input.rb} +21 -4
  124. data/test/{test_gem_package_tar_output.rb → rubygems/test_gem_package_tar_output.rb} +2 -2
  125. data/test/{test_gem_package_tar_reader.rb → rubygems/test_gem_package_tar_reader.rb} +2 -2
  126. data/test/{test_gem_package_tar_reader_entry.rb → rubygems/test_gem_package_tar_reader_entry.rb} +12 -2
  127. data/test/{test_gem_package_tar_writer.rb → rubygems/test_gem_package_tar_writer.rb} +2 -2
  128. data/test/{test_gem_package_task.rb → rubygems/test_gem_package_task.rb} +15 -2
  129. data/test/{test_gem_platform.rb → rubygems/test_gem_platform.rb} +2 -2
  130. data/test/{test_gem_remote_fetcher.rb → rubygems/test_gem_remote_fetcher.rb} +7 -7
  131. data/test/{test_gem_requirement.rb → rubygems/test_gem_requirement.rb} +2 -2
  132. data/test/{test_gem_security.rb → rubygems/test_gem_security.rb} +3 -4
  133. data/test/{test_gem_server.rb → rubygems/test_gem_server.rb} +2 -132
  134. data/test/rubygems/test_gem_silent_ui.rb +113 -0
  135. data/test/{test_gem_source_index.rb → rubygems/test_gem_source_index.rb} +2 -61
  136. data/test/{test_gem_spec_fetcher.rb → rubygems/test_gem_spec_fetcher.rb} +2 -2
  137. data/test/{test_gem_specification.rb → rubygems/test_gem_specification.rb} +4 -4
  138. data/test/{test_gem_stream_ui.rb → rubygems/test_gem_stream_ui.rb} +24 -2
  139. data/test/{test_gem_text.rb → rubygems/test_gem_text.rb} +2 -2
  140. data/test/{test_gem_uninstaller.rb → rubygems/test_gem_uninstaller.rb} +15 -12
  141. data/test/{test_gem_validator.rb → rubygems/test_gem_validator.rb} +3 -3
  142. data/test/{test_gem_version.rb → rubygems/test_gem_version.rb} +2 -2
  143. data/test/{test_gem_version_option.rb → rubygems/test_gem_version_option.rb} +2 -2
  144. data/test/{test_kernel.rb → rubygems/test_kernel.rb} +7 -10
  145. metadata +281 -177
  146. metadata.gz.sig +0 -0
  147. data/lib/rubygems/commands/mirror_command.rb +0 -111
  148. data/lib/rubygems/source_info_cache.rb +0 -394
  149. data/lib/rubygems/source_info_cache_entry.rb +0 -56
  150. data/test/test_gem_commands_mirror_command.rb +0 -60
@@ -131,30 +131,17 @@ end
131
131
  #--
132
132
  # This class was added to flush out problems in Rubinius' IO implementation.
133
133
 
134
- class TempIO
135
-
136
- @@count = 0
137
-
134
+ class TempIO < Tempfile
138
135
  def initialize(string = '')
139
- @tempfile = Tempfile.new "TempIO-#{@@count += 1}"
140
- @tempfile.binmode
141
- @tempfile.write string
142
- @tempfile.rewind
143
- end
144
-
145
- def method_missing(meth, *args, &block)
146
- @tempfile.send(meth, *args, &block)
147
- end
148
-
149
- def respond_to?(meth)
150
- @tempfile.respond_to? meth
136
+ super "TempIO"
137
+ binmode
138
+ write string
139
+ rewind
151
140
  end
152
141
 
153
142
  def string
154
- @tempfile.flush
155
-
156
- Gem.read_binary @tempfile.path
143
+ flush
144
+ Gem.read_binary path
157
145
  end
158
-
159
146
  end
160
147
 
@@ -121,43 +121,42 @@ class Gem::Uninstaller
121
121
  # +gemspec+.
122
122
 
123
123
  def remove_executables(spec)
124
- return if spec.nil?
124
+ return if spec.nil? or spec.executables.empty?
125
125
 
126
- unless spec.executables.empty? then
127
- bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
126
+ bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
128
127
 
129
- list = @source_index.find_name(spec.name).delete_if { |s|
130
- s.version == spec.version
131
- }
128
+ list = @source_index.find_name(spec.name).delete_if { |s|
129
+ s.version == spec.version
130
+ }
132
131
 
133
- executables = spec.executables.clone
132
+ executables = spec.executables.clone
134
133
 
135
- list.each do |s|
136
- s.executables.each do |exe_name|
137
- executables.delete exe_name
138
- end
134
+ list.each do |s|
135
+ s.executables.each do |exe_name|
136
+ executables.delete exe_name
139
137
  end
138
+ end
140
139
 
141
- return if executables.empty?
140
+ return if executables.empty?
142
141
 
143
- answer = if @force_executables.nil? then
144
- ask_yes_no("Remove executables:\n" \
145
- "\t#{spec.executables.join(", ")}\n\nin addition to the gem?",
146
- true) # " # appease ruby-mode - don't ask
147
- else
148
- @force_executables
149
- end
142
+ remove = if @force_executables.nil? then
143
+ ask_yes_no("Remove executables:\n" \
144
+ "\t#{spec.executables.join ', '}\n\n" \
145
+ "in addition to the gem?",
146
+ true)
147
+ else
148
+ @force_executables
149
+ end
150
150
 
151
- unless answer then
152
- say "Executables and scripts will remain installed."
153
- else
154
- raise Gem::FilePermissionError, bindir unless File.writable? bindir
151
+ unless remove then
152
+ say "Executables and scripts will remain installed."
153
+ else
154
+ raise Gem::FilePermissionError, bindir unless File.writable? bindir
155
155
 
156
- spec.executables.each do |exe_name|
157
- say "Removing #{exe_name}"
158
- FileUtils.rm_f File.join(bindir, exe_name)
159
- FileUtils.rm_f File.join(bindir, "#{exe_name}.bat")
160
- end
156
+ spec.executables.each do |exe_name|
157
+ say "Removing #{exe_name}"
158
+ FileUtils.rm_f File.join(bindir, exe_name)
159
+ FileUtils.rm_f File.join(bindir, "#{exe_name}.bat")
161
160
  end
162
161
  end
163
162
  end
@@ -66,7 +66,7 @@ module Gem::DefaultUserInteraction
66
66
  end
67
67
 
68
68
  ##
69
- # Make the default UI accessable without the "ui." prefix. Classes
69
+ # Make the default UI accessible without the "ui." prefix. Classes
70
70
  # including this module may use the interaction methods on the default UI
71
71
  # directly. Classes may also reference the ui and ui= methods.
72
72
  #
@@ -218,48 +218,66 @@ class Gem::StreamUI
218
218
  result
219
219
  end
220
220
 
221
- ##
222
- # Ask for a password. Does not echo response to terminal.
221
+ if RUBY_VERSION > '1.9.2' then
222
+ ##
223
+ # Ask for a password. Does not echo response to terminal.
223
224
 
224
- def ask_for_password(question)
225
- return nil if not @ins.tty?
225
+ def ask_for_password(question)
226
+ return nil if not @ins.tty?
226
227
 
227
- @outs.print(question + " ")
228
- @outs.flush
228
+ require 'io/console'
229
229
 
230
- Gem.win_platform? ? ask_for_password_on_windows : ask_for_password_on_unix
231
- end
230
+ @outs.print(question + " ")
231
+ @outs.flush
232
232
 
233
- ##
234
- # Asks for a password that works on windows. Ripped from the Heroku gem.
233
+ password = @ins.noecho {@ins.gets}
234
+ password.chomp! if password
235
+ password
236
+ end
237
+ else
238
+ ##
239
+ # Ask for a password. Does not echo response to terminal.
235
240
 
236
- def ask_for_password_on_windows
237
- require "Win32API"
238
- char = nil
239
- password = ''
241
+ def ask_for_password(question)
242
+ return nil if not @ins.tty?
240
243
 
241
- while char = Win32API.new("crtdll", "_getch", [ ], "L").Call do
242
- break if char == 10 || char == 13 # received carriage return or newline
243
- if char == 127 || char == 8 # backspace and delete
244
- password.slice!(-1, 1)
245
- else
246
- password << char.chr
247
- end
244
+ @outs.print(question + " ")
245
+ @outs.flush
246
+
247
+ Gem.win_platform? ? ask_for_password_on_windows : ask_for_password_on_unix
248
248
  end
249
249
 
250
- puts
251
- password
252
- end
250
+ ##
251
+ # Asks for a password that works on windows. Ripped from the Heroku gem.
252
+
253
+ def ask_for_password_on_windows
254
+ require "Win32API"
255
+ char = nil
256
+ password = ''
257
+
258
+ while char = Win32API.new("crtdll", "_getch", [ ], "L").Call do
259
+ break if char == 10 || char == 13 # received carriage return or newline
260
+ if char == 127 || char == 8 # backspace and delete
261
+ password.slice!(-1, 1)
262
+ else
263
+ password << char.chr
264
+ end
265
+ end
253
266
 
254
- ##
255
- # Asks for a password that works on unix
256
-
257
- def ask_for_password_on_unix
258
- system "stty -echo"
259
- password = @ins.gets
260
- password.chomp! if password
261
- system "stty echo"
262
- password
267
+ puts
268
+ password
269
+ end
270
+
271
+ ##
272
+ # Asks for a password that works on unix
273
+
274
+ def ask_for_password_on_unix
275
+ system "stty -echo"
276
+ password = @ins.gets
277
+ password.chomp! if password
278
+ system "stty echo"
279
+ password
280
+ end
263
281
  end
264
282
 
265
283
  ##
@@ -453,12 +471,20 @@ class Gem::StreamUI
453
471
  end
454
472
 
455
473
  def fetch(file_name, total_bytes)
456
- @file_name, @total_bytes = file_name, total_bytes
474
+ @file_name = file_name
475
+ @total_bytes = total_bytes.to_i
476
+ @units = @total_bytes.zero? ? 'B' : '%'
477
+
457
478
  update_display(false)
458
479
  end
459
480
 
460
481
  def update(bytes)
461
- new_progress = ((bytes.to_f * 100) / total_bytes.to_f).ceil
482
+ new_progress = if @units == 'B' then
483
+ bytes
484
+ else
485
+ ((bytes.to_f * 100) / total_bytes.to_f).ceil
486
+ end
487
+
462
488
  return if new_progress == @progress
463
489
 
464
490
  @progress = new_progress
@@ -466,7 +492,7 @@ class Gem::StreamUI
466
492
  end
467
493
 
468
494
  def done
469
- @progress = 100
495
+ @progress = 100 if @units == '%'
470
496
  update_display(true, true)
471
497
  end
472
498
 
@@ -474,8 +500,9 @@ class Gem::StreamUI
474
500
 
475
501
  def update_display(show_progress = true, new_line = false)
476
502
  return unless @out.tty?
477
- if show_progress
478
- @out.print "\rFetching: %s (%3d%%)" % [@file_name, @progress]
503
+
504
+ if show_progress then
505
+ @out.print "\rFetching: %s (%3d%s)" % [@file_name, @progress, @units]
479
506
  else
480
507
  @out.print "Fetching: %s" % @file_name
481
508
  end
@@ -497,9 +524,21 @@ end
497
524
  ##
498
525
  # SilentUI is a UI choice that is absolutely silent.
499
526
 
500
- class Gem::SilentUI
501
- def method_missing(sym, *args, &block)
502
- self
527
+ class Gem::SilentUI < Gem::StreamUI
528
+
529
+ def initialize
530
+
531
+ reader, writer = nil, nil
532
+
533
+ if Gem.win_platform?
534
+ reader = File.open('nul', 'r')
535
+ writer = File.open('nul', 'w')
536
+ else
537
+ reader = File.open('/dev/null', 'r')
538
+ writer = File.open('/dev/null', 'w')
539
+ end
540
+
541
+ super reader, writer, writer
503
542
  end
504
543
  end
505
544
 
@@ -7,12 +7,6 @@
7
7
  require 'rubygems/format'
8
8
  require 'rubygems/installer'
9
9
 
10
- begin
11
- gem 'test-unit'
12
- rescue Gem::LoadError
13
- # Ignore - use the test-unit library that's part of the standard library
14
- end
15
-
16
10
  ##
17
11
  # Validator performs various gem file and gem database validation
18
12
 
@@ -167,73 +161,6 @@ class Gem::Validator
167
161
  errors
168
162
  end
169
163
 
170
- if RUBY_VERSION < '1.9' then
171
- class TestRunner
172
- def initialize(suite, ui)
173
- @suite = suite
174
- @ui = ui
175
- end
176
-
177
- def self.run(suite, ui)
178
- require 'test/unit/ui/testrunnermediator'
179
- return new(suite, ui).start
180
- end
181
-
182
- def start
183
- @mediator = Test::Unit::UI::TestRunnerMediator.new(@suite)
184
- @mediator.add_listener(Test::Unit::TestResult::FAULT, &method(:add_fault))
185
- return @mediator.run_suite
186
- end
187
-
188
- def add_fault(fault)
189
- if Gem.configuration.verbose then
190
- @ui.say fault.long_display
191
- end
192
- end
193
- end
194
-
195
- autoload :TestRunner, 'test/unit/ui/testrunnerutilities'
196
- end
197
-
198
- ##
199
- # Runs unit tests for a given gem specification
200
-
201
- def unit_test(gem_spec)
202
- start_dir = Dir.pwd
203
- Dir.chdir(gem_spec.full_gem_path)
204
- $: << gem_spec.full_gem_path
205
- # XXX: why do we need this gem_spec when we've already got 'spec'?
206
- test_files = gem_spec.test_files
207
-
208
- if test_files.empty? then
209
- say "There are no unit tests to run for #{gem_spec.full_name}"
210
- return nil
211
- end
212
-
213
- gem gem_spec.name, "= #{gem_spec.version.version}"
214
-
215
- test_files.each do |f| require f end
216
-
217
- if RUBY_VERSION < '1.9' then
218
- suite = Test::Unit::TestSuite.new("#{gem_spec.name}-#{gem_spec.version}")
219
-
220
- ObjectSpace.each_object(Class) do |klass|
221
- suite << klass.suite if (klass < Test::Unit::TestCase)
222
- end
223
-
224
- result = TestRunner.run suite, ui
225
-
226
- alert_error result.to_s unless result.passed?
227
- else
228
- result = MiniTest::Unit.new
229
- result.run
230
- end
231
-
232
- result
233
- ensure
234
- Dir.chdir(start_dir)
235
- end
236
-
237
164
  def remove_leading_dot_dir(path)
238
165
  path.sub(/^\.\//, "")
239
166
  end
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  SIMPLE_GEM = <<-GEMDATA
2
- MD5SUM = "b12a4d48febeb2289c539c2574c4b6f8"
2
+ MD5SUM = "989bf34a1cbecd52e0ea66b662b3a405"
3
3
  if $0 == __FILE__
4
4
  require 'optparse'
5
5
 
@@ -7,7 +7,7 @@ SIMPLE_GEM = <<-GEMDATA
7
7
  ARGV.options do |opts|
8
8
  opts.on_tail("--help", "show this message") {puts opts; exit}
9
9
  opts.on('--dir=DIRNAME', "Installation directory for the Gem") {|options[:directory]|}
10
- opts.on('--force', "Force Gem to intall, bypassing dependency checks") {|options[:force]|}
10
+ opts.on('--force', "Force Gem to install, bypassing dependency checks") {|options[:force]|}
11
11
  opts.on('--gen-rdoc', "Generate RDoc documentation for the Gem") {|options[:gen_rdoc]|}
12
12
  opts.parse!
13
13
  end
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems'
3
3
 
4
- class TestConfig < RubyGemTestCase
4
+ class TestConfig < Gem::TestCase
5
5
 
6
6
  def test_datadir
7
7
  _, err = capture_io do
@@ -1,11 +1,11 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems'
3
3
  require 'rubygems/gem_openssl'
4
4
  require 'rubygems/installer'
5
5
  require 'pathname'
6
6
  require 'tmpdir'
7
7
 
8
- class TestGem < RubyGemTestCase
8
+ class TestGem < Gem::TestCase
9
9
 
10
10
  def setup
11
11
  super
@@ -301,6 +301,7 @@ class TestGem < RubyGemTestCase
301
301
  ]
302
302
 
303
303
  assert_equal expected, Gem.find_files('sff/discover')
304
+ assert_equal expected, Gem.find_files('sff/**.rb'), '[ruby-core:31730]'
304
305
  ensure
305
306
  assert_equal cwd, $LOAD_PATH.shift
306
307
  end
@@ -329,11 +330,18 @@ class TestGem < RubyGemTestCase
329
330
  assert_equal true, Gem.loaded_specs.keys.include?('foo')
330
331
  end
331
332
 
333
+ def util_path
334
+ ENV.delete "GEM_HOME"
335
+ ENV.delete "GEM_PATH"
336
+ end
337
+
332
338
  def test_self_path
333
339
  assert_equal [Gem.dir], Gem.path
334
340
  end
335
341
 
336
342
  def test_self_path_default
343
+ util_path
344
+
337
345
  if defined? APPLE_GEM_HOME
338
346
  orig_APPLE_GEM_HOME = APPLE_GEM_HOME
339
347
  Object.send :remove_const, :APPLE_GEM_HOME
@@ -347,6 +355,8 @@ class TestGem < RubyGemTestCase
347
355
 
348
356
  unless win_platform?
349
357
  def test_self_path_APPLE_GEM_HOME
358
+ util_path
359
+
350
360
  Gem.clear_paths
351
361
  apple_gem_home = File.join @tempdir, 'apple_gem_home'
352
362
  Gem.const_set :APPLE_GEM_HOME, apple_gem_home