rubygems-update 3.3.26 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/CONTRIBUTING.md +24 -1
- data/Manifest.txt +30 -27
- data/POLICIES.md +10 -8
- data/README.md +2 -2
- data/bin/gem +1 -4
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +59 -0
- data/bundler/README.md +2 -2
- data/bundler/bundler.gemspec +2 -2
- data/bundler/exe/bundle +1 -4
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/add.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/common.rb +1 -0
- data/bundler/lib/bundler/cli/console.rb +2 -2
- data/bundler/lib/bundler/cli/doctor.rb +4 -6
- data/bundler/lib/bundler/cli/gem.rb +62 -40
- data/bundler/lib/bundler/cli/install.rb +2 -3
- data/bundler/lib/bundler/cli/lock.rb +8 -5
- data/bundler/lib/bundler/cli/outdated.rb +1 -3
- data/bundler/lib/bundler/cli/viz.rb +1 -1
- data/bundler/lib/bundler/cli.rb +43 -2
- data/bundler/lib/bundler/compact_index_client/cache.rb +1 -1
- data/bundler/lib/bundler/compact_index_client/updater.rb +40 -39
- data/bundler/lib/bundler/constants.rb +1 -1
- data/bundler/lib/bundler/definition.rb +61 -31
- data/bundler/lib/bundler/dependency.rb +12 -11
- data/bundler/lib/bundler/digest.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +1 -1
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/environment_preserver.rb +1 -0
- data/bundler/lib/bundler/errors.rb +1 -11
- data/bundler/lib/bundler/fetcher/compact_index.rb +9 -11
- data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +2 -5
- data/bundler/lib/bundler/fetcher.rb +2 -6
- data/bundler/lib/bundler/force_platform.rb +18 -0
- data/bundler/lib/bundler/friendly_errors.rb +0 -3
- data/bundler/lib/bundler/gem_version_promoter.rb +52 -86
- data/bundler/lib/bundler/graph.rb +3 -3
- data/bundler/lib/bundler/index.rb +5 -13
- data/bundler/lib/bundler/injector.rb +1 -1
- data/bundler/lib/bundler/inline.rb +2 -2
- data/bundler/lib/bundler/installer/parallel_installer.rb +0 -31
- data/bundler/lib/bundler/installer.rb +6 -16
- data/bundler/lib/bundler/lazy_specification.rb +5 -1
- data/bundler/lib/bundler/lockfile_parser.rb +5 -5
- 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 -1
- data/bundler/lib/bundler/man/bundle-console.1 +1 -1
- 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 +27 -37
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +5 -5
- data/bundler/lib/bundler/man/bundle-help.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 -30
- data/bundler/lib/bundler/man/bundle-install.1.ronn +0 -29
- 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 +2 -2
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.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-version.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/mirror.rb +5 -7
- data/bundler/lib/bundler/plugin/index.rb +4 -4
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +0 -4
- data/bundler/lib/bundler/resolver/base.rb +7 -11
- data/bundler/lib/bundler/resolver/candidate.rb +92 -0
- data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
- data/bundler/lib/bundler/resolver/package.rb +63 -0
- data/bundler/lib/bundler/resolver/root.rb +25 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +26 -36
- data/bundler/lib/bundler/resolver.rb +294 -277
- data/bundler/lib/bundler/rubygems_ext.rb +11 -6
- data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -2
- data/bundler/lib/bundler/rubygems_integration.rb +1 -9
- data/bundler/lib/bundler/runtime.rb +1 -5
- data/bundler/lib/bundler/settings.rb +0 -6
- data/bundler/lib/bundler/shared_helpers.rb +1 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +193 -67
- data/bundler/lib/bundler/source/git.rb +15 -17
- data/bundler/lib/bundler/source/metadata.rb +0 -1
- data/bundler/lib/bundler/source/path/installer.rb +1 -22
- data/bundler/lib/bundler/source/path.rb +5 -5
- data/bundler/lib/bundler/source/rubygems.rb +13 -67
- data/bundler/lib/bundler/source_list.rb +8 -2
- data/bundler/lib/bundler/spec_set.rb +7 -9
- data/bundler/lib/bundler/templates/Executable +1 -1
- data/bundler/lib/bundler/templates/Executable.bundler +4 -9
- data/bundler/lib/bundler/templates/Executable.standalone +2 -0
- data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +6 -4
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -1
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +0 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +10 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
- data/bundler/lib/bundler/ui/shell.rb +35 -12
- data/bundler/lib/bundler/ui/silent.rb +21 -5
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
- data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +64 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +27 -7
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +13 -7
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +10 -5
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +3 -2
- data/bundler/lib/bundler/vendored_persistent.rb +1 -33
- data/bundler/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
- data/bundler/lib/bundler/version.rb +5 -1
- data/bundler/lib/bundler/worker.rb +5 -7
- data/bundler/lib/bundler.rb +20 -64
- data/lib/rubygems/command_manager.rb +2 -2
- data/lib/rubygems/commands/fetch_command.rb +1 -1
- data/lib/rubygems/commands/install_command.rb +7 -3
- data/lib/rubygems/commands/rdoc_command.rb +3 -2
- data/lib/rubygems/commands/setup_command.rb +2 -2
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +1 -7
- data/lib/rubygems/config_file.rb +33 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +1 -2
- data/lib/rubygems/defaults.rb +15 -1
- data/lib/rubygems/dependency.rb +4 -1
- data/lib/rubygems/dependency_installer.rb +24 -24
- data/lib/rubygems/exceptions.rb +1 -3
- data/lib/rubygems/ext/builder.rb +3 -3
- data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +9 -5
- data/lib/rubygems/ext/cargo_builder.rb +15 -20
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -0
- data/lib/rubygems/indexer.rb +1 -1
- data/lib/rubygems/installer.rb +5 -5
- data/lib/rubygems/optparse/lib/optparse.rb +20 -15
- data/lib/rubygems/package/tar_header.rb +11 -11
- data/lib/rubygems/platform.rb +0 -2
- data/lib/rubygems/request_set/gem_dependency_api.rb +104 -104
- data/lib/rubygems/requirement.rb +7 -7
- data/lib/rubygems/resolver/installer_set.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +32 -26
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/security/policies.rb +40 -40
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/security.rb +3 -16
- data/lib/rubygems/source.rb +2 -2
- data/lib/rubygems/specification.rb +37 -49
- data/lib/rubygems/specification_policy.rb +14 -0
- data/lib/rubygems/stub_specification.rb +2 -2
- data/lib/rubygems/text.rb +1 -1
- data/lib/rubygems/tsort/lib/tsort.rb +308 -310
- data/lib/rubygems/update_suggestion.rb +69 -0
- data/lib/rubygems/util.rb +1 -5
- data/lib/rubygems/validator.rb +1 -1
- data/lib/rubygems.rb +8 -3
- data/rubygems-update.gemspec +2 -2
- data/test/rubygems/helper.rb +7 -3
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_exit.rb +6 -0
- data/test/rubygems/test_gem.rb +4 -9
- data/test/rubygems/test_gem_bundler_version_finder.rb +2 -1
- data/test/rubygems/test_gem_command_manager.rb +1 -1
- data/test/rubygems/test_gem_commands_install_command.rb +19 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +1 -8
- data/test/rubygems/test_gem_commands_update_command.rb +6 -6
- data/test/rubygems/test_gem_config_file.rb +1 -1
- data/test/rubygems/test_gem_dependency.rb +2 -0
- data/test/rubygems/test_gem_ext_builder.rb +3 -3
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +22 -32
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +22 -32
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +12 -0
- data/test/rubygems/test_gem_ext_cargo_builder.rb +22 -27
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +16 -16
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -10
- data/test/rubygems/test_gem_indexer.rb +39 -20
- data/test/rubygems/test_gem_installer.rb +68 -2
- data/test/rubygems/test_gem_package_tar_header.rb +13 -13
- data/test/rubygems/test_gem_platform.rb +59 -60
- data/test/rubygems/test_gem_remote_fetcher.rb +4 -4
- data/test/rubygems/test_gem_request_set.rb +2 -2
- data/test/rubygems/test_gem_requirement.rb +1 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +12 -12
- data/test/rubygems/test_gem_resolver_api_specification.rb +19 -19
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
- data/test/rubygems/test_gem_security_policy.rb +10 -10
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_specification.rb +50 -37
- data/test/rubygems/test_gem_uninstaller.rb +1 -1
- data/test/rubygems/test_gem_update_suggestion.rb +208 -0
- data/test/rubygems/test_kernel.rb +10 -8
- data/test/rubygems/test_require.rb +70 -55
- metadata +34 -31
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/bundler/lib/bundler/vendor/molinillo/LICENSE +0 -9
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -149
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
- data/bundler/lib/bundler/vendored_molinillo.rb +0 -4
- data/bundler/lib/bundler/version_ranges.rb +0 -122
@@ -6,12 +6,12 @@ module Gem::Security
|
|
6
6
|
|
7
7
|
NoSecurity = Policy.new(
|
8
8
|
"No Security",
|
9
|
-
:verify_data
|
10
|
-
:verify_signer
|
11
|
-
:verify_chain
|
12
|
-
:verify_root
|
13
|
-
:only_trusted
|
14
|
-
:only_signed
|
9
|
+
:verify_data => false,
|
10
|
+
:verify_signer => false,
|
11
|
+
:verify_chain => false,
|
12
|
+
:verify_root => false,
|
13
|
+
:only_trusted => false,
|
14
|
+
:only_signed => false
|
15
15
|
)
|
16
16
|
|
17
17
|
##
|
@@ -24,12 +24,12 @@ module Gem::Security
|
|
24
24
|
|
25
25
|
AlmostNoSecurity = Policy.new(
|
26
26
|
"Almost No Security",
|
27
|
-
:verify_data
|
28
|
-
:verify_signer
|
29
|
-
:verify_chain
|
30
|
-
:verify_root
|
31
|
-
:only_trusted
|
32
|
-
:only_signed
|
27
|
+
:verify_data => true,
|
28
|
+
:verify_signer => false,
|
29
|
+
:verify_chain => false,
|
30
|
+
:verify_root => false,
|
31
|
+
:only_trusted => false,
|
32
|
+
:only_signed => false
|
33
33
|
)
|
34
34
|
|
35
35
|
##
|
@@ -41,12 +41,12 @@ module Gem::Security
|
|
41
41
|
|
42
42
|
LowSecurity = Policy.new(
|
43
43
|
"Low Security",
|
44
|
-
:verify_data
|
45
|
-
:verify_signer
|
46
|
-
:verify_chain
|
47
|
-
:verify_root
|
48
|
-
:only_trusted
|
49
|
-
:only_signed
|
44
|
+
:verify_data => true,
|
45
|
+
:verify_signer => true,
|
46
|
+
:verify_chain => false,
|
47
|
+
:verify_root => false,
|
48
|
+
:only_trusted => false,
|
49
|
+
:only_signed => false
|
50
50
|
)
|
51
51
|
|
52
52
|
##
|
@@ -60,12 +60,12 @@ module Gem::Security
|
|
60
60
|
|
61
61
|
MediumSecurity = Policy.new(
|
62
62
|
"Medium Security",
|
63
|
-
:verify_data
|
64
|
-
:verify_signer
|
65
|
-
:verify_chain
|
66
|
-
:verify_root
|
67
|
-
:only_trusted
|
68
|
-
:only_signed
|
63
|
+
:verify_data => true,
|
64
|
+
:verify_signer => true,
|
65
|
+
:verify_chain => true,
|
66
|
+
:verify_root => true,
|
67
|
+
:only_trusted => true,
|
68
|
+
:only_signed => false
|
69
69
|
)
|
70
70
|
|
71
71
|
##
|
@@ -79,12 +79,12 @@ module Gem::Security
|
|
79
79
|
|
80
80
|
HighSecurity = Policy.new(
|
81
81
|
"High Security",
|
82
|
-
:verify_data
|
83
|
-
:verify_signer
|
84
|
-
:verify_chain
|
85
|
-
:verify_root
|
86
|
-
:only_trusted
|
87
|
-
:only_signed
|
82
|
+
:verify_data => true,
|
83
|
+
:verify_signer => true,
|
84
|
+
:verify_chain => true,
|
85
|
+
:verify_root => true,
|
86
|
+
:only_trusted => true,
|
87
|
+
:only_signed => true
|
88
88
|
)
|
89
89
|
|
90
90
|
##
|
@@ -92,23 +92,23 @@ module Gem::Security
|
|
92
92
|
|
93
93
|
SigningPolicy = Policy.new(
|
94
94
|
"Signing Policy",
|
95
|
-
:verify_data
|
96
|
-
:verify_signer
|
97
|
-
:verify_chain
|
98
|
-
:verify_root
|
99
|
-
:only_trusted
|
100
|
-
:only_signed
|
95
|
+
:verify_data => false,
|
96
|
+
:verify_signer => true,
|
97
|
+
:verify_chain => true,
|
98
|
+
:verify_root => true,
|
99
|
+
:only_trusted => false,
|
100
|
+
:only_signed => false
|
101
101
|
)
|
102
102
|
|
103
103
|
##
|
104
104
|
# Hash of configured security policies
|
105
105
|
|
106
106
|
Policies = {
|
107
|
-
"NoSecurity"
|
107
|
+
"NoSecurity" => NoSecurity,
|
108
108
|
"AlmostNoSecurity" => AlmostNoSecurity,
|
109
|
-
"LowSecurity"
|
110
|
-
"MediumSecurity"
|
111
|
-
"HighSecurity"
|
109
|
+
"LowSecurity" => LowSecurity,
|
110
|
+
"MediumSecurity" => MediumSecurity,
|
111
|
+
"HighSecurity" => HighSecurity,
|
112
112
|
# SigningPolicy is not intended for use by `gem -P` so do not list it
|
113
113
|
}.freeze
|
114
114
|
|
data/lib/rubygems/security.rb
CHANGED
@@ -376,8 +376,8 @@ module Gem::Security
|
|
376
376
|
# * The certificate contains a subject key identifier
|
377
377
|
|
378
378
|
EXTENSIONS = {
|
379
|
-
"basicConstraints"
|
380
|
-
"keyUsage"
|
379
|
+
"basicConstraints" => "CA:FALSE",
|
380
|
+
"keyUsage" =>
|
381
381
|
"keyEncipherment,dataEncipherment,digitalSignature",
|
382
382
|
"subjectKeyIdentifier" => "hash",
|
383
383
|
}.freeze
|
@@ -433,13 +433,6 @@ module Gem::Security
|
|
433
433
|
ec_key
|
434
434
|
end
|
435
435
|
|
436
|
-
##
|
437
|
-
# In Ruby 2.3 EC doesn't implement the private_key? but not the private? method
|
438
|
-
|
439
|
-
if defined?(OpenSSL::PKey::EC) && Gem::Version.new(String.new(RUBY_VERSION)) < Gem::Version.new("2.4.0")
|
440
|
-
OpenSSL::PKey::EC.send(:alias_method, :private?, :private_key?)
|
441
|
-
end
|
442
|
-
|
443
436
|
##
|
444
437
|
# Creates a self-signed certificate with an issuer and subject from +email+,
|
445
438
|
# a subject alternative name of +email+ and the given +extensions+ for the
|
@@ -492,13 +485,7 @@ module Gem::Security
|
|
492
485
|
when "rsa"
|
493
486
|
OpenSSL::PKey::RSA.new(RSA_DSA_KEY_LENGTH)
|
494
487
|
when "ec"
|
495
|
-
|
496
|
-
OpenSSL::PKey::EC.generate(EC_NAME)
|
497
|
-
else
|
498
|
-
domain_key = OpenSSL::PKey::EC.new(EC_NAME)
|
499
|
-
domain_key.generate_key
|
500
|
-
domain_key
|
501
|
-
end
|
488
|
+
OpenSSL::PKey::EC.generate(EC_NAME)
|
502
489
|
else
|
503
490
|
raise Gem::Security::Exception,
|
504
491
|
"#{algorithm} algorithm not found. RSA, DSA, and EC algorithms are supported."
|
data/lib/rubygems/source.rb
CHANGED
@@ -75,7 +75,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
75
75
|
|
76
76
|
SPECIFICATION_VERSION_HISTORY = { # :nodoc:
|
77
77
|
-1 => ["(RubyGems versions up to and including 0.7 did not have versioned specifications)"],
|
78
|
-
1
|
78
|
+
1 => [
|
79
79
|
'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"',
|
80
80
|
'"test_file=x" is a shortcut for "test_files=[x]"',
|
81
81
|
],
|
@@ -93,10 +93,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
93
93
|
|
94
94
|
MARSHAL_FIELDS = { # :nodoc:
|
95
95
|
-1 => 16,
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
96
|
+
1 => 16,
|
97
|
+
2 => 16,
|
98
|
+
3 => 17,
|
99
|
+
4 => 18,
|
100
100
|
}.freeze
|
101
101
|
|
102
102
|
today = Time.now.utc
|
@@ -124,35 +124,35 @@ class Gem::Specification < Gem::BasicSpecification
|
|
124
124
|
# Map of attribute names to default values.
|
125
125
|
|
126
126
|
@@default_value = {
|
127
|
-
:authors
|
128
|
-
:autorequire
|
129
|
-
:bindir
|
130
|
-
:cert_chain
|
131
|
-
:date
|
132
|
-
:dependencies
|
133
|
-
:description
|
134
|
-
:email
|
135
|
-
:executables
|
136
|
-
:extensions
|
137
|
-
:extra_rdoc_files
|
138
|
-
:files
|
139
|
-
:homepage
|
140
|
-
:licenses
|
141
|
-
:metadata
|
142
|
-
:name
|
143
|
-
:platform
|
144
|
-
:post_install_message
|
145
|
-
:rdoc_options
|
146
|
-
:require_paths
|
147
|
-
:required_ruby_version
|
127
|
+
:authors => [],
|
128
|
+
:autorequire => nil,
|
129
|
+
:bindir => "bin",
|
130
|
+
:cert_chain => [],
|
131
|
+
:date => nil,
|
132
|
+
:dependencies => [],
|
133
|
+
:description => nil,
|
134
|
+
:email => nil,
|
135
|
+
:executables => [],
|
136
|
+
:extensions => [],
|
137
|
+
:extra_rdoc_files => [],
|
138
|
+
:files => [],
|
139
|
+
:homepage => nil,
|
140
|
+
:licenses => [],
|
141
|
+
:metadata => {},
|
142
|
+
:name => nil,
|
143
|
+
:platform => Gem::Platform::RUBY,
|
144
|
+
:post_install_message => nil,
|
145
|
+
:rdoc_options => [],
|
146
|
+
:require_paths => ["lib"],
|
147
|
+
:required_ruby_version => Gem::Requirement.default,
|
148
148
|
:required_rubygems_version => Gem::Requirement.default,
|
149
|
-
:requirements
|
150
|
-
:rubygems_version
|
151
|
-
:signing_key
|
152
|
-
:specification_version
|
153
|
-
:summary
|
154
|
-
:test_files
|
155
|
-
:version
|
149
|
+
:requirements => [],
|
150
|
+
:rubygems_version => Gem::VERSION,
|
151
|
+
:signing_key => nil,
|
152
|
+
:specification_version => CURRENT_SPECIFICATION_VERSION,
|
153
|
+
:summary => nil,
|
154
|
+
:test_files => [],
|
155
|
+
:version => nil,
|
156
156
|
}.freeze
|
157
157
|
|
158
158
|
# rubocop:disable Style/MutableConstant
|
@@ -1265,8 +1265,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1265
1265
|
clear_load_cache
|
1266
1266
|
unresolved = unresolved_deps
|
1267
1267
|
unless unresolved.empty?
|
1268
|
-
|
1269
|
-
warn "#{w}: Unresolved or ambiguous specs during Gem::Specification.reset:"
|
1268
|
+
warn "WARN: Unresolved or ambiguous specs during Gem::Specification.reset:"
|
1270
1269
|
unresolved.values.each do |dep|
|
1271
1270
|
warn " #{dep}"
|
1272
1271
|
|
@@ -1276,7 +1275,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1276
1275
|
versions.each {|s| warn " - #{s.version}" }
|
1277
1276
|
end
|
1278
1277
|
end
|
1279
|
-
warn "
|
1278
|
+
warn "WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'"
|
1280
1279
|
warn "Please report a bug if this causes problems."
|
1281
1280
|
unresolved.clear
|
1282
1281
|
end
|
@@ -2519,25 +2518,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2519
2518
|
|
2520
2519
|
unless dependencies.empty?
|
2521
2520
|
result << nil
|
2522
|
-
result << "
|
2523
|
-
result << " s.specification_version = #{specification_version}"
|
2524
|
-
result << " end"
|
2521
|
+
result << " s.specification_version = #{specification_version}"
|
2525
2522
|
result << nil
|
2526
2523
|
|
2527
|
-
result << " if s.respond_to? :add_runtime_dependency then"
|
2528
|
-
|
2529
2524
|
dependencies.each do |dep|
|
2530
2525
|
req = dep.requirements_list.inspect
|
2531
2526
|
dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
|
2532
|
-
result << "
|
2533
|
-
end
|
2534
|
-
|
2535
|
-
result << " else"
|
2536
|
-
dependencies.each do |dep|
|
2537
|
-
version_reqs_param = dep.requirements_list.inspect
|
2538
|
-
result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
|
2527
|
+
result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
|
2539
2528
|
end
|
2540
|
-
result << " end"
|
2541
2529
|
end
|
2542
2530
|
|
2543
2531
|
result << "end"
|
@@ -460,6 +460,20 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
|
|
460
460
|
require_relative "ext"
|
461
461
|
builder = Gem::Ext::Builder.new(@specification)
|
462
462
|
|
463
|
+
validate_rake_extensions(builder)
|
464
|
+
validate_rust_extensions(builder)
|
465
|
+
end
|
466
|
+
|
467
|
+
def validate_rust_extensions(builder) # :nodoc:
|
468
|
+
rust_extension = @specification.extensions.any? {|s| builder.builder_for(s).is_a? Gem::Ext::CargoBuilder }
|
469
|
+
missing_cargo_lock = !@specification.files.include?("Cargo.lock")
|
470
|
+
|
471
|
+
error <<-ERROR if rust_extension && missing_cargo_lock
|
472
|
+
You have specified rust based extension, but Cargo.lock is not part of the gem files. Please run `cargo generate-lockfile` or any other command to generate Cargo.lock and ensure it is added to your gem files section in gemspec.
|
473
|
+
ERROR
|
474
|
+
end
|
475
|
+
|
476
|
+
def validate_rake_extensions(builder) # :nodoc:
|
463
477
|
rake_extension = @specification.extensions.any? {|s| builder.builder_for(s) == Gem::Ext::RakeBuilder }
|
464
478
|
rake_dependency = @specification.dependencies.any? {|d| d.name == "rake" }
|
465
479
|
|
@@ -19,9 +19,9 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
19
19
|
|
20
20
|
# These are common require paths.
|
21
21
|
REQUIRE_PATHS = { # :nodoc:
|
22
|
-
"lib"
|
22
|
+
"lib" => "lib".freeze,
|
23
23
|
"test" => "test".freeze,
|
24
|
-
"ext"
|
24
|
+
"ext" => "ext".freeze,
|
25
25
|
}.freeze
|
26
26
|
|
27
27
|
# These are common require path lists. This hash is used to optimize
|
data/lib/rubygems/text.rb
CHANGED
@@ -51,7 +51,7 @@ module Gem::Text
|
|
51
51
|
|
52
52
|
# Returns a value representing the "cost" of transforming str1 into str2
|
53
53
|
# Vendored version of DidYouMean::Levenshtein.distance from the ruby/did_you_mean gem @ 1.4.0
|
54
|
-
# https://
|
54
|
+
# https://github.com/ruby/did_you_mean/blob/2ddf39b874808685965dbc47d344cf6c7651807c/lib/did_you_mean/levenshtein.rb#L7-L37
|
55
55
|
def levenshtein_distance(str1, str2)
|
56
56
|
n = str1.length
|
57
57
|
m = str2.length
|