rubygems-update 3.2.17 → 3.2.21
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/Manifest.txt +3 -0
- data/Rakefile +6 -6
- data/bundler/CHANGELOG.md +54 -0
- data/bundler/bundler.gemspec +2 -3
- data/bundler/lib/bundler.rb +2 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +13 -33
- data/bundler/lib/bundler/cli/check.rb +4 -2
- data/bundler/lib/bundler/cli/install.rb +6 -7
- data/bundler/lib/bundler/cli/outdated.rb +9 -10
- data/bundler/lib/bundler/definition.rb +29 -82
- data/bundler/lib/bundler/feature_flag.rb +0 -2
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher/index.rb +0 -1
- data/bundler/lib/bundler/friendly_errors.rb +2 -4
- data/bundler/lib/bundler/index.rb +1 -2
- data/bundler/lib/bundler/installer.rb +1 -8
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -7
- data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -8
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +14 -0
- data/bundler/lib/bundler/resolver.rb +15 -96
- data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
- data/bundler/lib/bundler/rubygems_ext.rb +2 -2
- data/bundler/lib/bundler/rubygems_integration.rb +4 -3
- data/bundler/lib/bundler/settings.rb +21 -3
- data/bundler/lib/bundler/source.rb +11 -0
- data/bundler/lib/bundler/source/rubygems.rb +24 -11
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
- data/bundler/lib/bundler/source_list.rb +35 -10
- data/bundler/lib/bundler/source_map.rb +58 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/command.rb +2 -0
- data/lib/rubygems/commands/build_command.rb +1 -1
- data/lib/rubygems/config_file.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
- data/lib/rubygems/installer.rb +4 -0
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/specification.rb +0 -2
- data/lib/rubygems/specification_policy.rb +5 -4
- data/lib/rubygems/test_case.rb +106 -18
- data/lib/rubygems/util/licenses.rb +107 -2
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -2
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/test_bundled_ca.rb +2 -2
- data/test/rubygems/test_deprecate.rb +3 -3
- data/test/rubygems/test_gem.rb +33 -31
- data/test/rubygems/test_gem_bundler_version_finder.rb +3 -5
- data/test/rubygems/test_gem_command.rb +13 -1
- data/test/rubygems/test_gem_command_manager.rb +5 -5
- data/test/rubygems/test_gem_commands_build_command.rb +10 -10
- data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
- data/test/rubygems/test_gem_commands_check_command.rb +5 -5
- data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
- data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
- data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
- data/test/rubygems/test_gem_commands_help_command.rb +8 -1
- data/test/rubygems/test_gem_commands_install_command.rb +60 -60
- data/test/rubygems/test_gem_commands_list_command.rb +1 -1
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +8 -9
- data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
- data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
- data/test/rubygems/test_gem_commands_push_command.rb +6 -11
- data/test/rubygems/test_gem_commands_query_command.rb +7 -7
- data/test/rubygems/test_gem_commands_server_command.rb +2 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
- data/test/rubygems/test_gem_commands_signin_command.rb +13 -6
- data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
- data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
- data/test/rubygems/test_gem_commands_update_command.rb +10 -10
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +9 -9
- data/test/rubygems/test_gem_dependency.rb +12 -6
- data/test/rubygems/test_gem_dependency_installer.rb +4 -4
- data/test/rubygems/test_gem_doctor.rb +30 -30
- data/test/rubygems/test_gem_ext_builder.rb +20 -20
- data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -14
- data/test/rubygems/test_gem_install_update_options.rb +9 -9
- data/test/rubygems/test_gem_installer.rb +162 -140
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_package.rb +48 -48
- data/test/rubygems/test_gem_package_old.rb +9 -9
- data/test/rubygems/test_gem_package_tar_header.rb +5 -5
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
- data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +1 -1
- data/test/rubygems/test_gem_rdoc.rb +9 -9
- data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
- data/test/rubygems/test_gem_request_set.rb +15 -14
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
- data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
- data/test/rubygems/test_gem_requirement.rb +13 -13
- data/test/rubygems/test_gem_resolver.rb +11 -11
- data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
- data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
- data/test/rubygems/test_gem_security.rb +5 -5
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +7 -7
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
- data/test/rubygems/test_gem_server.rb +2 -2
- data/test/rubygems/test_gem_silent_ui.rb +9 -9
- data/test/rubygems/test_gem_source.rb +2 -2
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
- data/test/rubygems/test_gem_source_git.rb +11 -11
- data/test/rubygems/test_gem_source_specific_file.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +86 -106
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_stub_specification.rb +4 -4
- data/test/rubygems/test_gem_uninstaller.rb +16 -16
- data/test/rubygems/test_gem_util.rb +8 -6
- data/test/rubygems/test_gem_version.rb +4 -13
- data/test/rubygems/test_kernel.rb +6 -4
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +12 -14
- data/test/test_changelog_generator.rb +1 -2
- metadata +6 -3
@@ -132,12 +132,12 @@ install:
|
|
132
132
|
@builder.build_extensions
|
133
133
|
end
|
134
134
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
135
|
+
assert_path_exist @spec.extension_dir
|
136
|
+
assert_path_exist @spec.gem_build_complete_path
|
137
|
+
assert_path_exist File.join @spec.extension_dir, 'gem_make.out'
|
138
|
+
assert_path_exist File.join @spec.extension_dir, 'a.rb'
|
139
|
+
assert_path_exist File.join @spec.gem_dir, 'lib', 'a.rb'
|
140
|
+
assert_path_exist File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
|
141
141
|
end
|
142
142
|
|
143
143
|
def test_build_extensions_with_gemhome_with_space
|
@@ -188,12 +188,12 @@ install:
|
|
188
188
|
@builder.build_extensions
|
189
189
|
end
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
191
|
+
assert_path_exist @spec.extension_dir
|
192
|
+
assert_path_exist @spec.gem_build_complete_path
|
193
|
+
assert_path_exist File.join @spec.extension_dir, 'gem_make.out'
|
194
|
+
assert_path_exist File.join @spec.extension_dir, 'a.rb'
|
195
|
+
assert_path_not_exist File.join @spec.gem_dir, 'lib', 'a.rb'
|
196
|
+
assert_path_not_exist File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
|
197
197
|
ensure
|
198
198
|
class << Gem
|
199
199
|
remove_method :install_extension_in_lib
|
@@ -210,7 +210,7 @@ install:
|
|
210
210
|
assert_equal '', @ui.output
|
211
211
|
assert_equal '', @ui.error
|
212
212
|
|
213
|
-
|
213
|
+
assert_path_not_exist File.join @spec.extension_dir, 'gem_make.out'
|
214
214
|
end
|
215
215
|
|
216
216
|
def test_build_extensions_rebuild_failure
|
@@ -219,13 +219,13 @@ install:
|
|
219
219
|
|
220
220
|
@spec.extensions << nil
|
221
221
|
|
222
|
-
|
222
|
+
assert_raise Gem::Ext::BuildError do
|
223
223
|
use_ui @ui do
|
224
224
|
@builder.build_extensions
|
225
225
|
end
|
226
226
|
end
|
227
227
|
|
228
|
-
|
228
|
+
assert_path_not_exist @spec.gem_build_complete_path
|
229
229
|
end
|
230
230
|
|
231
231
|
def test_build_extensions_extconf_bad
|
@@ -235,7 +235,7 @@ install:
|
|
235
235
|
|
236
236
|
FileUtils.mkdir_p @spec.gem_dir
|
237
237
|
|
238
|
-
e =
|
238
|
+
e = assert_raise Gem::Ext::BuildError do
|
239
239
|
use_ui @ui do
|
240
240
|
@builder.build_extensions
|
241
241
|
end
|
@@ -251,7 +251,7 @@ install:
|
|
251
251
|
assert_match %r{#{Regexp.escape Gem.ruby} .* extconf\.rb}, cmd_make_out
|
252
252
|
assert_match %r{: No such file}, cmd_make_out
|
253
253
|
|
254
|
-
|
254
|
+
assert_path_not_exist @spec.gem_build_complete_path
|
255
255
|
|
256
256
|
assert_equal cwd, Dir.pwd
|
257
257
|
end
|
@@ -261,7 +261,7 @@ install:
|
|
261
261
|
gem_make_out = File.join @spec.extension_dir, 'gem_make.out'
|
262
262
|
@spec.extensions << nil
|
263
263
|
|
264
|
-
e =
|
264
|
+
e = assert_raise Gem::Ext::BuildError do
|
265
265
|
use_ui @ui do
|
266
266
|
@builder.build_extensions
|
267
267
|
end
|
@@ -273,7 +273,7 @@ install:
|
|
273
273
|
|
274
274
|
assert_equal "No builder for extension ''\n", File.read(gem_make_out)
|
275
275
|
|
276
|
-
|
276
|
+
assert_path_not_exist @spec.gem_build_complete_path
|
277
277
|
ensure
|
278
278
|
FileUtils.rm_f gem_make_out
|
279
279
|
end
|
@@ -308,7 +308,7 @@ install:
|
|
308
308
|
path = File.join @spec.gem_dir, "extconf_args"
|
309
309
|
|
310
310
|
assert_equal args.inspect, File.read(path).strip
|
311
|
-
|
311
|
+
assert_path_exist @spec.extension_dir
|
312
312
|
end
|
313
313
|
|
314
314
|
def test_initialize
|
@@ -7,13 +7,13 @@ class TestGemExtCmakeBuilder < Gem::TestCase
|
|
7
7
|
super
|
8
8
|
|
9
9
|
# Details: https://github.com/rubygems/rubygems/issues/1270#issuecomment-177368340
|
10
|
-
|
10
|
+
pend "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
|
11
11
|
|
12
12
|
begin
|
13
13
|
_, status = Open3.capture2e('cmake')
|
14
|
-
|
14
|
+
pend 'cmake not present' unless status.success?
|
15
15
|
rescue Errno::ENOENT
|
16
|
-
|
16
|
+
pend 'cmake not present'
|
17
17
|
end
|
18
18
|
|
19
19
|
@ext = File.join @tempdir, 'ext'
|
@@ -50,7 +50,7 @@ install (FILES test.txt DESTINATION bin)
|
|
50
50
|
def test_self_build_fail
|
51
51
|
output = []
|
52
52
|
|
53
|
-
error =
|
53
|
+
error = assert_raise Gem::InstallError do
|
54
54
|
Gem::Ext::CmakeBuilder.build nil, @dest_path, output, [], nil, @ext
|
55
55
|
end
|
56
56
|
|
@@ -17,7 +17,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_self_build
|
20
|
-
|
20
|
+
pend("test_self_build skipped on MS Windows (VC++)") if vc_windows?
|
21
21
|
|
22
22
|
File.open File.join(@ext, './configure'), 'w' do |configure|
|
23
23
|
configure.puts "#!/bin/sh\necho \"#{@makefile_body}\" > Makefile"
|
@@ -42,10 +42,10 @@ class TestGemExtConfigureBuilder < Gem::TestCase
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_self_build_fail
|
45
|
-
|
45
|
+
pend("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
|
46
46
|
output = []
|
47
47
|
|
48
|
-
error =
|
48
|
+
error = assert_raise Gem::InstallError do
|
49
49
|
Gem::Ext::ConfigureBuilder.build nil, @dest_path, output, [], nil, @ext
|
50
50
|
end
|
51
51
|
|
@@ -62,7 +62,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
|
|
62
62
|
|
63
63
|
def test_self_build_has_makefile
|
64
64
|
if vc_windows? && !nmake_found?
|
65
|
-
|
65
|
+
pend("test_self_build_has_makefile skipped - nmake not found")
|
66
66
|
end
|
67
67
|
|
68
68
|
File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
|
@@ -16,11 +16,11 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
16
16
|
|
17
17
|
def test_class_build
|
18
18
|
if java_platform?
|
19
|
-
|
19
|
+
pend("failing on jruby")
|
20
20
|
end
|
21
21
|
|
22
22
|
if vc_windows? && !nmake_found?
|
23
|
-
|
23
|
+
pend("test_class_build skipped - nmake not found")
|
24
24
|
end
|
25
25
|
|
26
26
|
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
|
@@ -41,11 +41,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
41
41
|
assert_contains_make_command '', output[7]
|
42
42
|
assert_contains_make_command 'install', output[10]
|
43
43
|
assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
|
44
|
+
assert_empty Dir.glob(File.join(@ext, '.gem.*'))
|
44
45
|
end
|
45
46
|
|
46
47
|
def test_class_build_rbconfig_make_prog
|
47
48
|
if java_platform?
|
48
|
-
|
49
|
+
pend("failing on jruby")
|
49
50
|
end
|
50
51
|
|
51
52
|
configure_args do
|
@@ -70,7 +71,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
70
71
|
ENV['MAKE'] = 'anothermake'
|
71
72
|
|
72
73
|
if java_platform?
|
73
|
-
|
74
|
+
pend("failing on jruby")
|
74
75
|
end
|
75
76
|
|
76
77
|
configure_args '' do
|
@@ -80,7 +81,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
80
81
|
|
81
82
|
output = []
|
82
83
|
|
83
|
-
|
84
|
+
assert_raise Gem::InstallError do
|
84
85
|
Gem::Ext::ExtConfBuilder.build 'extconf.rb', @dest_path, output, [], nil, @ext
|
85
86
|
end
|
86
87
|
|
@@ -93,7 +94,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
93
94
|
|
94
95
|
def test_class_build_extconf_fail
|
95
96
|
if vc_windows? && !nmake_found?
|
96
|
-
|
97
|
+
pend("test_class_build_extconf_fail skipped - nmake not found")
|
97
98
|
end
|
98
99
|
|
99
100
|
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
|
@@ -104,7 +105,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
104
105
|
|
105
106
|
output = []
|
106
107
|
|
107
|
-
error =
|
108
|
+
error = assert_raise Gem::InstallError do
|
108
109
|
Gem::Ext::ExtConfBuilder.build 'extconf.rb', @dest_path, output, [], nil, @ext
|
109
110
|
end
|
110
111
|
|
@@ -114,12 +115,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
114
115
|
assert_match(File.join(@dest_path, 'mkmf.log'), output[4])
|
115
116
|
assert_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
|
116
117
|
|
117
|
-
|
118
|
+
assert_path_exist File.join @dest_path, 'mkmf.log'
|
118
119
|
end
|
119
120
|
|
120
121
|
def test_class_build_extconf_success_without_warning
|
121
122
|
if vc_windows? && !nmake_found?
|
122
|
-
|
123
|
+
pend("test_class_build_extconf_fail skipped - nmake not found")
|
123
124
|
end
|
124
125
|
|
125
126
|
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
|
@@ -134,12 +135,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|
134
135
|
|
135
136
|
refute_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
|
136
137
|
|
137
|
-
|
138
|
+
assert_path_exist File.join @dest_path, 'mkmf.log'
|
138
139
|
end
|
139
140
|
|
140
141
|
def test_class_build_unconventional
|
141
142
|
if vc_windows? && !nmake_found?
|
142
|
-
|
143
|
+
pend("test_class_build skipped - nmake not found")
|
143
144
|
end
|
144
145
|
|
145
146
|
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
|
@@ -180,7 +181,7 @@ end
|
|
180
181
|
|
181
182
|
def test_class_make
|
182
183
|
if vc_windows? && !nmake_found?
|
183
|
-
|
184
|
+
pend("test_class_make skipped - nmake not found")
|
184
185
|
end
|
185
186
|
|
186
187
|
output = []
|
@@ -202,7 +203,7 @@ end
|
|
202
203
|
end
|
203
204
|
|
204
205
|
def test_class_make_no_Makefile
|
205
|
-
error =
|
206
|
+
error = assert_raise Gem::InstallError do
|
206
207
|
Gem::Ext::ExtConfBuilder.make @ext, ['output'], @ext
|
207
208
|
end
|
208
209
|
|
@@ -90,7 +90,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|
90
90
|
output = []
|
91
91
|
|
92
92
|
build_rake_in(false) do |rake|
|
93
|
-
error =
|
93
|
+
error = assert_raise Gem::InstallError do
|
94
94
|
Gem::Ext::RakeBuilder.build "mkrf_conf.rb", @dest_path, output, [], nil, @ext
|
95
95
|
end
|
96
96
|
|
@@ -35,8 +35,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
35
35
|
"http://rubygems.engineyard.com" => "EYKEY",
|
36
36
|
}
|
37
37
|
|
38
|
-
FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
|
39
|
-
|
40
38
|
File.open Gem.configuration.credentials_path, 'w' do |f|
|
41
39
|
f.write keys.to_yaml
|
42
40
|
end
|
@@ -50,7 +48,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
50
48
|
|
51
49
|
def test_api_key
|
52
50
|
keys = { :rubygems_api_key => 'KEY' }
|
53
|
-
FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
|
54
51
|
|
55
52
|
File.open Gem.configuration.credentials_path, 'w' do |f|
|
56
53
|
f.write keys.to_yaml
|
@@ -63,7 +60,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
63
60
|
|
64
61
|
def test_api_key_override
|
65
62
|
keys = { :rubygems_api_key => 'KEY', :other => 'OTHER' }
|
66
|
-
FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
|
67
63
|
|
68
64
|
File.open Gem.configuration.credentials_path, 'w' do |f|
|
69
65
|
f.write keys.to_yaml
|
@@ -101,7 +97,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
101
97
|
assert @fetcher.last_request["authorization"]
|
102
98
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
103
99
|
|
104
|
-
credentials =
|
100
|
+
credentials = load_yaml_file Gem.configuration.credentials_path
|
105
101
|
assert_equal api_key, credentials[:rubygems_api_key]
|
106
102
|
end
|
107
103
|
|
@@ -115,7 +111,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
115
111
|
assert @fetcher.last_request["authorization"]
|
116
112
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
117
113
|
|
118
|
-
credentials =
|
114
|
+
credentials = load_yaml_file Gem.configuration.credentials_path
|
119
115
|
assert_equal api_key, credentials['http://example.com']
|
120
116
|
end
|
121
117
|
|
@@ -129,7 +125,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
129
125
|
assert @fetcher.last_request["authorization"]
|
130
126
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
131
127
|
|
132
|
-
credentials =
|
128
|
+
credentials = load_yaml_file Gem.configuration.credentials_path
|
133
129
|
assert_equal api_key, credentials[:rubygems_api_key]
|
134
130
|
end
|
135
131
|
|
@@ -142,7 +138,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
142
138
|
assert @fetcher.last_request["authorization"]
|
143
139
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
144
140
|
|
145
|
-
credentials =
|
141
|
+
credentials = load_yaml_file Gem.configuration.credentials_path
|
146
142
|
assert_equal api_key, credentials['http://example.com']
|
147
143
|
end
|
148
144
|
|
@@ -168,7 +164,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
168
164
|
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
|
169
165
|
other_api_key = 'f46dbb18bb6a9c97cdc61b5b85c186a17403cdcbf'
|
170
166
|
|
171
|
-
FileUtils.mkdir_p File.dirname(Gem.configuration.credentials_path)
|
172
167
|
File.open Gem.configuration.credentials_path, 'w' do |f|
|
173
168
|
f.write Hash[:other_api_key, other_api_key].to_yaml
|
174
169
|
end
|
@@ -177,13 +172,13 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
177
172
|
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
|
178
173
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
179
174
|
|
180
|
-
credentials =
|
175
|
+
credentials = load_yaml_file Gem.configuration.credentials_path
|
181
176
|
assert_equal api_key, credentials[:rubygems_api_key]
|
182
177
|
assert_equal other_api_key, credentials[:other_api_key]
|
183
178
|
end
|
184
179
|
|
185
180
|
def test_sign_in_with_bad_credentials
|
186
|
-
|
181
|
+
assert_raise Gem::MockGemUi::TermError do
|
187
182
|
util_sign_in ['Access Denied.', 403, 'Forbidden']
|
188
183
|
end
|
189
184
|
|
@@ -209,7 +204,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
209
204
|
def test_sign_in_with_incorrect_otp_code
|
210
205
|
response = "You have enabled multifactor authentication but your request doesn't have the correct OTP code. Please check it and retry."
|
211
206
|
|
212
|
-
|
207
|
+
assert_raise Gem::MockGemUi::TermError do
|
213
208
|
util_sign_in [response, 401, 'Unauthorized'], nil, [], "111111\n"
|
214
209
|
end
|
215
210
|
|
@@ -246,7 +241,6 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
246
241
|
|
247
242
|
def test_verify_api_key
|
248
243
|
keys = {:other => 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'}
|
249
|
-
FileUtils.mkdir_p File.dirname(Gem.configuration.credentials_path)
|
250
244
|
File.open Gem.configuration.credentials_path, 'w' do |f|
|
251
245
|
f.write keys.to_yaml
|
252
246
|
end
|
@@ -257,7 +251,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
257
251
|
end
|
258
252
|
|
259
253
|
def test_verify_missing_api_key
|
260
|
-
|
254
|
+
assert_raise Gem::MockGemUi::TermError do
|
261
255
|
@cmd.verify_api_key :missing
|
262
256
|
end
|
263
257
|
end
|
@@ -92,7 +92,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def test_security_policy
|
95
|
-
|
95
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL
|
96
96
|
|
97
97
|
@cmd.handle_options %w[-P HighSecurity]
|
98
98
|
|
@@ -100,11 +100,11 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def test_security_policy_unknown
|
103
|
-
|
103
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL
|
104
104
|
|
105
105
|
@cmd.add_install_update_options
|
106
106
|
|
107
|
-
e =
|
107
|
+
e = assert_raise OptionParser::InvalidArgument do
|
108
108
|
@cmd.handle_options %w[-P UnknownSecurity]
|
109
109
|
end
|
110
110
|
assert_includes e.message, "UnknownSecurity"
|
@@ -124,8 +124,8 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
|
|
124
124
|
|
125
125
|
@installer = Gem::Installer.at @gem, @cmd.options
|
126
126
|
@installer.install
|
127
|
-
|
128
|
-
|
127
|
+
assert_path_exist File.join(Gem.user_dir, 'gems')
|
128
|
+
assert_path_exist File.join(Gem.user_dir, 'gems', @spec.full_name)
|
129
129
|
end
|
130
130
|
|
131
131
|
def test_user_install_disabled_read_only
|
@@ -137,9 +137,9 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
|
|
137
137
|
@gem = @spec.cache_file
|
138
138
|
|
139
139
|
if win_platform?
|
140
|
-
|
140
|
+
pend('test_user_install_disabled_read_only test skipped on MS Windows')
|
141
141
|
elsif Process.uid.zero?
|
142
|
-
|
142
|
+
pend('test_user_install_disabled_read_only test skipped in root privilege')
|
143
143
|
else
|
144
144
|
@cmd.handle_options %w[--no-user-install]
|
145
145
|
|
@@ -150,7 +150,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
|
|
150
150
|
|
151
151
|
Gem.use_paths @gemhome, @userhome
|
152
152
|
|
153
|
-
|
153
|
+
assert_raise(Gem::FilePermissionError) do
|
154
154
|
Gem::Installer.at(@gem, @cmd.options).install
|
155
155
|
end
|
156
156
|
end
|
@@ -169,7 +169,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
|
|
169
169
|
|
170
170
|
def test_vendor_missing
|
171
171
|
vendordir(nil) do
|
172
|
-
e =
|
172
|
+
e = assert_raise OptionParser::InvalidOption do
|
173
173
|
@cmd.handle_options %w[--vendor]
|
174
174
|
end
|
175
175
|
|