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
@@ -37,7 +37,8 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
37
37
|
def build_env
|
38
38
|
build_env = rb_config_env
|
39
39
|
build_env["RUBY_STATIC"] = "true" if ruby_static? && ENV.key?("RUBY_STATIC")
|
40
|
-
|
40
|
+
cfg = "--cfg=rb_sys_gem --cfg=rubygems --cfg=rubygems_#{Gem::VERSION.tr(".", "_")}"
|
41
|
+
build_env["RUSTFLAGS"] = [ENV["RUSTFLAGS"], cfg].compact.join(" ")
|
41
42
|
build_env
|
42
43
|
end
|
43
44
|
|
@@ -47,12 +48,13 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
47
48
|
|
48
49
|
cmd = []
|
49
50
|
cmd += [cargo, "rustc"]
|
51
|
+
cmd += ["--crate-type", "cdylib"]
|
50
52
|
cmd += ["--target", ENV["CARGO_BUILD_TARGET"]] if ENV["CARGO_BUILD_TARGET"]
|
51
53
|
cmd += ["--target-dir", dest_path]
|
52
54
|
cmd += ["--manifest-path", manifest]
|
53
55
|
cmd += ["--lib"]
|
54
56
|
cmd += ["--profile", profile.to_s]
|
55
|
-
cmd += ["--locked"]
|
57
|
+
cmd += ["--locked"]
|
56
58
|
cmd += Gem::Command.build_args
|
57
59
|
cmd += args
|
58
60
|
cmd += ["--"]
|
@@ -75,7 +77,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
75
77
|
*rustc_dynamic_linker_flags(dest_dir),
|
76
78
|
*rustc_lib_flags(dest_dir),
|
77
79
|
*platform_specific_rustc_args(dest_dir),
|
78
|
-
*debug_flags,
|
79
80
|
]
|
80
81
|
end
|
81
82
|
|
@@ -104,14 +105,23 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
104
105
|
# We want to use the same linker that Ruby uses, so that the linker flags from
|
105
106
|
# mkmf work properly.
|
106
107
|
def linker_args
|
107
|
-
# Have to handle CC="cl /nologo" on mswin
|
108
108
|
cc_flag = Shellwords.split(makefile_config("CC"))
|
109
109
|
linker = cc_flag.shift
|
110
110
|
link_args = cc_flag.flat_map {|a| ["-C", "link-arg=#{a}"] }
|
111
111
|
|
112
|
+
return mswin_link_args if linker == "cl"
|
113
|
+
|
112
114
|
["-C", "linker=#{linker}", *link_args]
|
113
115
|
end
|
114
116
|
|
117
|
+
def mswin_link_args
|
118
|
+
args = []
|
119
|
+
args += ["-l", makefile_config("LIBRUBYARG_SHARED").chomp(".lib")]
|
120
|
+
args += split_flags("LIBS").flat_map {|lib| ["-l", lib.chomp(".lib")] }
|
121
|
+
args += split_flags("LOCAL_LIBS").flat_map {|lib| ["-l", lib.chomp(".lib")] }
|
122
|
+
args
|
123
|
+
end
|
124
|
+
|
115
125
|
def libruby_args(dest_dir)
|
116
126
|
libs = makefile_config(ruby_static? ? "LIBRUBYARG_STATIC" : "LIBRUBYARG_SHARED")
|
117
127
|
raw_libs = Shellwords.split(libs)
|
@@ -149,7 +159,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
149
159
|
prefix = so_ext == "dll" ? "" : "lib"
|
150
160
|
path_parts = [dest_path]
|
151
161
|
path_parts << ENV["CARGO_BUILD_TARGET"] if ENV["CARGO_BUILD_TARGET"]
|
152
|
-
path_parts += [
|
162
|
+
path_parts += ["release", "#{prefix}#{cargo_crate_name}.#{so_ext}"]
|
153
163
|
File.join(*path_parts)
|
154
164
|
end
|
155
165
|
|
@@ -254,13 +264,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
254
264
|
RbConfig.expand(val.dup)
|
255
265
|
end
|
256
266
|
|
257
|
-
# Good balance between binary size and debugability
|
258
|
-
def debug_flags
|
259
|
-
return [] if profile == :dev
|
260
|
-
|
261
|
-
["-C", "debuginfo=1"]
|
262
|
-
end
|
263
|
-
|
264
267
|
# Copied from ExtConfBuilder
|
265
268
|
def finalize_directory(dest_path, lib_dir, extension_dir)
|
266
269
|
require "fileutils"
|
@@ -299,14 +302,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|
299
302
|
path
|
300
303
|
end
|
301
304
|
|
302
|
-
def profile_target_directory
|
303
|
-
case profile
|
304
|
-
when :release then "release"
|
305
|
-
when :dev then "debug"
|
306
|
-
else raise "unknown target directory for profile: #{profile}"
|
307
|
-
end
|
308
|
-
end
|
309
|
-
|
310
305
|
# Error raised when no cdylib artifact was created
|
311
306
|
class DylibNotFoundError < StandardError
|
312
307
|
def initialize(dir)
|
@@ -55,6 +55,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
55
55
|
destent = ent.class.new(dest_path, ent.rel)
|
56
56
|
destent.exist? || FileUtils.mv(ent.path, destent.path)
|
57
57
|
end
|
58
|
+
|
59
|
+
make dest_path, results, extension_dir, tmp_dest_relative, ["clean"]
|
58
60
|
ensure
|
59
61
|
ENV["DESTDIR"] = destdir
|
60
62
|
end
|
data/lib/rubygems/indexer.rb
CHANGED
@@ -397,7 +397,7 @@ class Gem::Indexer
|
|
397
397
|
dst_name = File.join @dest_directory, file # REFACTOR: duped above
|
398
398
|
|
399
399
|
FileUtils.mv src_name, dst_name, :verbose => verbose,
|
400
|
-
|
400
|
+
:force => true
|
401
401
|
|
402
402
|
File.utime newest_mtime, newest_mtime, dst_name
|
403
403
|
end
|
data/lib/rubygems/installer.rb
CHANGED
@@ -234,8 +234,8 @@ class Gem::Installer
|
|
234
234
|
io.gets # blankline
|
235
235
|
|
236
236
|
# TODO detect a specially formatted comment instead of trying
|
237
|
-
# to
|
238
|
-
next unless io.gets
|
237
|
+
# to find a string inside Ruby code.
|
238
|
+
next unless io.gets.to_s.include?("This file was generated by RubyGems")
|
239
239
|
|
240
240
|
ruby_executable = true
|
241
241
|
existing = io.read.slice(%r{
|
@@ -649,9 +649,9 @@ class Gem::Installer
|
|
649
649
|
|
650
650
|
def process_options # :nodoc:
|
651
651
|
@options = {
|
652
|
-
:bin_dir
|
653
|
-
:env_shebang
|
654
|
-
:force
|
652
|
+
:bin_dir => nil,
|
653
|
+
:env_shebang => false,
|
654
|
+
:force => false,
|
655
655
|
:only_install_dir => false,
|
656
656
|
:post_install_message => true,
|
657
657
|
}.merge options
|
@@ -425,7 +425,7 @@
|
|
425
425
|
# If you have any questions, file a ticket at http://bugs.ruby-lang.org.
|
426
426
|
#
|
427
427
|
class Gem::OptionParser
|
428
|
-
Gem::OptionParser::Version = "0.
|
428
|
+
Gem::OptionParser::Version = "0.3.0"
|
429
429
|
|
430
430
|
# :stopdoc:
|
431
431
|
NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
|
@@ -765,15 +765,15 @@ class Gem::OptionParser
|
|
765
765
|
end
|
766
766
|
|
767
767
|
#
|
768
|
-
# Switch that takes an argument, which does not begin with '-'.
|
768
|
+
# Switch that takes an argument, which does not begin with '-' or is '-'.
|
769
769
|
#
|
770
770
|
class PlacedArgument < self
|
771
771
|
|
772
772
|
#
|
773
|
-
# Returns nil if argument is not present or begins with '-'.
|
773
|
+
# Returns nil if argument is not present or begins with '-' and is not '-'.
|
774
774
|
#
|
775
775
|
def parse(arg, argv, &error)
|
776
|
-
if !(val = arg) and (argv.empty? or /\A
|
776
|
+
if !(val = arg) and (argv.empty? or /\A-./ =~ (val = argv[0]))
|
777
777
|
return nil, block, nil
|
778
778
|
end
|
779
779
|
opt = (val = parse_arg(val, &error))[1]
|
@@ -1148,6 +1148,7 @@ XXX
|
|
1148
1148
|
@summary_indent = indent
|
1149
1149
|
@default_argv = ARGV
|
1150
1150
|
@require_exact = false
|
1151
|
+
@raise_unknown = true
|
1151
1152
|
add_officious
|
1152
1153
|
yield self if block_given?
|
1153
1154
|
end
|
@@ -1225,6 +1226,9 @@ XXX
|
|
1225
1226
|
# abbreviated long option as short option).
|
1226
1227
|
attr_accessor :require_exact
|
1227
1228
|
|
1229
|
+
# Whether to raise at unknown option.
|
1230
|
+
attr_accessor :raise_unknown
|
1231
|
+
|
1228
1232
|
#
|
1229
1233
|
# Heading banner preceding summary.
|
1230
1234
|
#
|
@@ -1502,7 +1506,7 @@ XXX
|
|
1502
1506
|
style = notwice(default_style.guess(arg = o), style, 'style')
|
1503
1507
|
default_pattern, conv = search(:atype, Object) unless default_pattern
|
1504
1508
|
else
|
1505
|
-
desc.push(o)
|
1509
|
+
desc.push(o) if o && !o.empty?
|
1506
1510
|
end
|
1507
1511
|
end
|
1508
1512
|
|
@@ -1639,9 +1643,11 @@ XXX
|
|
1639
1643
|
begin
|
1640
1644
|
sw, = complete(:long, opt, true)
|
1641
1645
|
if require_exact && !sw.long.include?(arg)
|
1646
|
+
throw :terminate, arg unless raise_unknown
|
1642
1647
|
raise InvalidOption, arg
|
1643
1648
|
end
|
1644
1649
|
rescue ParseError
|
1650
|
+
throw :terminate, arg unless raise_unknown
|
1645
1651
|
raise $!.set_option(arg, true)
|
1646
1652
|
end
|
1647
1653
|
begin
|
@@ -1673,6 +1679,7 @@ XXX
|
|
1673
1679
|
end
|
1674
1680
|
end
|
1675
1681
|
rescue ParseError
|
1682
|
+
throw :terminate, arg unless raise_unknown
|
1676
1683
|
raise $!.set_option(arg, true)
|
1677
1684
|
end
|
1678
1685
|
begin
|
@@ -1862,12 +1869,7 @@ XXX
|
|
1862
1869
|
end
|
1863
1870
|
all_candidates.select! {|cand| cand.is_a?(String) }
|
1864
1871
|
checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
|
1865
|
-
|
1866
|
-
if DidYouMean.respond_to?(:formatter)
|
1867
|
-
DidYouMean.formatter.message_for(suggestions)
|
1868
|
-
else
|
1869
|
-
"\nDid you mean? #{suggestions.join("\n ")}"
|
1870
|
-
end
|
1872
|
+
DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
|
1871
1873
|
end
|
1872
1874
|
|
1873
1875
|
def candidate(word)
|
@@ -1908,10 +1910,13 @@ XXX
|
|
1908
1910
|
# directory ~/.options, then the basename with '.options' suffix
|
1909
1911
|
# under XDG and Haiku standard places.
|
1910
1912
|
#
|
1911
|
-
|
1913
|
+
# The optional +into+ keyword argument works exactly like that accepted in
|
1914
|
+
# method #parse.
|
1915
|
+
#
|
1916
|
+
def load(filename = nil, into: nil)
|
1912
1917
|
unless filename
|
1913
1918
|
basename = File.basename($0, '.*')
|
1914
|
-
return true if load(File.expand_path(basename, '~/.options')) rescue nil
|
1919
|
+
return true if load(File.expand_path(basename, '~/.options'), into: into) rescue nil
|
1915
1920
|
basename << ".options"
|
1916
1921
|
return [
|
1917
1922
|
# XDG
|
@@ -1923,11 +1928,11 @@ XXX
|
|
1923
1928
|
'~/config/settings',
|
1924
1929
|
].any? {|dir|
|
1925
1930
|
next if !dir or dir.empty?
|
1926
|
-
load(File.expand_path(basename, dir)) rescue nil
|
1931
|
+
load(File.expand_path(basename, dir), into: into) rescue nil
|
1927
1932
|
}
|
1928
1933
|
end
|
1929
1934
|
begin
|
1930
|
-
parse(*
|
1935
|
+
parse(*File.readlines(filename, chomp: true), into: into)
|
1931
1936
|
true
|
1932
1937
|
rescue Errno::ENOENT, Errno::ENOTDIR
|
1933
1938
|
false
|
@@ -103,22 +103,22 @@ class Gem::Package::TarHeader
|
|
103
103
|
|
104
104
|
fields = header.unpack UNPACK_FORMAT
|
105
105
|
|
106
|
-
new :name
|
107
|
-
:mode
|
108
|
-
:uid
|
109
|
-
:gid
|
110
|
-
:size
|
111
|
-
:mtime
|
106
|
+
new :name => fields.shift,
|
107
|
+
:mode => strict_oct(fields.shift),
|
108
|
+
:uid => oct_or_256based(fields.shift),
|
109
|
+
:gid => oct_or_256based(fields.shift),
|
110
|
+
:size => strict_oct(fields.shift),
|
111
|
+
:mtime => strict_oct(fields.shift),
|
112
112
|
:checksum => strict_oct(fields.shift),
|
113
113
|
:typeflag => fields.shift,
|
114
114
|
:linkname => fields.shift,
|
115
|
-
:magic
|
116
|
-
:version
|
117
|
-
:uname
|
118
|
-
:gname
|
115
|
+
:magic => fields.shift,
|
116
|
+
:version => strict_oct(fields.shift),
|
117
|
+
:uname => fields.shift,
|
118
|
+
:gname => fields.shift,
|
119
119
|
:devmajor => strict_oct(fields.shift),
|
120
120
|
:devminor => strict_oct(fields.shift),
|
121
|
-
:prefix
|
121
|
+
:prefix => fields.shift,
|
122
122
|
|
123
123
|
:empty => empty
|
124
124
|
end
|
data/lib/rubygems/platform.rb
CHANGED
@@ -97,7 +97,6 @@ class Gem::Platform
|
|
97
97
|
when /darwin(\d+)?/ then [ "darwin", $1 ]
|
98
98
|
when /^macruby$/ then [ "macruby", nil ]
|
99
99
|
when /freebsd(\d+)?/ then [ "freebsd", $1 ]
|
100
|
-
when /hpux(\d+)?/ then [ "hpux", $1 ]
|
101
100
|
when /^java$/, /^jruby$/ then [ "java", nil ]
|
102
101
|
when /^java([\d.]*)/ then [ "java", $1 ]
|
103
102
|
when /^dalvik(\d+)?$/ then [ "dalvik", $1 ]
|
@@ -112,7 +111,6 @@ class Gem::Platform
|
|
112
111
|
[os, version]
|
113
112
|
when /netbsdelf/ then [ "netbsdelf", nil ]
|
114
113
|
when /openbsd(\d+\.\d+)?/ then [ "openbsd", $1 ]
|
115
|
-
when /bitrig(\d+\.\d+)?/ then [ "bitrig", $1 ]
|
116
114
|
when /solaris(\d+\.\d+)?/ then [ "solaris", $1 ]
|
117
115
|
# test
|
118
116
|
when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
|
@@ -32,22 +32,22 @@
|
|
32
32
|
|
33
33
|
class Gem::RequestSet::GemDependencyAPI
|
34
34
|
ENGINE_MAP = { # :nodoc:
|
35
|
-
:jruby
|
36
|
-
:jruby_18
|
37
|
-
:jruby_19
|
38
|
-
:maglev
|
39
|
-
:mri
|
40
|
-
:mri_18
|
41
|
-
:mri_19
|
42
|
-
:mri_20
|
43
|
-
:mri_21
|
44
|
-
:rbx
|
45
|
-
:truffleruby
|
46
|
-
:ruby
|
47
|
-
:ruby_18
|
48
|
-
:ruby_19
|
49
|
-
:ruby_20
|
50
|
-
:ruby_21
|
35
|
+
:jruby => %w[jruby],
|
36
|
+
:jruby_18 => %w[jruby],
|
37
|
+
:jruby_19 => %w[jruby],
|
38
|
+
:maglev => %w[maglev],
|
39
|
+
:mri => %w[ruby],
|
40
|
+
:mri_18 => %w[ruby],
|
41
|
+
:mri_19 => %w[ruby],
|
42
|
+
:mri_20 => %w[ruby],
|
43
|
+
:mri_21 => %w[ruby],
|
44
|
+
:rbx => %w[rbx],
|
45
|
+
:truffleruby => %w[truffleruby],
|
46
|
+
:ruby => %w[ruby rbx maglev truffleruby],
|
47
|
+
:ruby_18 => %w[ruby rbx maglev truffleruby],
|
48
|
+
:ruby_19 => %w[ruby rbx maglev truffleruby],
|
49
|
+
:ruby_20 => %w[ruby rbx maglev truffleruby],
|
50
|
+
:ruby_21 => %w[ruby rbx maglev truffleruby],
|
51
51
|
}.freeze
|
52
52
|
|
53
53
|
mswin = Gem::Platform.new "x86-mswin32"
|
@@ -56,37 +56,37 @@ class Gem::RequestSet::GemDependencyAPI
|
|
56
56
|
x64_mingw = Gem::Platform.new "x64-mingw32"
|
57
57
|
|
58
58
|
PLATFORM_MAP = { # :nodoc:
|
59
|
-
:jruby
|
60
|
-
:jruby_18
|
61
|
-
:jruby_19
|
62
|
-
:maglev
|
63
|
-
:mingw
|
64
|
-
:mingw_18
|
65
|
-
:mingw_19
|
66
|
-
:mingw_20
|
67
|
-
:mingw_21
|
68
|
-
:mri
|
69
|
-
:mri_18
|
70
|
-
:mri_19
|
71
|
-
:mri_20
|
72
|
-
:mri_21
|
73
|
-
:mswin
|
74
|
-
:mswin_18
|
75
|
-
:mswin_19
|
76
|
-
:mswin_20
|
77
|
-
:mswin_21
|
78
|
-
:mswin64
|
79
|
-
:mswin64_19
|
80
|
-
:mswin64_20
|
81
|
-
:mswin64_21
|
82
|
-
:rbx
|
83
|
-
:ruby
|
84
|
-
:ruby_18
|
85
|
-
:ruby_19
|
86
|
-
:ruby_20
|
87
|
-
:ruby_21
|
88
|
-
:truffleruby
|
89
|
-
:x64_mingw
|
59
|
+
:jruby => Gem::Platform::RUBY,
|
60
|
+
:jruby_18 => Gem::Platform::RUBY,
|
61
|
+
:jruby_19 => Gem::Platform::RUBY,
|
62
|
+
:maglev => Gem::Platform::RUBY,
|
63
|
+
:mingw => x86_mingw,
|
64
|
+
:mingw_18 => x86_mingw,
|
65
|
+
:mingw_19 => x86_mingw,
|
66
|
+
:mingw_20 => x86_mingw,
|
67
|
+
:mingw_21 => x86_mingw,
|
68
|
+
:mri => Gem::Platform::RUBY,
|
69
|
+
:mri_18 => Gem::Platform::RUBY,
|
70
|
+
:mri_19 => Gem::Platform::RUBY,
|
71
|
+
:mri_20 => Gem::Platform::RUBY,
|
72
|
+
:mri_21 => Gem::Platform::RUBY,
|
73
|
+
:mswin => mswin,
|
74
|
+
:mswin_18 => mswin,
|
75
|
+
:mswin_19 => mswin,
|
76
|
+
:mswin_20 => mswin,
|
77
|
+
:mswin_21 => mswin,
|
78
|
+
:mswin64 => mswin64,
|
79
|
+
:mswin64_19 => mswin64,
|
80
|
+
:mswin64_20 => mswin64,
|
81
|
+
:mswin64_21 => mswin64,
|
82
|
+
:rbx => Gem::Platform::RUBY,
|
83
|
+
:ruby => Gem::Platform::RUBY,
|
84
|
+
:ruby_18 => Gem::Platform::RUBY,
|
85
|
+
:ruby_19 => Gem::Platform::RUBY,
|
86
|
+
:ruby_20 => Gem::Platform::RUBY,
|
87
|
+
:ruby_21 => Gem::Platform::RUBY,
|
88
|
+
:truffleruby => Gem::Platform::RUBY,
|
89
|
+
:x64_mingw => x64_mingw,
|
90
90
|
:x64_mingw_20 => x64_mingw,
|
91
91
|
:x64_mingw_21 => x64_mingw,
|
92
92
|
}.freeze
|
@@ -98,68 +98,68 @@ class Gem::RequestSet::GemDependencyAPI
|
|
98
98
|
tilde_gt_2_1_0 = Gem::Requirement.new "~> 2.1.0"
|
99
99
|
|
100
100
|
VERSION_MAP = { # :nodoc:
|
101
|
-
:jruby
|
102
|
-
:jruby_18
|
103
|
-
:jruby_19
|
104
|
-
:maglev
|
105
|
-
:mingw
|
106
|
-
:mingw_18
|
107
|
-
:mingw_19
|
108
|
-
:mingw_20
|
109
|
-
:mingw_21
|
110
|
-
:mri
|
111
|
-
:mri_18
|
112
|
-
:mri_19
|
113
|
-
:mri_20
|
114
|
-
:mri_21
|
115
|
-
:mswin
|
116
|
-
:mswin_18
|
117
|
-
:mswin_19
|
118
|
-
:mswin_20
|
119
|
-
:mswin_21
|
120
|
-
:mswin64
|
121
|
-
:mswin64_19
|
122
|
-
:mswin64_20
|
123
|
-
:mswin64_21
|
124
|
-
:rbx
|
125
|
-
:ruby
|
126
|
-
:ruby_18
|
127
|
-
:ruby_19
|
128
|
-
:ruby_20
|
129
|
-
:ruby_21
|
130
|
-
:truffleruby
|
131
|
-
:x64_mingw
|
101
|
+
:jruby => gt_eq_0,
|
102
|
+
:jruby_18 => tilde_gt_1_8_0,
|
103
|
+
:jruby_19 => tilde_gt_1_9_0,
|
104
|
+
:maglev => gt_eq_0,
|
105
|
+
:mingw => gt_eq_0,
|
106
|
+
:mingw_18 => tilde_gt_1_8_0,
|
107
|
+
:mingw_19 => tilde_gt_1_9_0,
|
108
|
+
:mingw_20 => tilde_gt_2_0_0,
|
109
|
+
:mingw_21 => tilde_gt_2_1_0,
|
110
|
+
:mri => gt_eq_0,
|
111
|
+
:mri_18 => tilde_gt_1_8_0,
|
112
|
+
:mri_19 => tilde_gt_1_9_0,
|
113
|
+
:mri_20 => tilde_gt_2_0_0,
|
114
|
+
:mri_21 => tilde_gt_2_1_0,
|
115
|
+
:mswin => gt_eq_0,
|
116
|
+
:mswin_18 => tilde_gt_1_8_0,
|
117
|
+
:mswin_19 => tilde_gt_1_9_0,
|
118
|
+
:mswin_20 => tilde_gt_2_0_0,
|
119
|
+
:mswin_21 => tilde_gt_2_1_0,
|
120
|
+
:mswin64 => gt_eq_0,
|
121
|
+
:mswin64_19 => tilde_gt_1_9_0,
|
122
|
+
:mswin64_20 => tilde_gt_2_0_0,
|
123
|
+
:mswin64_21 => tilde_gt_2_1_0,
|
124
|
+
:rbx => gt_eq_0,
|
125
|
+
:ruby => gt_eq_0,
|
126
|
+
:ruby_18 => tilde_gt_1_8_0,
|
127
|
+
:ruby_19 => tilde_gt_1_9_0,
|
128
|
+
:ruby_20 => tilde_gt_2_0_0,
|
129
|
+
:ruby_21 => tilde_gt_2_1_0,
|
130
|
+
:truffleruby => gt_eq_0,
|
131
|
+
:x64_mingw => gt_eq_0,
|
132
132
|
:x64_mingw_20 => tilde_gt_2_0_0,
|
133
133
|
:x64_mingw_21 => tilde_gt_2_1_0,
|
134
134
|
}.freeze
|
135
135
|
|
136
136
|
WINDOWS = { # :nodoc:
|
137
|
-
:mingw
|
138
|
-
:mingw_18
|
139
|
-
:mingw_19
|
140
|
-
:mingw_20
|
141
|
-
:mingw_21
|
142
|
-
:mri
|
143
|
-
:mri_18
|
144
|
-
:mri_19
|
145
|
-
:mri_20
|
146
|
-
:mri_21
|
147
|
-
:mswin
|
148
|
-
:mswin_18
|
149
|
-
:mswin_19
|
150
|
-
:mswin_20
|
151
|
-
:mswin_21
|
152
|
-
:mswin64
|
153
|
-
:mswin64_19
|
154
|
-
:mswin64_20
|
155
|
-
:mswin64_21
|
156
|
-
:rbx
|
157
|
-
:ruby
|
158
|
-
:ruby_18
|
159
|
-
:ruby_19
|
160
|
-
:ruby_20
|
161
|
-
:ruby_21
|
162
|
-
:x64_mingw
|
137
|
+
:mingw => :only,
|
138
|
+
:mingw_18 => :only,
|
139
|
+
:mingw_19 => :only,
|
140
|
+
:mingw_20 => :only,
|
141
|
+
:mingw_21 => :only,
|
142
|
+
:mri => :never,
|
143
|
+
:mri_18 => :never,
|
144
|
+
:mri_19 => :never,
|
145
|
+
:mri_20 => :never,
|
146
|
+
:mri_21 => :never,
|
147
|
+
:mswin => :only,
|
148
|
+
:mswin_18 => :only,
|
149
|
+
:mswin_19 => :only,
|
150
|
+
:mswin_20 => :only,
|
151
|
+
:mswin_21 => :only,
|
152
|
+
:mswin64 => :only,
|
153
|
+
:mswin64_19 => :only,
|
154
|
+
:mswin64_20 => :only,
|
155
|
+
:mswin64_21 => :only,
|
156
|
+
:rbx => :never,
|
157
|
+
:ruby => :never,
|
158
|
+
:ruby_18 => :never,
|
159
|
+
:ruby_19 => :never,
|
160
|
+
:ruby_20 => :never,
|
161
|
+
:ruby_21 => :never,
|
162
|
+
:x64_mingw => :only,
|
163
163
|
:x64_mingw_20 => :only,
|
164
164
|
:x64_mingw_21 => :only,
|
165
165
|
}.freeze
|
data/lib/rubygems/requirement.rb
CHANGED
@@ -10,13 +10,13 @@ require_relative "version"
|
|
10
10
|
|
11
11
|
class Gem::Requirement
|
12
12
|
OPS = { #:nodoc:
|
13
|
-
"="
|
14
|
-
"!=" =>
|
15
|
-
">"
|
16
|
-
"<"
|
17
|
-
">=" =>
|
18
|
-
"<=" =>
|
19
|
-
"~>" =>
|
13
|
+
"=" => lambda {|v, r| v == r },
|
14
|
+
"!=" => lambda {|v, r| v != r },
|
15
|
+
">" => lambda {|v, r| v > r },
|
16
|
+
"<" => lambda {|v, r| v < r },
|
17
|
+
">=" => lambda {|v, r| v >= r },
|
18
|
+
"<=" => lambda {|v, r| v <= r },
|
19
|
+
"~>" => lambda {|v, r| v >= r && v.release < r.bump },
|
20
20
|
}.freeze
|
21
21
|
|
22
22
|
SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc:
|
@@ -32,7 +32,7 @@ module Gem::Resolver::Molinillo
|
|
32
32
|
# all belong to the same graph.
|
33
33
|
# @return [Array<Vertex>] The sorted vertices.
|
34
34
|
def self.tsort(vertices)
|
35
|
-
TSort.tsort(
|
35
|
+
Gem::TSort.tsort(
|
36
36
|
lambda { |b| vertices.each(&b) },
|
37
37
|
lambda { |v, &b| (v.successors & vertices).each(&b) }
|
38
38
|
)
|
@@ -107,36 +107,42 @@ module Gem::Resolver::Molinillo
|
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
110
|
+
full_message_for_conflict = opts.delete(:full_message_for_conflict) do
|
111
|
+
proc do |name, conflict|
|
112
|
+
o = "\n".dup << incompatible_version_message_for_conflict.call(name, conflict) << "\n"
|
113
|
+
if conflict.locked_requirement
|
114
|
+
o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
|
115
|
+
o << %( #{printable_requirement.call(conflict.locked_requirement)}\n)
|
116
|
+
o << %(\n)
|
117
|
+
end
|
118
|
+
o << %( In #{name_for_explicit_dependency_source}:\n)
|
119
|
+
trees = reduce_trees.call(conflict.requirement_trees)
|
120
|
+
|
121
|
+
o << trees.map do |tree|
|
122
|
+
t = ''.dup
|
123
|
+
depth = 2
|
124
|
+
tree.each do |req|
|
125
|
+
t << ' ' * depth << printable_requirement.call(req)
|
126
|
+
unless tree.last == req
|
127
|
+
if spec = conflict.activated_by_name[name_for(req)]
|
128
|
+
t << %( was resolved to #{version_for_spec.call(spec)}, which)
|
129
|
+
end
|
130
|
+
t << %( depends on)
|
128
131
|
end
|
129
|
-
t << %(
|
132
|
+
t << %(\n)
|
133
|
+
depth += 1
|
130
134
|
end
|
131
|
-
t
|
132
|
-
|
133
|
-
end
|
134
|
-
t
|
135
|
-
end.join("\n")
|
135
|
+
t
|
136
|
+
end.join("\n")
|
136
137
|
|
137
|
-
|
138
|
+
additional_message_for_conflict.call(o, name, conflict)
|
138
139
|
|
139
|
-
|
140
|
+
o
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
conflicts.sort.reduce(''.dup) do |o, (name, conflict)|
|
145
|
+
o << full_message_for_conflict.call(name, conflict)
|
140
146
|
end.strip
|
141
147
|
end
|
142
148
|
end
|