rubygems-update 2.4.8 → 2.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 (125) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/CODE_OF_CONDUCT.md +40 -0
  5. data/CVE-2015-3900.txt +40 -0
  6. data/History.txt +173 -2
  7. data/Manifest.txt +14 -1
  8. data/Rakefile +36 -1
  9. data/lib/rubygems.rb +32 -14
  10. data/lib/rubygems/basic_specification.rb +31 -9
  11. data/lib/rubygems/commands/dependency_command.rb +25 -15
  12. data/lib/rubygems/commands/environment_command.rb +2 -0
  13. data/lib/rubygems/commands/help_command.rb +0 -10
  14. data/lib/rubygems/commands/install_command.rb +1 -1
  15. data/lib/rubygems/commands/list_command.rb +1 -1
  16. data/lib/rubygems/commands/pristine_command.rb +11 -1
  17. data/lib/rubygems/commands/query_command.rb +1 -1
  18. data/lib/rubygems/commands/sources_command.rb +1 -1
  19. data/lib/rubygems/commands/update_command.rb +2 -2
  20. data/lib/rubygems/config_file.rb +4 -4
  21. data/lib/rubygems/core_ext/kernel_require.rb +2 -2
  22. data/lib/rubygems/dependency.rb +9 -6
  23. data/lib/rubygems/dependency_list.rb +3 -0
  24. data/lib/rubygems/ext/builder.rb +2 -0
  25. data/lib/rubygems/ext/ext_conf_builder.rb +6 -1
  26. data/lib/rubygems/indexer.rb +26 -91
  27. data/lib/rubygems/installer.rb +58 -26
  28. data/lib/rubygems/installer_test_case.rb +2 -2
  29. data/lib/rubygems/package.rb +18 -6
  30. data/lib/rubygems/package/old.rb +2 -2
  31. data/lib/rubygems/package/tar_reader/entry.rb +7 -1
  32. data/lib/rubygems/package/tar_test_case.rb +12 -3
  33. data/lib/rubygems/package/tar_writer.rb +19 -1
  34. data/lib/rubygems/platform.rb +3 -2
  35. data/lib/rubygems/rdoc.rb +1 -2
  36. data/lib/rubygems/remote_fetcher.rb +25 -6
  37. data/lib/rubygems/request/connection_pools.rb +8 -4
  38. data/lib/rubygems/request_set.rb +3 -4
  39. data/lib/rubygems/request_set/gem_dependency_api.rb +2 -2
  40. data/lib/rubygems/request_set/lockfile.rb +1 -1
  41. data/lib/rubygems/request_set/lockfile/parser.rb +54 -43
  42. data/lib/rubygems/request_set/lockfile/tokenizer.rb +16 -13
  43. data/lib/rubygems/resolver.rb +47 -242
  44. data/lib/rubygems/resolver/activation_request.rb +2 -1
  45. data/lib/rubygems/resolver/conflict.rb +0 -1
  46. data/lib/rubygems/resolver/dependency_request.rb +4 -1
  47. data/lib/rubygems/resolver/git_specification.rb +1 -2
  48. data/lib/rubygems/resolver/molinillo.rb +1 -0
  49. data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +5 -0
  50. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +266 -0
  51. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +69 -0
  52. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +3 -0
  53. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +99 -0
  54. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +63 -0
  55. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +430 -0
  56. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +43 -0
  57. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +51 -0
  58. data/lib/rubygems/resolver/specification.rb +1 -1
  59. data/lib/rubygems/specification.rb +256 -86
  60. data/lib/rubygems/stub_specification.rb +37 -29
  61. data/lib/rubygems/test_case.rb +65 -28
  62. data/lib/rubygems/test_utilities.rb +18 -18
  63. data/lib/rubygems/text.rb +0 -2
  64. data/lib/rubygems/uninstaller.rb +1 -1
  65. data/lib/rubygems/util.rb +4 -4
  66. data/lib/rubygems/util/licenses.rb +309 -0
  67. data/lib/rubygems/util/list.rb +9 -21
  68. data/lib/rubygems/version.rb +24 -14
  69. data/test/rubygems/simple_gem.rb +1 -1
  70. data/test/rubygems/test_config.rb +10 -1
  71. data/test/rubygems/test_gem.rb +58 -11
  72. data/test/rubygems/test_gem_available_set.rb +2 -1
  73. data/test/rubygems/test_gem_commands_cleanup_command.rb +6 -5
  74. data/test/rubygems/test_gem_commands_dependency_command.rb +9 -1
  75. data/test/rubygems/test_gem_commands_install_command.rb +17 -28
  76. data/test/rubygems/test_gem_commands_mirror.rb +0 -13
  77. data/test/rubygems/test_gem_commands_outdated_command.rb +2 -3
  78. data/test/rubygems/test_gem_commands_pristine_command.rb +33 -5
  79. data/test/rubygems/test_gem_commands_query_command.rb +123 -158
  80. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  81. data/test/rubygems/test_gem_commands_specification_command.rb +4 -4
  82. data/test/rubygems/test_gem_commands_stale_command.rb +2 -0
  83. data/test/rubygems/test_gem_commands_uninstall_command.rb +5 -4
  84. data/test/rubygems/test_gem_commands_unpack_command.rb +4 -6
  85. data/test/rubygems/test_gem_commands_update_command.rb +22 -52
  86. data/test/rubygems/test_gem_commands_which_command.rb +1 -0
  87. data/test/rubygems/test_gem_config_file.rb +1 -1
  88. data/test/rubygems/test_gem_dependency.rb +7 -3
  89. data/test/rubygems/test_gem_dependency_installer.rb +5 -5
  90. data/test/rubygems/test_gem_doctor.rb +1 -1
  91. data/test/rubygems/test_gem_ext_builder.rb +2 -0
  92. data/test/rubygems/test_gem_ext_configure_builder.rb +8 -4
  93. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +25 -21
  94. data/test/rubygems/test_gem_indexer.rb +4 -4
  95. data/test/rubygems/test_gem_install_update_options.rb +2 -2
  96. data/test/rubygems/test_gem_installer.rb +32 -26
  97. data/test/rubygems/test_gem_package.rb +46 -1
  98. data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -1
  99. data/test/rubygems/test_gem_package_tar_writer.rb +10 -1
  100. data/test/rubygems/test_gem_package_task.rb +5 -2
  101. data/test/rubygems/test_gem_platform.rb +11 -0
  102. data/test/rubygems/test_gem_remote_fetcher.rb +64 -3
  103. data/test/rubygems/test_gem_request.rb +1 -1
  104. data/test/rubygems/test_gem_request_connection_pools.rb +10 -1
  105. data/test/rubygems/test_gem_request_set.rb +5 -8
  106. data/test/rubygems/test_gem_request_set_lockfile.rb +2 -4
  107. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
  108. data/test/rubygems/test_gem_resolver.rb +12 -31
  109. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -0
  110. data/test/rubygems/test_gem_resolver_installer_set.rb +7 -11
  111. data/test/rubygems/test_gem_resolver_lock_specification.rb +3 -2
  112. data/test/rubygems/test_gem_security_trust_dir.rb +2 -0
  113. data/test/rubygems/test_gem_server.rb +4 -0
  114. data/test/rubygems/test_gem_specification.rb +344 -61
  115. data/test/rubygems/test_gem_stream_ui.rb +6 -6
  116. data/test/rubygems/test_gem_stub_specification.rb +21 -6
  117. data/test/rubygems/test_gem_text.rb +2 -0
  118. data/test/rubygems/test_gem_uninstaller.rb +2 -1
  119. data/test/rubygems/test_gem_util.rb +8 -0
  120. data/test/rubygems/test_require.rb +156 -125
  121. data/util/generate_spdx_license_list.rb +21 -0
  122. data/util/update_bundled_ca_certificates.rb +2 -1
  123. metadata +42 -6
  124. metadata.gz.sig +0 -0
  125. data/lib/rubygems/util/stringio.rb +0 -34
@@ -37,8 +37,8 @@ class TestGemCommandsServerCommand < Gem::TestCase
37
37
  @cmd.send :handle_options, %w[-p 65535]
38
38
  assert_equal 65535, @cmd.options[:port]
39
39
 
40
- @cmd.send :handle_options, %w[-p http]
41
- assert_equal 80, @cmd.options[:port]
40
+ @cmd.send :handle_options, %w[-p discard]
41
+ assert_equal 9, @cmd.options[:port]
42
42
 
43
43
  e = assert_raises OptionParser::InvalidArgument do
44
44
  @cmd.send :handle_options, %w[-p nonexistent]
@@ -26,8 +26,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
26
26
  end
27
27
 
28
28
  def test_execute_all
29
- util_spec 'foo', '0.0.1'
30
- util_spec 'foo', '0.0.2'
29
+ install_specs util_spec 'foo', '0.0.1'
30
+ install_specs util_spec 'foo', '0.0.2'
31
31
 
32
32
  @cmd.options[:args] = %w[foo]
33
33
  @cmd.options[:all] = true
@@ -89,8 +89,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
89
89
  end
90
90
 
91
91
  def test_execute_exact_match
92
- util_spec 'foo'
93
- util_spec 'foo_bar'
92
+ install_specs util_spec 'foo'
93
+ install_specs util_spec 'foo_bar'
94
94
 
95
95
  @cmd.options[:args] = %w[foo]
96
96
 
@@ -13,10 +13,12 @@ class TestGemCommandsStaleCommand < Gem::TestCase
13
13
  foo_bar = util_spec 'foo_bar' do |gem|
14
14
  gem.files = files
15
15
  end
16
+ install_specs foo_bar
16
17
 
17
18
  bar_baz = util_spec 'bar_baz' do |gem|
18
19
  gem.files = files
19
20
  end
21
+ install_specs bar_baz
20
22
 
21
23
  files.each do |file|
22
24
  filename = File.join(bar_baz.full_gem_path, file)
@@ -5,6 +5,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
5
5
 
6
6
  def setup
7
7
  super
8
+ common_installer_setup
8
9
 
9
10
  build_rake_in do
10
11
  use_ui @ui do
@@ -24,7 +25,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
24
25
 
25
26
  gemhome2 = "#{@gemhome}2"
26
27
 
27
- a_4 = util_spec 'a', 4
28
+ a_4, = util_gem 'a', 4
28
29
  install_gem a_4, :install_dir => gemhome2
29
30
 
30
31
  Gem::Specification.dirs = [@gemhome, gemhome2]
@@ -41,7 +42,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
41
42
  @cmd.execute
42
43
  end
43
44
 
44
- assert_equal %w[a-4 a_evil-9 b-2 c-1.2 default-1 dep_x-1 pl-1-x86-linux x-1],
45
+ assert_equal %w[a_evil-9 b-2 c-1.2 default-1 dep_x-1 pl-1-x86-linux x-1],
45
46
  Gem::Specification.all_names.sort
46
47
  end
47
48
 
@@ -213,7 +214,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
213
214
 
214
215
  gemhome2 = "#{@gemhome}2"
215
216
 
216
- a_4 = util_spec 'a', 4
217
+ a_4, = util_gem 'a', 4
217
218
  install_gem a_4, :install_dir => gemhome2
218
219
 
219
220
  Gem::Specification.dirs = [@gemhome, gemhome2]
@@ -229,7 +230,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
229
230
  @cmd.execute
230
231
  end
231
232
 
232
- assert_equal %w[a-4 default-1], Gem::Specification.all_names.sort
233
+ assert_equal %w[default-1], Gem::Specification.all_names.sort
233
234
  end
234
235
 
235
236
  def test_handle_options
@@ -101,10 +101,8 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
101
101
 
102
102
  def test_execute_remote
103
103
  spec_fetcher do |fetcher|
104
- fetcher.spec 'a', 1
105
- fetcher.gem 'a', 2
106
-
107
- fetcher.clear
104
+ fetcher.download 'a', 1
105
+ fetcher.download 'a', 2
108
106
  end
109
107
 
110
108
  Gem.configuration.verbose = :really
@@ -184,8 +182,8 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
184
182
 
185
183
  foo_path = File.join(@tempdir, "#{foo_spec.full_name}.gem")
186
184
  foo_bar_path = File.join(@tempdir, "#{foo_bar_spec.full_name}.gem")
187
- Gem::Installer.new(foo_path).install
188
- Gem::Installer.new(foo_bar_path).install
185
+ Gem::Installer.at(foo_path).install
186
+ Gem::Installer.at(foo_bar_path).install
189
187
 
190
188
  @cmd.options[:args] = %w[foo]
191
189
 
@@ -18,11 +18,9 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
18
18
  @cmd.options[:document] = []
19
19
 
20
20
  @specs = spec_fetcher do |fetcher|
21
- fetcher.gem 'a', 1
22
- fetcher.gem 'a', 2
23
- fetcher.gem 'a', '3.a'
24
-
25
- fetcher.clear
21
+ fetcher.download 'a', 1
22
+ fetcher.download 'a', 2
23
+ fetcher.download 'a', '3.a'
26
24
  end
27
25
 
28
26
  @a1_path = @specs['a-1'].cache_file
@@ -32,10 +30,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
32
30
 
33
31
  def test_execute
34
32
  spec_fetcher do |fetcher|
35
- fetcher.gem 'a', 2
36
-
37
- fetcher.clear
38
-
33
+ fetcher.download 'a', 2
39
34
  fetcher.spec 'a', 1
40
35
  end
41
36
 
@@ -54,10 +49,8 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
54
49
 
55
50
  def test_execute_multiple
56
51
  spec_fetcher do |fetcher|
57
- fetcher.gem 'a', 2
58
- fetcher.gem 'ab', 2
59
-
60
- fetcher.clear
52
+ fetcher.download 'a', 2
53
+ fetcher.download 'ab', 2
61
54
 
62
55
  fetcher.spec 'a', 1
63
56
  fetcher.spec 'ab', 1
@@ -78,9 +71,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
78
71
 
79
72
  def test_execute_system
80
73
  spec_fetcher do |fetcher|
81
- fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
82
-
83
- fetcher.clear
74
+ fetcher.download 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
84
75
  end
85
76
 
86
77
  @cmd.options[:args] = []
@@ -100,11 +91,9 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
100
91
 
101
92
  def test_execute_system_at_latest
102
93
  spec_fetcher do |fetcher|
103
- fetcher.gem 'rubygems-update', Gem::VERSION do |s|
94
+ fetcher.download 'rubygems-update', Gem::VERSION do |s|
104
95
  s.files = %w[setup.rb]
105
96
  end
106
-
107
- fetcher.clear
108
97
  end
109
98
 
110
99
  @cmd.options[:args] = []
@@ -123,10 +112,8 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
123
112
 
124
113
  def test_execute_system_multiple
125
114
  spec_fetcher do |fetcher|
126
- fetcher.gem 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
127
- fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
128
-
129
- fetcher.clear
115
+ fetcher.download 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
116
+ fetcher.download 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
130
117
  end
131
118
 
132
119
  @cmd.options[:args] = []
@@ -146,10 +133,8 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
146
133
 
147
134
  def test_execute_system_specific
148
135
  spec_fetcher do |fetcher|
149
- fetcher.gem 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
150
- fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
151
-
152
- fetcher.clear
136
+ fetcher.download 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
137
+ fetcher.download 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
153
138
  end
154
139
 
155
140
  @cmd.options[:args] = []
@@ -169,10 +154,8 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
169
154
 
170
155
  def test_execute_system_specifically_to_latest_version
171
156
  spec_fetcher do |fetcher|
172
- fetcher.gem 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
173
- fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
174
-
175
- fetcher.clear
157
+ fetcher.download 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
158
+ fetcher.download 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
176
159
  end
177
160
 
178
161
  @cmd.options[:args] = []
@@ -213,11 +196,9 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
213
196
 
214
197
  def test_execute_dependencies
215
198
  spec_fetcher do |fetcher|
216
- fetcher.gem 'a', 2, 'b' => 2, 'c' => 2
217
- fetcher.gem 'b', 2
218
- fetcher.gem 'c', 2
219
-
220
- fetcher.clear
199
+ fetcher.download 'a', 2, 'b' => 2, 'c' => 2
200
+ fetcher.download 'b', 2
201
+ fetcher.download 'c', 2
221
202
 
222
203
  fetcher.spec 'a', 1, 'c' => '1.2'
223
204
  fetcher.spec 'c', '1.2'
@@ -243,10 +224,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
243
224
  def test_execute_rdoc
244
225
  skip if RUBY_VERSION <= "1.8.7"
245
226
  spec_fetcher do |fetcher|
246
- fetcher.gem 'a', 2
247
-
248
- fetcher.clear
249
-
227
+ fetcher.download 'a', 2
250
228
  fetcher.spec 'a', 1
251
229
  end
252
230
 
@@ -269,9 +247,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
269
247
 
270
248
  def test_execute_named
271
249
  spec_fetcher do |fetcher|
272
- fetcher.gem 'a', 2
273
-
274
- fetcher.clear
250
+ fetcher.download 'a', 2
275
251
 
276
252
  fetcher.spec 'a', 1
277
253
  end
@@ -292,8 +268,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
292
268
 
293
269
  def test_execute_named_some_up_to_date
294
270
  spec_fetcher do |fetcher|
295
- fetcher.gem 'a', 2
296
- fetcher.clear
271
+ fetcher.download 'a', 2
297
272
  fetcher.spec 'a', 1
298
273
 
299
274
  fetcher.spec 'b', 2
@@ -334,9 +309,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
334
309
 
335
310
  def test_execute_named_up_to_date_prerelease
336
311
  spec_fetcher do |fetcher|
337
- fetcher.gem 'a', '3.a'
338
-
339
- fetcher.clear
312
+ fetcher.download 'a', '3.a'
340
313
 
341
314
  fetcher.gem 'a', 2
342
315
  end
@@ -376,10 +349,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
376
349
 
377
350
  def test_execute_user_install
378
351
  spec_fetcher do |fetcher|
379
- fetcher.gem 'a', 2
380
-
381
- fetcher.clear
382
-
352
+ fetcher.download 'a', 2
383
353
  fetcher.spec 'a', 1
384
354
  end
385
355
 
@@ -73,6 +73,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
73
73
  @foo_bar = util_spec 'foo_bar' do |gem|
74
74
  gem.files = files
75
75
  end
76
+ install_specs @foo_bar
76
77
 
77
78
  files.each do |file|
78
79
  filename = File.join(@foo_bar.full_gem_path, file)
@@ -416,7 +416,7 @@ if you believe they were disclosed to a third party.
416
416
 
417
417
  def test_ignore_invalid_config_file
418
418
  File.open @temp_conf, 'w' do |fp|
419
- fp.puts "some-non-yaml-hash-string"
419
+ fp.puts "invalid: yaml:"
420
420
  end
421
421
 
422
422
  begin
@@ -294,10 +294,11 @@ class TestGemDependency < Gem::TestCase
294
294
  end
295
295
 
296
296
  def test_to_spec
297
- util_spec 'a', '1'
297
+ a_1 = util_spec 'a', '1'
298
298
  a_2 = util_spec 'a', '2'
299
299
 
300
300
  a_dep = dep 'a', '>= 0'
301
+ install_specs a_1, a_2
301
302
 
302
303
  assert_equal a_2, a_dep.to_spec
303
304
  end
@@ -307,6 +308,7 @@ class TestGemDependency < Gem::TestCase
307
308
  a_1_1_a = util_spec 'a', '1.1.a'
308
309
 
309
310
  a_dep = dep 'a', '>= 0'
311
+ install_specs a_1, a_1_1_a
310
312
 
311
313
  assert_equal a_1, a_dep.to_spec
312
314
 
@@ -317,7 +319,8 @@ class TestGemDependency < Gem::TestCase
317
319
  end
318
320
 
319
321
  def test_to_specs_suggests_other_versions
320
- a = util_spec 'a', '1.0', 'b' => '>= 1.0'
322
+ a = util_spec 'a', '1.0'
323
+ install_specs a
321
324
 
322
325
  a_file = File.join a.gem_dir, 'lib', 'a_file.rb'
323
326
 
@@ -335,7 +338,8 @@ class TestGemDependency < Gem::TestCase
335
338
  end
336
339
 
337
340
  def test_to_specs_indicates_total_gem_set_size
338
- a = util_spec 'a', '1.0', 'b' => '>= 1.0'
341
+ a = util_spec 'a', '1.0'
342
+ install_specs a
339
343
 
340
344
  a_file = File.join a.gem_dir, 'lib', 'a_file.rb'
341
345
 
@@ -406,7 +406,7 @@ class TestGemDependencyInstaller < Gem::TestCase
406
406
  def test_install_dependency_existing
407
407
  util_setup_gems
408
408
 
409
- Gem::Installer.new(@a1_gem).install
409
+ Gem::Installer.at(@a1_gem).install
410
410
  FileUtils.mv @a1_gem, @tempdir
411
411
  FileUtils.mv @b1_gem, @tempdir
412
412
  inst = nil
@@ -437,7 +437,7 @@ class TestGemDependencyInstaller < Gem::TestCase
437
437
 
438
438
  _, f1_gem = util_gem 'f', '1', 'e' => nil
439
439
 
440
- Gem::Installer.new(e1_gem).install
440
+ Gem::Installer.at(e1_gem).install
441
441
  FileUtils.rm_r e1.extension_dir
442
442
 
443
443
  FileUtils.mv e1_gem, @tempdir
@@ -525,7 +525,7 @@ class TestGemDependencyInstaller < Gem::TestCase
525
525
  inst = nil
526
526
 
527
527
  Dir.chdir @tempdir do
528
- Gem::Installer.new('a-1.gem').install
528
+ Gem::Installer.at('a-1.gem').install
529
529
 
530
530
  inst = Gem::DependencyInstaller.new :domain => :local
531
531
  inst.install 'b-1.gem'
@@ -669,7 +669,7 @@ class TestGemDependencyInstaller < Gem::TestCase
669
669
  FileUtils.mv @a1_gem, @tempdir
670
670
  FileUtils.mv @b1_gem, @tempdir
671
671
 
672
- inst = Gem::Installer.new @a1.file_name
672
+ inst = Gem::Installer.at @a1.file_name
673
673
  inst.install
674
674
 
675
675
  gemhome2 = File.join @tempdir, 'gemhome2'
@@ -799,7 +799,7 @@ class TestGemDependencyInstaller < Gem::TestCase
799
799
  def test_install_reinstall
800
800
  util_setup_gems
801
801
 
802
- Gem::Installer.new(@a1_gem).install
802
+ Gem::Installer.at(@a1_gem).install
803
803
  FileUtils.mv @a1_gem, @tempdir
804
804
  inst = nil
805
805
 
@@ -157,7 +157,7 @@ This directory does not appear to be a RubyGems repository, skipping
157
157
 
158
158
  refute doctor.gem_repository?, 'no gems installed'
159
159
 
160
- util_spec 'a'
160
+ install_specs util_spec 'a'
161
161
 
162
162
  doctor = Gem::Doctor.new @gemhome
163
163
 
@@ -147,6 +147,8 @@ install:
147
147
  class << Gem
148
148
  alias orig_install_extension_in_lib install_extension_in_lib
149
149
 
150
+ remove_method :install_extension_in_lib
151
+
150
152
  def Gem.install_extension_in_lib
151
153
  false
152
154
  end
@@ -29,12 +29,16 @@ class TestGemExtConfigureBuilder < Gem::TestCase
29
29
  Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
30
30
  end
31
31
 
32
+ assert_match(/^current directory:/, output.shift)
32
33
  assert_equal "sh ./configure --prefix=#{@dest_path}", output.shift
33
34
  assert_equal "", output.shift
35
+ assert_match(/^current directory:/, output.shift)
34
36
  assert_contains_make_command 'clean', output.shift
35
37
  assert_match(/^ok$/m, output.shift)
38
+ assert_match(/^current directory:/, output.shift)
36
39
  assert_contains_make_command '', output.shift
37
40
  assert_match(/^ok$/m, output.shift)
41
+ assert_match(/^current directory:/, output.shift)
38
42
  assert_contains_make_command 'install', output.shift
39
43
  assert_match(/^ok$/m, output.shift)
40
44
  end
@@ -54,6 +58,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
54
58
 
55
59
  assert_match 'configure failed', error.message
56
60
 
61
+ assert_match(/^current directory:/, output.shift)
57
62
  assert_equal "#{sh_prefix_configure}#{@dest_path}", output.shift
58
63
  assert_match %r(#{shell_error_msg}), output.shift
59
64
  assert_equal true, output.empty?
@@ -73,10 +78,9 @@ class TestGemExtConfigureBuilder < Gem::TestCase
73
78
  Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
74
79
  end
75
80
 
76
- assert_contains_make_command 'clean', output[0]
77
- assert_contains_make_command '', output[2]
78
- assert_contains_make_command 'install', output[4]
81
+ assert_contains_make_command 'clean', output[1]
82
+ assert_contains_make_command '', output[4]
83
+ assert_contains_make_command 'install', output[7]
79
84
  end
80
85
 
81
86
  end
82
-
@@ -33,11 +33,13 @@ class TestGemExtExtConfBuilder < Gem::TestCase
33
33
  assert_same result, output
34
34
  end
35
35
 
36
- assert_match(/^#{Gem.ruby}.* extconf.rb/, output[0])
37
- assert_equal "creating Makefile\n", output[1]
38
- assert_contains_make_command 'clean', output[2]
39
- assert_contains_make_command '', output[4]
40
- assert_contains_make_command 'install', output[6]
36
+ assert_match(/^current directory:/, output[0])
37
+ assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1])
38
+ assert_equal "creating Makefile\n", output[2]
39
+ assert_match(/^current directory:/, output[3])
40
+ assert_contains_make_command 'clean', output[4]
41
+ assert_contains_make_command '', output[7]
42
+ assert_contains_make_command 'install', output[10]
41
43
  assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
42
44
  end
43
45
 
@@ -54,16 +56,16 @@ class TestGemExtExtConfBuilder < Gem::TestCase
54
56
  Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
55
57
  end
56
58
 
57
- assert_equal "creating Makefile\n", output[1]
58
- assert_contains_make_command 'clean', output[2]
59
- assert_contains_make_command '', output[4]
60
- assert_contains_make_command 'install', output[6]
59
+ assert_equal "creating Makefile\n", output[2]
60
+ assert_contains_make_command 'clean', output[4]
61
+ assert_contains_make_command '', output[7]
62
+ assert_contains_make_command 'install', output[10]
61
63
  end
62
64
  end
63
65
 
64
66
  def test_class_build_env_make
65
- env_make = ENV.delete 'make'
66
- ENV['make'] = 'anothermake'
67
+ env_make = ENV.delete 'MAKE'
68
+ ENV['MAKE'] = 'anothermake'
67
69
 
68
70
  configure_args '' do
69
71
  File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -78,11 +80,11 @@ class TestGemExtExtConfBuilder < Gem::TestCase
78
80
  end
79
81
  end
80
82
 
81
- assert_equal "creating Makefile\n", output[1]
82
- assert_contains_make_command 'clean', output[2]
83
+ assert_equal "creating Makefile\n", output[2]
84
+ assert_contains_make_command 'clean', output[4]
83
85
  end
84
86
  ensure
85
- ENV['make'] = env_make
87
+ ENV['MAKE'] = env_make
86
88
  end
87
89
 
88
90
  def test_class_build_extconf_fail
@@ -106,7 +108,9 @@ class TestGemExtExtConfBuilder < Gem::TestCase
106
108
 
107
109
  assert_equal 'extconf failed, exit code 1', error.message
108
110
 
109
- assert_match(/^#{Gem.ruby}.* extconf.rb/, output[0])
111
+ assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1])
112
+ assert_match(File.join(@dest_path, 'mkmf.log'), output[4])
113
+
110
114
  assert_path_exists File.join @dest_path, 'mkmf.log'
111
115
  end
112
116
 
@@ -147,9 +151,9 @@ end
147
151
  Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
148
152
  end
149
153
 
150
- assert_contains_make_command 'clean', output[2]
151
- assert_contains_make_command '', output[4]
152
- assert_contains_make_command 'install', output[6]
154
+ assert_contains_make_command 'clean', output[4]
155
+ assert_contains_make_command '', output[7]
156
+ assert_contains_make_command 'install', output[10]
153
157
  assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
154
158
  end
155
159
 
@@ -173,9 +177,9 @@ end
173
177
  Gem::Ext::ExtConfBuilder.make @ext, output
174
178
  end
175
179
 
176
- assert_contains_make_command 'clean', output[0]
177
- assert_contains_make_command '', output[2]
178
- assert_contains_make_command 'install', output[4]
180
+ assert_contains_make_command 'clean', output[1]
181
+ assert_contains_make_command '', output[4]
182
+ assert_contains_make_command 'install', output[7]
179
183
  end
180
184
 
181
185
  def test_class_make_no_Makefile