rubygems-update 3.1.0.pre3 → 3.1.4
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/.bundle/config +2 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +8 -0
- data/Gemfile.lock +43 -0
- data/History.txt +97 -2
- data/Manifest.txt +21 -3
- data/README.md +4 -4
- data/Rakefile +11 -10
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +56 -3
- data/bundler/lib/bundler.rb +0 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -0
- data/bundler/lib/bundler/cli.rb +1 -1
- data/bundler/lib/bundler/cli/config.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +3 -2
- data/bundler/lib/bundler/cli/update.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +2 -2
- data/bundler/lib/bundler/fetcher/downloader.rb +1 -1
- data/bundler/lib/bundler/fetcher/index.rb +1 -1
- data/bundler/lib/bundler/friendly_errors.rb +1 -1
- data/bundler/lib/bundler/gem_helper.rb +13 -12
- data/bundler/lib/bundler/inline.rb +36 -31
- data/bundler/lib/bundler/lazy_specification.rb +0 -1
- data/bundler/lib/bundler/mirror.rb +3 -3
- data/bundler/lib/bundler/plugin/api/source.rb +2 -4
- data/bundler/lib/bundler/remote_specification.rb +0 -2
- data/bundler/lib/bundler/rubygems_integration.rb +15 -13
- data/bundler/lib/bundler/settings.rb +7 -4
- data/bundler/lib/bundler/setup.rb +5 -0
- data/bundler/lib/bundler/source/git.rb +5 -5
- data/bundler/lib/bundler/source/git/git_proxy.rb +3 -2
- data/bundler/lib/bundler/source/rubygems.rb +3 -3
- data/bundler/lib/bundler/source/rubygems/remote.rb +1 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +7 -3
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +3 -3
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +26 -48
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +7 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +10 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +29 -19
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +13 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +8 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +17 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/bundler/lib/bundler/vendored_uri.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.1 +1 -1
- data/bundler/man/bundle-add.1.txt +1 -1
- data/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/man/bundle-binstubs.1.txt +1 -1
- data/bundler/man/bundle-cache.1 +1 -1
- data/bundler/man/bundle-cache.1.txt +1 -1
- data/bundler/man/bundle-check.1 +1 -1
- data/bundler/man/bundle-check.1.txt +1 -1
- data/bundler/man/bundle-clean.1 +1 -1
- data/bundler/man/bundle-clean.1.txt +1 -1
- data/bundler/man/bundle-config.1 +1 -1
- data/bundler/man/bundle-config.1.txt +1 -1
- data/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/man/bundle-doctor.1.txt +1 -1
- data/bundler/man/bundle-exec.1 +1 -1
- data/bundler/man/bundle-exec.1.txt +1 -1
- data/bundler/man/bundle-gem.1 +1 -1
- data/bundler/man/bundle-gem.1.txt +1 -1
- data/bundler/man/bundle-info.1 +1 -1
- data/bundler/man/bundle-info.1.txt +1 -1
- data/bundler/man/bundle-init.1 +1 -1
- data/bundler/man/bundle-init.1.txt +1 -1
- data/bundler/man/bundle-inject.1 +1 -1
- data/bundler/man/bundle-inject.1.txt +1 -1
- data/bundler/man/bundle-install.1 +1 -1
- data/bundler/man/bundle-install.1.txt +1 -1
- data/bundler/man/bundle-list.1 +1 -1
- data/bundler/man/bundle-list.1.txt +1 -1
- data/bundler/man/bundle-lock.1 +1 -1
- data/bundler/man/bundle-lock.1.txt +1 -1
- data/bundler/man/bundle-open.1 +1 -1
- data/bundler/man/bundle-open.1.txt +1 -1
- data/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/man/bundle-outdated.1.txt +1 -1
- data/bundler/man/bundle-platform.1 +1 -1
- data/bundler/man/bundle-platform.1.txt +1 -1
- data/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/man/bundle-pristine.1.txt +1 -1
- data/bundler/man/bundle-remove.1 +1 -1
- data/bundler/man/bundle-remove.1.txt +1 -1
- data/bundler/man/bundle-show.1 +1 -1
- data/bundler/man/bundle-show.1.txt +1 -1
- data/bundler/man/bundle-update.1 +1 -1
- data/bundler/man/bundle-update.1.txt +1 -1
- data/bundler/man/bundle-viz.1 +1 -1
- data/bundler/man/bundle-viz.1.txt +1 -1
- data/bundler/man/bundle.1 +1 -1
- data/bundler/man/bundle.1.txt +1 -1
- data/bundler/man/gemfile.5 +1 -1
- data/bundler/man/gemfile.5.txt +1 -1
- data/lib/rubygems.rb +64 -47
- data/lib/rubygems/basic_specification.rb +1 -1
- data/lib/rubygems/command.rb +29 -7
- data/lib/rubygems/commands/generate_index_command.rb +3 -0
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +30 -15
- data/lib/rubygems/commands/sources_command.rb +17 -3
- data/lib/rubygems/commands/uninstall_command.rb +1 -1
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/core_ext/kernel_warn.rb +8 -4
- data/lib/rubygems/ext/builder.rb +4 -2
- data/lib/rubygems/remote_fetcher.rb +20 -31
- data/lib/rubygems/request.rb +2 -0
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/resolver/api_set.rb +1 -1
- data/lib/rubygems/resolver/api_specification.rb +1 -1
- data/lib/rubygems/server.rb +1 -1
- data/lib/rubygems/source.rb +7 -1
- data/lib/rubygems/source_list.rb +2 -0
- data/lib/rubygems/specification.rb +12 -8
- data/lib/rubygems/specification_policy.rb +53 -30
- data/lib/rubygems/test_case.rb +60 -0
- data/lib/rubygems/uri_formatter.rb +0 -1
- data/lib/rubygems/uri_parser.rb +36 -0
- data/lib/rubygems/uri_parsing.rb +23 -0
- data/lib/rubygems/util.rb +7 -1
- data/lib/rubygems/version.rb +1 -1
- data/rubygems-update.gemspec +1 -8
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +14 -0
- data/test/rubygems/test_gem.rb +90 -46
- data/test/rubygems/test_gem_command.rb +38 -9
- data/test/rubygems/test_gem_commands_build_command.rb +18 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +37 -1
- data/test/rubygems/test_gem_commands_help_command.rb +1 -6
- data/test/rubygems/test_gem_commands_server_command.rb +6 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +56 -10
- data/test/rubygems/test_gem_commands_sources_command.rb +113 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -0
- data/test/rubygems/test_gem_gem_runner.rb +3 -1
- data/test/rubygems/test_gem_indexer.rb +1 -1
- data/test/rubygems/test_gem_installer.rb +10 -23
- data/test/rubygems/test_gem_package.rb +3 -8
- data/test/rubygems/test_gem_package_tar_writer.rb +5 -0
- data/test/rubygems/test_gem_request_set.rb +52 -0
- data/test/rubygems/test_gem_source.rb +14 -0
- data/test/rubygems/test_gem_specification.rb +74 -54
- data/test/rubygems/test_gem_stub_specification.rb +0 -1
- data/test/rubygems/test_project_sanity.rb +0 -43
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +41 -42
- data/util/bisect +0 -21
- data/util/ci.sh +1 -1
- data/util/update_changelog.rb +7 -10
- metadata +27 -93
- data/bundler/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
@@ -8,6 +8,11 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
8
8
|
def setup
|
9
9
|
super
|
10
10
|
|
11
|
+
# Setting `@default_source_date_epoch` to `nil` effectively resets the
|
12
|
+
# value used for `Gem.source_date_epoch` whenever `$SOURCE_DATE_EPOCH`
|
13
|
+
# is not set.
|
14
|
+
Gem.instance_variable_set(:'@default_source_date_epoch', nil)
|
15
|
+
|
11
16
|
@data = 'abcde12345'
|
12
17
|
@io = TempIO.new
|
13
18
|
@tar_writer = Gem::Package::TarWriter.new @io
|
@@ -183,6 +183,58 @@ DEPENDENCIES
|
|
183
183
|
assert_path_exists File.join @gemhome, 'specifications', 'b-1.gemspec'
|
184
184
|
end
|
185
185
|
|
186
|
+
def test_install_from_gemdeps_complex_dependencies
|
187
|
+
quick_gem("z", 1)
|
188
|
+
quick_gem("z", "1.0.1")
|
189
|
+
quick_gem("z", "1.0.2")
|
190
|
+
quick_gem("z", "1.0.3")
|
191
|
+
quick_gem("z", 2)
|
192
|
+
|
193
|
+
spec_fetcher do |fetcher|
|
194
|
+
fetcher.download "z", 1
|
195
|
+
end
|
196
|
+
|
197
|
+
rs = Gem::RequestSet.new
|
198
|
+
installed = []
|
199
|
+
|
200
|
+
File.open 'Gemfile.lock', 'w' do |io|
|
201
|
+
io.puts <<-LOCKFILE
|
202
|
+
GEM
|
203
|
+
remote: #{@gem_repo}
|
204
|
+
specs:
|
205
|
+
z (1)
|
206
|
+
|
207
|
+
PLATFORMS
|
208
|
+
#{Gem::Platform::RUBY}
|
209
|
+
|
210
|
+
DEPENDENCIES
|
211
|
+
z (~> 1.0, >= 1.0.1)
|
212
|
+
LOCKFILE
|
213
|
+
end
|
214
|
+
|
215
|
+
File.open 'testo.gemspec', 'w' do |io|
|
216
|
+
io.puts <<-LOCKFILE
|
217
|
+
Gem::Specification.new do |spec|
|
218
|
+
spec.name = 'testo'
|
219
|
+
spec.version = '1.0.0'
|
220
|
+
spec.add_dependency('z', '~> 1.0', '>= 1.0.1')
|
221
|
+
end
|
222
|
+
LOCKFILE
|
223
|
+
end
|
224
|
+
|
225
|
+
File.open 'Gemfile', 'w' do |io|
|
226
|
+
io.puts("gemspec")
|
227
|
+
end
|
228
|
+
|
229
|
+
rs.install_from_gemdeps :gemdeps => 'Gemfile' do |req, installer|
|
230
|
+
installed << req.full_name
|
231
|
+
end
|
232
|
+
|
233
|
+
assert_includes installed, 'z-1.0.3'
|
234
|
+
|
235
|
+
assert_path_exists File.join @gemhome, 'specifications', 'z-1.0.3.gemspec'
|
236
|
+
end
|
237
|
+
|
186
238
|
def test_install_from_gemdeps_version_mismatch
|
187
239
|
spec_fetcher do |fetcher|
|
188
240
|
fetcher.gem 'a', 2
|
@@ -235,4 +235,18 @@ class TestGemSource < Gem::TestCase
|
|
235
235
|
refute @source.update_cache?
|
236
236
|
end
|
237
237
|
|
238
|
+
def test_typo_squatting
|
239
|
+
rubygems_source = Gem::Source.new("https://rubgems.org")
|
240
|
+
assert rubygems_source.typo_squatting?("rubygems.org")
|
241
|
+
assert rubygems_source.typo_squatting?("rubyagems.org")
|
242
|
+
assert rubygems_source.typo_squatting?("rubyasgems.org")
|
243
|
+
refute rubygems_source.typo_squatting?("rubysertgems.org")
|
244
|
+
end
|
245
|
+
|
246
|
+
def test_typo_squatting_custom_distance_threshold
|
247
|
+
rubygems_source = Gem::Source.new("https://rubgems.org")
|
248
|
+
distance_threshold = 5
|
249
|
+
assert rubygems_source.typo_squatting?("rubysertgems.org", distance_threshold)
|
250
|
+
end
|
251
|
+
|
238
252
|
end
|
@@ -83,6 +83,11 @@ end
|
|
83
83
|
def setup
|
84
84
|
super
|
85
85
|
|
86
|
+
# Setting `@default_source_date_epoch` to `nil` effectively resets the
|
87
|
+
# value used for `Gem.source_date_epoch` whenever `$SOURCE_DATE_EPOCH`
|
88
|
+
# is not set.
|
89
|
+
Gem.instance_variable_set(:'@default_source_date_epoch', nil)
|
90
|
+
|
86
91
|
@a1 = util_spec 'a', '1' do |s|
|
87
92
|
s.executable = 'exec'
|
88
93
|
s.test_file = 'test/suite.rb'
|
@@ -126,8 +131,8 @@ end
|
|
126
131
|
def test_self_activate_ambiguous_direct
|
127
132
|
save_loaded_features do
|
128
133
|
a1 = util_spec "a", "1", "b" => "> 0"
|
129
|
-
b1 = util_spec("b", "1", { "c" => ">= 1" }, "lib/d.rb")
|
130
|
-
b2 = util_spec("b", "2", { "c" => ">= 2" }, "lib/d.rb")
|
134
|
+
b1 = util_spec("b", "1", { "c" => ">= 1" }, "lib/d#{$$}.rb")
|
135
|
+
b2 = util_spec("b", "2", { "c" => ">= 2" }, "lib/d#{$$}.rb")
|
131
136
|
c1 = util_spec "c", "1"
|
132
137
|
c2 = util_spec "c", "2"
|
133
138
|
|
@@ -138,7 +143,7 @@ end
|
|
138
143
|
assert_equal %w(a-1), loaded_spec_names
|
139
144
|
assert_equal ["b (> 0)"], unresolved_names
|
140
145
|
|
141
|
-
require "d"
|
146
|
+
require "d#{$$}"
|
142
147
|
|
143
148
|
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
144
149
|
assert_equal [], unresolved_names
|
@@ -176,8 +181,8 @@ end
|
|
176
181
|
a1 = util_spec "a", "1", "b" => "> 0"
|
177
182
|
b1 = util_spec "b", "1", "c" => ">= 1"
|
178
183
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
179
|
-
c1 = util_spec "c", "1", nil, "lib/d.rb"
|
180
|
-
c2 = util_spec "c", "2", nil, "lib/d.rb"
|
184
|
+
c1 = util_spec "c", "1", nil, "lib/d#{$$}.rb"
|
185
|
+
c2 = util_spec "c", "2", nil, "lib/d#{$$}.rb"
|
181
186
|
|
182
187
|
install_specs c1, c2, b1, b2, a1
|
183
188
|
|
@@ -185,7 +190,7 @@ end
|
|
185
190
|
assert_equal %w(a-1), loaded_spec_names
|
186
191
|
assert_equal ["b (> 0)"], unresolved_names
|
187
192
|
|
188
|
-
require "d"
|
193
|
+
require "d#{$$}"
|
189
194
|
|
190
195
|
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
191
196
|
assert_equal [], unresolved_names
|
@@ -198,8 +203,8 @@ end
|
|
198
203
|
a2 = util_spec "a", "2", "b" => "> 0"
|
199
204
|
b1 = util_spec "b", "1", "c" => ">= 1"
|
200
205
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
201
|
-
c1 = util_spec "c", "1", nil, "lib/d.rb"
|
202
|
-
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d.rb") # conflicts with a-2
|
206
|
+
c1 = util_spec "c", "1", nil, "lib/d#{$$}.rb"
|
207
|
+
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d#{$$}.rb") # conflicts with a-2
|
203
208
|
|
204
209
|
install_specs c1, b1, a1, a2, c2, b2
|
205
210
|
|
@@ -207,7 +212,7 @@ end
|
|
207
212
|
assert_equal %w(a-2), loaded_spec_names
|
208
213
|
assert_equal ["b (> 0)"], unresolved_names
|
209
214
|
|
210
|
-
require "d"
|
215
|
+
require "d#{$$}"
|
211
216
|
|
212
217
|
assert_equal %w(a-2 b-1 c-1), loaded_spec_names
|
213
218
|
assert_equal [], unresolved_names
|
@@ -221,7 +226,7 @@ end
|
|
221
226
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
222
227
|
c1 = util_spec "c", "1"
|
223
228
|
c2 = util_spec "c", "2"
|
224
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb"
|
229
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb"
|
225
230
|
|
226
231
|
install_specs d1, c1, c2, b1, b2, a1
|
227
232
|
|
@@ -229,7 +234,7 @@ end
|
|
229
234
|
assert_equal %w(a-1), loaded_spec_names
|
230
235
|
assert_equal ["b (> 0)"], unresolved_names
|
231
236
|
|
232
|
-
require "d"
|
237
|
+
require "d#{$$}"
|
233
238
|
|
234
239
|
assert_equal %w(a-1 d-1), loaded_spec_names
|
235
240
|
assert_equal ["b (> 0)"], unresolved_names
|
@@ -241,14 +246,14 @@ end
|
|
241
246
|
a1 = util_spec "a", "1", "b" => "> 0"
|
242
247
|
b1 = util_spec "b", "1", "c" => ">= 0" # unresolved
|
243
248
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
244
|
-
c1 = util_spec "c", "1", nil, "lib/c.rb" # 1st level
|
245
|
-
c2 = util_spec "c", "2", nil, "lib/c.rb"
|
249
|
+
c1 = util_spec "c", "1", nil, "lib/c#{$$}.rb" # 1st level
|
250
|
+
c2 = util_spec "c", "2", nil, "lib/c#{$$}.rb"
|
246
251
|
|
247
252
|
install_specs c1, c2, b1, b2, a1
|
248
253
|
|
249
254
|
a1.activate
|
250
255
|
|
251
|
-
require "c"
|
256
|
+
require "c#{$$}"
|
252
257
|
|
253
258
|
assert_equal %w(a-1 b-2 c-2), loaded_spec_names
|
254
259
|
end
|
@@ -261,14 +266,14 @@ end
|
|
261
266
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
262
267
|
c1 = util_spec "c", "1", "d" => ">= 0" # 1st level
|
263
268
|
c2 = util_spec "c", "2", "d" => ">= 0"
|
264
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
265
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
269
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
270
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
266
271
|
|
267
272
|
install_specs d1, d2, c1, c2, b1, b2, a1
|
268
273
|
|
269
274
|
a1.activate
|
270
275
|
|
271
|
-
require "d"
|
276
|
+
require "d#{$$}"
|
272
277
|
|
273
278
|
assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
|
274
279
|
end
|
@@ -281,15 +286,15 @@ end
|
|
281
286
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
282
287
|
c1 = util_spec "c", "1", "d" => "<= 2" # 1st level
|
283
288
|
c2 = util_spec "c", "2", "d" => "<= 2"
|
284
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
285
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
286
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
289
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
290
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
291
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
287
292
|
|
288
293
|
install_specs d1, d2, d3, c1, c2, b1, b2, a1
|
289
294
|
|
290
295
|
a1.activate
|
291
296
|
|
292
|
-
require "d"
|
297
|
+
require "d#{$$}"
|
293
298
|
|
294
299
|
assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
|
295
300
|
end
|
@@ -302,16 +307,16 @@ end
|
|
302
307
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
303
308
|
c1 = util_spec "c", "1", "d" => "<= 2" # 1st level
|
304
309
|
c2 = util_spec "c", "2", "d" => "<= 2"
|
305
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
306
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
307
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
308
|
-
e = util_spec "anti_d", "1", nil, "lib/d.rb"
|
310
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
311
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
312
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
313
|
+
e = util_spec "anti_d", "1", nil, "lib/d#{$$}.rb"
|
309
314
|
|
310
315
|
install_specs d1, d2, d3, e, c1, c2, b1, b2, a1
|
311
316
|
|
312
317
|
a1.activate
|
313
318
|
|
314
|
-
require "d"
|
319
|
+
require "d#{$$}"
|
315
320
|
|
316
321
|
assert_equal %w(a-1 b-2 c-2 d-2), loaded_spec_names
|
317
322
|
end
|
@@ -322,8 +327,8 @@ end
|
|
322
327
|
base = util_spec "0", "1", "A" => ">= 1"
|
323
328
|
a1 = util_spec "A", "1", {"c" => ">= 2", "b" => "> 0"}, "lib/a.rb"
|
324
329
|
a2 = util_spec "A", "2", {"c" => ">= 2", "b" => "> 0"}, "lib/a.rb"
|
325
|
-
b1 = util_spec "b", "1", {"c" => "= 1"}, "lib/d.rb"
|
326
|
-
b2 = util_spec "b", "2", {"c" => "= 2"}, "lib/d.rb"
|
330
|
+
b1 = util_spec "b", "1", {"c" => "= 1"}, "lib/d#{$$}.rb"
|
331
|
+
b2 = util_spec "b", "2", {"c" => "= 2"}, "lib/d#{$$}.rb"
|
327
332
|
c1 = util_spec "c", "1", {}, "lib/c.rb"
|
328
333
|
c2 = util_spec "c", "2", {}, "lib/c.rb"
|
329
334
|
c3 = util_spec "c", "3", {}, "lib/c.rb"
|
@@ -334,7 +339,7 @@ end
|
|
334
339
|
assert_equal %w(0-1), loaded_spec_names
|
335
340
|
assert_equal ["A (>= 1)"], unresolved_names
|
336
341
|
|
337
|
-
require "d"
|
342
|
+
require "d#{$$}"
|
338
343
|
|
339
344
|
assert_equal %w(0-1 A-2 b-2 c-2), loaded_spec_names
|
340
345
|
assert_equal [], unresolved_names
|
@@ -349,15 +354,15 @@ end
|
|
349
354
|
c1 = util_spec "c", "1", "d" => "<= 2" # 1st level
|
350
355
|
c2 = util_spec "c", "2", "d" => "<= 2"
|
351
356
|
c3 = util_spec "c", "3", "d" => "<= 3"
|
352
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
353
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
354
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
357
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
358
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
359
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
355
360
|
|
356
361
|
install_specs d1, d2, d3, c1, c2, c3, b1, b2, a1
|
357
362
|
|
358
363
|
a1.activate
|
359
364
|
|
360
|
-
require "d"
|
365
|
+
require "d#{$$}"
|
361
366
|
|
362
367
|
assert_includes [%w(a-1 b-2 c-3 d-2),%w(a-1 b-2 d-2)], loaded_spec_names
|
363
368
|
end
|
@@ -371,15 +376,15 @@ end
|
|
371
376
|
c1 = util_spec "xc", "1", "d" => "<= 3" # 1st level
|
372
377
|
c2 = util_spec "xc", "2", "d" => "<= 2"
|
373
378
|
c3 = util_spec "xc", "3", "d" => "<= 3"
|
374
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
375
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
376
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
379
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
380
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
381
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
377
382
|
|
378
383
|
install_specs d1, d2, d3, c1, c2, c3, b1, b2, a1
|
379
384
|
|
380
385
|
a1.activate
|
381
386
|
|
382
|
-
require "d"
|
387
|
+
require "d#{$$}"
|
383
388
|
|
384
389
|
assert_includes [%w(a-1 b-2 d-2 xc-3), %w(a-1 b-2 d-2)], loaded_spec_names
|
385
390
|
end
|
@@ -516,12 +521,12 @@ end
|
|
516
521
|
def test_self_activate_via_require_wtf
|
517
522
|
save_loaded_features do
|
518
523
|
a1 = util_spec "a", "1", "b" => "> 0", "d" => "> 0" # this
|
519
|
-
b1 = util_spec "b", "1", { "c" => ">= 1" }, "lib/b.rb"
|
520
|
-
b2 = util_spec "b", "2", { "c" => ">= 2" }, "lib/b.rb" # this
|
524
|
+
b1 = util_spec "b", "1", { "c" => ">= 1" }, "lib/b#{$$}.rb"
|
525
|
+
b2 = util_spec "b", "2", { "c" => ">= 2" }, "lib/b#{$$}.rb" # this
|
521
526
|
c1 = util_spec "c", "1"
|
522
527
|
c2 = util_spec "c", "2" # this
|
523
|
-
d1 = util_spec "d", "1", { "c" => "< 2" }, "lib/d.rb"
|
524
|
-
d2 = util_spec "d", "2", { "c" => "< 2" }, "lib/d.rb" # this
|
528
|
+
d1 = util_spec "d", "1", { "c" => "< 2" }, "lib/d#{$$}.rb"
|
529
|
+
d2 = util_spec "d", "2", { "c" => "< 2" }, "lib/d#{$$}.rb" # this
|
525
530
|
|
526
531
|
install_specs c1, c2, b1, b2, d1, d2, a1
|
527
532
|
|
@@ -530,10 +535,10 @@ end
|
|
530
535
|
assert_equal %w(a-1), loaded_spec_names
|
531
536
|
assert_equal ["b (> 0)", "d (> 0)"], unresolved_names
|
532
537
|
|
533
|
-
require "b"
|
538
|
+
require "b#{$$}"
|
534
539
|
|
535
540
|
e = assert_raises Gem::LoadError do
|
536
|
-
require "d"
|
541
|
+
require "d#{$$}"
|
537
542
|
end
|
538
543
|
|
539
544
|
assert_equal "unable to find a version of 'd' to activate", e.message
|
@@ -939,7 +944,7 @@ dependencies: []
|
|
939
944
|
assert_equal File.join(@tempdir, 'a-2.gemspec'), spec.loaded_from
|
940
945
|
end
|
941
946
|
|
942
|
-
if RUBY_VERSION < '2.7'
|
947
|
+
if RUBY_ENGINE == 'ruby' and RUBY_VERSION < '2.7'
|
943
948
|
def test_self_load_tainted
|
944
949
|
full_path = @a2.spec_file
|
945
950
|
write_file full_path do |io|
|
@@ -2287,7 +2292,7 @@ dependencies: []
|
|
2287
2292
|
|
2288
2293
|
def test_require_already_activated
|
2289
2294
|
save_loaded_features do
|
2290
|
-
a1 = util_spec "a", "1", nil, "lib/d.rb"
|
2295
|
+
a1 = util_spec "a", "1", nil, "lib/d#{$$}.rb"
|
2291
2296
|
|
2292
2297
|
install_specs a1 # , a2, b1, b2, c1, c2
|
2293
2298
|
|
@@ -2295,7 +2300,7 @@ dependencies: []
|
|
2295
2300
|
assert_equal %w(a-1), loaded_spec_names
|
2296
2301
|
assert_equal [], unresolved_names
|
2297
2302
|
|
2298
|
-
assert require "d"
|
2303
|
+
assert require "d#{$$}"
|
2299
2304
|
|
2300
2305
|
assert_equal %w(a-1), loaded_spec_names
|
2301
2306
|
assert_equal [], unresolved_names
|
@@ -2308,8 +2313,8 @@ dependencies: []
|
|
2308
2313
|
a2 = util_spec "a", "2", "b" => "> 0"
|
2309
2314
|
b1 = util_spec "b", "1", "c" => ">= 1"
|
2310
2315
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
2311
|
-
c1 = util_spec "c", "1", nil, "lib/d.rb"
|
2312
|
-
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d.rb") # conflicts with a-2
|
2316
|
+
c1 = util_spec "c", "1", nil, "lib/d#{$$}.rb"
|
2317
|
+
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d#{$$}.rb") # conflicts with a-2
|
2313
2318
|
|
2314
2319
|
install_specs c1, b1, a1, a2, c2, b2
|
2315
2320
|
|
@@ -2318,7 +2323,7 @@ dependencies: []
|
|
2318
2323
|
assert_equal %w(a-1 c-1), loaded_spec_names
|
2319
2324
|
assert_equal ["b (> 0)"], unresolved_names
|
2320
2325
|
|
2321
|
-
assert require "d"
|
2326
|
+
assert require "d#{$$}"
|
2322
2327
|
|
2323
2328
|
assert_equal %w(a-1 c-1), loaded_spec_names
|
2324
2329
|
assert_equal ["b (> 0)"], unresolved_names
|
@@ -2784,7 +2789,7 @@ end
|
|
2784
2789
|
add_runtime_dependency 'l', '~> 1.2', '> 1.2.3'
|
2785
2790
|
#{w}: open-ended dependency on o (>= 0) is not recommended
|
2786
2791
|
use a bounded requirement, such as '~> x.y'
|
2787
|
-
#{w}: See
|
2792
|
+
#{w}: See https://guides.rubygems.org/specification-reference/ for help
|
2788
2793
|
EXPECTED
|
2789
2794
|
|
2790
2795
|
assert_equal expected, @ui.error, 'warning'
|
@@ -2816,7 +2821,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2816
2821
|
end
|
2817
2822
|
|
2818
2823
|
assert_equal <<-EXPECTED, @ui.error
|
2819
|
-
#{w}: See
|
2824
|
+
#{w}: See https://guides.rubygems.org/specification-reference/ for help
|
2820
2825
|
EXPECTED
|
2821
2826
|
end
|
2822
2827
|
end
|
@@ -2927,7 +2932,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2927
2932
|
end
|
2928
2933
|
end
|
2929
2934
|
|
2930
|
-
assert_match 'See
|
2935
|
+
assert_match 'See https://guides.rubygems.org/specification-reference/ for help', @ui.error
|
2931
2936
|
end
|
2932
2937
|
|
2933
2938
|
def test_validate_executables
|
@@ -3100,7 +3105,7 @@ Please report a bug if this causes problems.
|
|
3100
3105
|
|
3101
3106
|
assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message
|
3102
3107
|
|
3103
|
-
@a1.homepage = '
|
3108
|
+
@a1.homepage = 'https://rubygems.org/'
|
3104
3109
|
assert_equal true, @a1.validate
|
3105
3110
|
|
3106
3111
|
@a1.homepage = 'https://rubygems.org'
|
@@ -3123,6 +3128,21 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
|
3123
3128
|
warning
|
3124
3129
|
end
|
3125
3130
|
|
3131
|
+
def test_removed_methods
|
3132
|
+
assert_equal Gem::Specification::REMOVED_METHODS, [:rubyforge_project=]
|
3133
|
+
end
|
3134
|
+
|
3135
|
+
def test_validate_removed_rubyforge_project
|
3136
|
+
util_setup_validate
|
3137
|
+
|
3138
|
+
use_ui @ui do
|
3139
|
+
@a1.rubyforge_project = 'invalid-attribute'
|
3140
|
+
@a1.validate
|
3141
|
+
end
|
3142
|
+
|
3143
|
+
assert_match "rubyforge_project= is deprecated", @ui.error
|
3144
|
+
end
|
3145
|
+
|
3126
3146
|
def test_validate_license_values
|
3127
3147
|
util_setup_validate
|
3128
3148
|
|
@@ -3430,7 +3450,7 @@ Did you mean 'Ruby'?
|
|
3430
3450
|
@a1.validate
|
3431
3451
|
end
|
3432
3452
|
|
3433
|
-
assert_match 'See
|
3453
|
+
assert_match 'See https://guides.rubygems.org/specification-reference/ for help', @ui.error
|
3434
3454
|
end
|
3435
3455
|
|
3436
3456
|
def test_version
|
@@ -4,7 +4,6 @@ require "rubygems/stub_specification"
|
|
4
4
|
|
5
5
|
class TestStubSpecification < Gem::TestCase
|
6
6
|
|
7
|
-
SPECIFICATIONS = File.expand_path(File.join("..", "specifications"), __FILE__)
|
8
7
|
FOO = File.join SPECIFICATIONS, "foo-0.0.1-x86-mswin32.gemspec"
|
9
8
|
BAR = File.join SPECIFICATIONS, "bar-0.0.2.gemspec"
|
10
9
|
|