bundler 2.2.29 → 2.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1129 -4
- data/README.md +4 -8
- data/bundler.gemspec +11 -11
- data/exe/bundle +5 -26
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +4 -4
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/checksum.rb +254 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +4 -4
- data/lib/bundler/cli/binstubs.rb +10 -6
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +3 -3
- data/lib/bundler/cli/common.rb +13 -3
- data/lib/bundler/cli/config.rb +18 -8
- data/lib/bundler/cli/console.rb +5 -4
- data/lib/bundler/cli/doctor.rb +12 -5
- data/lib/bundler/cli/exec.rb +1 -1
- data/lib/bundler/cli/fund.rb +1 -1
- data/lib/bundler/cli/gem.rb +141 -48
- data/lib/bundler/cli/info.rb +27 -17
- data/lib/bundler/cli/init.rb +6 -2
- data/lib/bundler/cli/install.rb +22 -39
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/lock.rb +36 -29
- data/lib/bundler/cli/open.rb +9 -9
- data/lib/bundler/cli/outdated.rb +19 -12
- data/lib/bundler/cli/platform.rb +8 -6
- data/lib/bundler/cli/plugin.rb +9 -15
- data/lib/bundler/cli/pristine.rb +38 -30
- data/lib/bundler/cli/show.rb +3 -3
- data/lib/bundler/cli/update.rb +12 -7
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +266 -285
- data/lib/bundler/compact_index_client/cache.rb +53 -67
- data/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/lib/bundler/compact_index_client/parser.rb +84 -0
- data/lib/bundler/compact_index_client/updater.rb +83 -76
- data/lib/bundler/compact_index_client.rb +59 -87
- data/lib/bundler/constants.rb +9 -2
- data/lib/bundler/current_ruby.rb +12 -16
- data/lib/bundler/definition.rb +509 -319
- data/lib/bundler/dependency.rb +33 -71
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +88 -69
- data/lib/bundler/endpoint_specification.rb +32 -15
- data/lib/bundler/env.rb +5 -7
- data/lib/bundler/environment_preserver.rb +8 -22
- data/lib/bundler/errors.rb +101 -13
- data/lib/bundler/feature_flag.rb +0 -2
- data/lib/bundler/fetcher/base.rb +11 -11
- data/lib/bundler/fetcher/compact_index.rb +32 -52
- data/lib/bundler/fetcher/dependency.rb +3 -7
- data/lib/bundler/fetcher/downloader.rb +17 -16
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +2 -29
- data/lib/bundler/fetcher.rb +87 -79
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +29 -40
- data/lib/bundler/gem_helper.rb +11 -23
- data/lib/bundler/gem_helpers.rb +30 -6
- data/lib/bundler/gem_version_promoter.rb +68 -109
- data/lib/bundler/graph.rb +9 -9
- data/lib/bundler/index.rb +71 -79
- data/lib/bundler/injector.rb +23 -11
- data/lib/bundler/inline.rb +11 -23
- data/lib/bundler/installer/gem_installer.rb +18 -11
- data/lib/bundler/installer/parallel_installer.rb +17 -65
- data/lib/bundler/installer/standalone.rb +56 -15
- data/lib/bundler/installer.rb +35 -61
- data/lib/bundler/lazy_specification.rb +92 -61
- data/lib/bundler/lockfile_generator.rb +12 -3
- data/lib/bundler/lockfile_parser.rb +137 -70
- data/lib/bundler/man/bundle-add.1 +19 -26
- data/lib/bundler/man/bundle-add.1.ronn +16 -4
- data/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/lib/bundler/man/bundle-cache.1 +9 -24
- data/lib/bundler/man/bundle-cache.1.ronn +9 -2
- data/lib/bundler/man/bundle-check.1 +5 -12
- data/lib/bundler/man/bundle-check.1.ronn +3 -0
- data/lib/bundler/man/bundle-clean.1 +4 -11
- data/lib/bundler/man/bundle-clean.1.ronn +1 -1
- data/lib/bundler/man/bundle-config.1 +47 -224
- data/lib/bundler/man/bundle-config.1.ronn +40 -28
- data/lib/bundler/man/bundle-console.1 +35 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +4 -18
- data/lib/bundler/man/bundle-exec.1 +16 -77
- data/lib/bundler/man/bundle-exec.1.ronn +8 -9
- data/lib/bundler/man/bundle-gem.1 +45 -72
- data/lib/bundler/man/bundle-gem.1.ronn +32 -5
- data/lib/bundler/man/bundle-help.1 +9 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +5 -11
- data/lib/bundler/man/bundle-info.1.ronn +3 -3
- data/lib/bundler/man/bundle-init.1 +6 -11
- data/lib/bundler/man/bundle-init.1.ronn +2 -0
- data/lib/bundler/man/bundle-inject.1 +8 -18
- data/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/lib/bundler/man/bundle-install.1 +32 -155
- data/lib/bundler/man/bundle-install.1.ronn +11 -33
- data/lib/bundler/man/bundle-list.1 +4 -19
- data/lib/bundler/man/bundle-lock.1 +5 -29
- data/lib/bundler/man/bundle-open.1 +18 -18
- data/lib/bundler/man/bundle-open.1.ronn +9 -1
- data/lib/bundler/man/bundle-outdated.1 +17 -72
- data/lib/bundler/man/bundle-outdated.1.ronn +13 -18
- data/lib/bundler/man/bundle-platform.1 +16 -28
- data/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/lib/bundler/man/bundle-plugin.1 +58 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
- data/lib/bundler/man/bundle-pristine.1 +5 -16
- data/lib/bundler/man/bundle-remove.1 +4 -14
- data/lib/bundler/man/bundle-show.1 +3 -10
- data/lib/bundler/man/bundle-update.1 +19 -138
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/lib/bundler/man/bundle-version.1 +22 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/lib/bundler/man/bundle-viz.1 +6 -15
- data/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/lib/bundler/man/bundle.1 +17 -51
- data/lib/bundler/man/bundle.1.ronn +12 -7
- data/lib/bundler/man/gemfile.5 +130 -346
- data/lib/bundler/man/gemfile.5.ronn +121 -86
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +17 -0
- data/lib/bundler/match_platform.rb +1 -2
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +8 -10
- data/lib/bundler/plugin/api/source.rb +9 -13
- data/lib/bundler/plugin/index.rb +13 -5
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/path.rb +18 -0
- data/lib/bundler/plugin/installer/rubygems.rb +0 -8
- data/lib/bundler/plugin/installer.rb +42 -19
- data/lib/bundler/plugin/source_list.rb +4 -4
- data/lib/bundler/plugin.rb +16 -7
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +11 -5
- data/lib/bundler/resolver/base.rb +111 -0
- data/lib/bundler/resolver/candidate.rb +82 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +81 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +53 -66
- data/lib/bundler/resolver.rb +419 -307
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +42 -7
- data/lib/bundler/ruby_version.rb +16 -22
- data/lib/bundler/rubygems_ext.rb +250 -64
- data/lib/bundler/rubygems_gem_installer.rb +90 -64
- data/lib/bundler/rubygems_integration.rb +81 -190
- data/lib/bundler/runtime.rb +8 -13
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +206 -0
- data/lib/bundler/settings.rb +139 -57
- data/lib/bundler/setup.rb +13 -1
- data/lib/bundler/shared_helpers.rb +67 -36
- data/lib/bundler/source/git/git_proxy.rb +285 -82
- data/lib/bundler/source/git.rb +81 -41
- data/lib/bundler/source/metadata.rb +17 -16
- data/lib/bundler/source/path/installer.rb +1 -22
- data/lib/bundler/source/path.rb +13 -25
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +164 -234
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +7 -6
- data/lib/bundler/source_list.rb +40 -32
- data/lib/bundler/source_map.rb +15 -2
- data/lib/bundler/spec_set.rb +156 -46
- data/lib/bundler/stub_specification.rb +18 -5
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +7 -12
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -2
- data/lib/bundler/templates/newgem/README.md.tt +7 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +28 -4
- data/lib/bundler/templates/newgem/bin/console.tt +0 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +13 -3
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +13 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +25 -17
- data/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +38 -15
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_credentials_filter.rb +2 -2
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +92 -78
- data/lib/bundler/vendor/fileutils/.document +1 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1340 -410
- data/lib/bundler/vendor/net-http-persistent/.document +1 -0
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +4 -3
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +57 -57
- data/lib/bundler/vendor/pub_grub/.document +1 -0
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/lib/bundler/vendor/thor/.document +1 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +12 -14
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +16 -6
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +21 -17
- data/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
- data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +16 -20
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +63 -7
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +48 -154
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -46
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +0 -45
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/util.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +155 -8
- data/lib/bundler/vendor/tsort/.document +1 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/lib/bundler/vendor/uri/.document +1 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +316 -207
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +33 -13
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -23
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +105 -47
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +3 -3
- data/lib/bundler/vendored_net_http.rb +23 -0
- data/lib/bundler/vendored_persistent.rb +0 -36
- data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/vendored_timeout.rb +12 -0
- data/lib/bundler/{vendored_tmpdir.rb → vendored_tsort.rb} +1 -1
- data/lib/bundler/vendored_uri.rb +18 -1
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/worker.rb +7 -9
- data/lib/bundler/yaml_serializer.rb +21 -12
- data/lib/bundler.rb +114 -121
- metadata +87 -41
- data/lib/bundler/dep_proxy.rb +0 -55
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -22
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -5
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
- data/lib/bundler/version_ranges.rb +0 -122
@@ -16,22 +16,30 @@ module Bundler
|
|
16
16
|
spec.loaded_from = spec_file
|
17
17
|
|
18
18
|
# Completely remove any previous gem files
|
19
|
-
|
20
|
-
|
19
|
+
strict_rm_rf gem_dir
|
20
|
+
strict_rm_rf spec.extension_dir
|
21
21
|
|
22
|
-
|
22
|
+
SharedHelpers.filesystem_access(gem_dir, :create) do
|
23
|
+
FileUtils.mkdir_p gem_dir, mode: 0o755
|
24
|
+
end
|
23
25
|
|
24
26
|
extract_files
|
25
27
|
|
26
|
-
build_extensions
|
28
|
+
build_extensions if spec.extensions.any?
|
27
29
|
write_build_info_file
|
28
30
|
run_post_build_hooks
|
29
31
|
|
30
|
-
|
32
|
+
SharedHelpers.filesystem_access(bin_dir, :write) do
|
33
|
+
generate_bin
|
34
|
+
end
|
35
|
+
|
31
36
|
generate_plugins
|
32
37
|
|
33
38
|
write_spec
|
34
|
-
|
39
|
+
|
40
|
+
SharedHelpers.filesystem_access("#{gem_home}/cache", :write) do
|
41
|
+
write_cache_file
|
42
|
+
end
|
35
43
|
|
36
44
|
say spec.post_install_message unless spec.post_install_message.nil?
|
37
45
|
|
@@ -40,6 +48,24 @@ module Bundler
|
|
40
48
|
spec
|
41
49
|
end
|
42
50
|
|
51
|
+
if Bundler.rubygems.provides?("< 3.5")
|
52
|
+
def pre_install_checks
|
53
|
+
super
|
54
|
+
rescue Gem::FilePermissionError
|
55
|
+
# Ignore permission checks in RubyGems. Instead, go on, and try to write
|
56
|
+
# for real. We properly handle permission errors when they happen.
|
57
|
+
nil
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def ensure_writable_dir(dir)
|
62
|
+
super
|
63
|
+
rescue Gem::FilePermissionError
|
64
|
+
# Ignore permission checks in RubyGems. Instead, go on, and try to write
|
65
|
+
# for real. We properly handle permission errors when they happen.
|
66
|
+
nil
|
67
|
+
end
|
68
|
+
|
43
69
|
def generate_plugins
|
44
70
|
return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
|
45
71
|
|
@@ -55,89 +81,89 @@ module Bundler
|
|
55
81
|
end
|
56
82
|
end
|
57
83
|
|
58
|
-
|
59
|
-
|
84
|
+
if Bundler.rubygems.provides?("< 3.5.15")
|
85
|
+
def generate_bin_script(filename, bindir)
|
86
|
+
bin_script_path = File.join bindir, formatted_program_filename(filename)
|
87
|
+
|
88
|
+
Gem.open_file_with_flock("#{bin_script_path}.lock") do
|
89
|
+
require "fileutils"
|
90
|
+
FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
|
91
|
+
|
92
|
+
File.open(bin_script_path, "wb", 0o755) do |file|
|
93
|
+
file.write app_script_text(filename)
|
94
|
+
file.chmod(options[:prog_mode] || 0o755)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
verbose bin_script_path
|
99
|
+
|
100
|
+
generate_windows_script filename, bindir
|
101
|
+
end
|
60
102
|
end
|
61
103
|
|
62
104
|
def build_extensions
|
63
105
|
extension_cache_path = options[:bundler_extension_cache_path]
|
64
|
-
|
65
|
-
|
106
|
+
extension_dir = spec.extension_dir
|
107
|
+
unless extension_cache_path && extension_dir
|
108
|
+
prepare_extension_build(extension_dir)
|
66
109
|
return super
|
67
110
|
end
|
68
111
|
|
69
|
-
extension_dir = Pathname.new(extension_dir)
|
70
112
|
build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
|
71
113
|
if build_complete && !options[:force]
|
72
|
-
SharedHelpers.filesystem_access(extension_dir
|
114
|
+
SharedHelpers.filesystem_access(File.dirname(extension_dir)) do |p|
|
115
|
+
FileUtils.mkpath p
|
116
|
+
end
|
73
117
|
SharedHelpers.filesystem_access(extension_cache_path) do
|
74
|
-
FileUtils.cp_r extension_cache_path,
|
118
|
+
FileUtils.cp_r extension_cache_path, extension_dir
|
75
119
|
end
|
76
120
|
else
|
77
|
-
|
121
|
+
prepare_extension_build(extension_dir)
|
78
122
|
super
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
FileUtils.cp_r extension_dir, extension_cache_path
|
83
|
-
end
|
123
|
+
SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
|
124
|
+
SharedHelpers.filesystem_access(extension_cache_path) do
|
125
|
+
FileUtils.cp_r extension_dir, extension_cache_path
|
84
126
|
end
|
85
127
|
end
|
86
128
|
end
|
87
129
|
|
130
|
+
def spec
|
131
|
+
if Bundler.rubygems.provides?("< 3.3.12") # RubyGems implementation rescues and re-raises errors before 3.3.12 and we don't want that
|
132
|
+
@package.spec
|
133
|
+
else
|
134
|
+
super
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def gem_checksum
|
139
|
+
Checksum.from_gem_package(@package)
|
140
|
+
end
|
141
|
+
|
88
142
|
private
|
89
143
|
|
90
|
-
def
|
91
|
-
|
92
|
-
|
93
|
-
return true unless source = @package.instance_variable_get(:@gem)
|
94
|
-
return true unless source.respond_to?(:with_read_io)
|
95
|
-
digest = source.with_read_io do |io|
|
96
|
-
digest = SharedHelpers.digest(:SHA256).new
|
97
|
-
digest << io.read(16_384) until io.eof?
|
98
|
-
io.rewind
|
99
|
-
send(checksum_type(checksum), digest)
|
144
|
+
def prepare_extension_build(extension_dir)
|
145
|
+
SharedHelpers.filesystem_access(extension_dir, :create) do
|
146
|
+
FileUtils.mkdir_p extension_dir
|
100
147
|
end
|
101
|
-
unless
|
102
|
-
raise SecurityError, <<-MESSAGE
|
103
|
-
Bundler cannot continue installing #{spec.name} (#{spec.version}).
|
104
|
-
The checksum for the downloaded `#{spec.full_name}.gem` does not match \
|
105
|
-
the checksum given by the server. This means the contents of the downloaded \
|
106
|
-
gem is different from what was uploaded to the server, and could be a potential security issue.
|
107
|
-
|
108
|
-
To resolve this issue:
|
109
|
-
1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
|
110
|
-
2. run `bundle install`
|
111
|
-
|
112
|
-
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
|
113
|
-
security issue despite the mismatching checksum, do the following:
|
114
|
-
1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
|
115
|
-
2. run `bundle install`
|
116
|
-
|
117
|
-
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
|
118
|
-
checksum for the downloaded gem was #{digest.inspect}.)
|
119
|
-
MESSAGE
|
120
|
-
end
|
121
|
-
true
|
148
|
+
require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
|
122
149
|
end
|
123
150
|
|
124
|
-
def
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
151
|
+
def strict_rm_rf(dir)
|
152
|
+
return unless File.exist?(dir)
|
153
|
+
|
154
|
+
parent = File.dirname(dir)
|
155
|
+
parent_st = File.stat(parent)
|
156
|
+
|
157
|
+
if parent_st.world_writable? && !parent_st.sticky?
|
158
|
+
raise InsecureInstallPathError.new(parent)
|
129
159
|
end
|
130
|
-
end
|
131
160
|
|
132
|
-
|
133
|
-
|
134
|
-
|
161
|
+
begin
|
162
|
+
FileUtils.remove_entry_secure(dir)
|
163
|
+
rescue StandardError => e
|
164
|
+
raise unless File.exist?(dir)
|
135
165
|
|
136
|
-
|
137
|
-
if digest.respond_to?(:base64digest!)
|
138
|
-
digest.base64digest!
|
139
|
-
else
|
140
|
-
[digest.digest!].pack("m0")
|
166
|
+
raise DirectoryRemovalError.new(e, "Could not delete previous installation of `#{dir}`")
|
141
167
|
end
|
142
168
|
end
|
143
169
|
end
|
@@ -4,33 +4,24 @@ require "rubygems" unless defined?(Gem)
|
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class RubygemsIntegration
|
7
|
-
|
8
|
-
EXT_LOCK = Gem::Ext::Builder::CHDIR_MONITOR
|
9
|
-
else
|
10
|
-
require "monitor"
|
7
|
+
require "monitor"
|
11
8
|
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.version
|
16
|
-
@version ||= Gem::Version.new(Gem::VERSION)
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.provides?(req_str)
|
20
|
-
Gem::Requirement.new(req_str).satisfied_by?(version)
|
21
|
-
end
|
9
|
+
EXT_LOCK = Monitor.new
|
22
10
|
|
23
11
|
def initialize
|
24
12
|
@replaced_methods = {}
|
25
|
-
backport_ext_builder_monitor
|
26
13
|
end
|
27
14
|
|
28
15
|
def version
|
29
|
-
|
16
|
+
@version ||= Gem.rubygems_version
|
30
17
|
end
|
31
18
|
|
32
19
|
def provides?(req_str)
|
33
|
-
|
20
|
+
Gem::Requirement.new(req_str).satisfied_by?(version)
|
21
|
+
end
|
22
|
+
|
23
|
+
def supports_bundler_trampolining?
|
24
|
+
provides?(">= 3.3.0.a")
|
34
25
|
end
|
35
26
|
|
36
27
|
def build_args
|
@@ -47,18 +38,6 @@ module Bundler
|
|
47
38
|
Gem.loaded_specs[name]
|
48
39
|
end
|
49
40
|
|
50
|
-
def add_to_load_path(paths)
|
51
|
-
return Gem.add_to_load_path(*paths) if Gem.respond_to?(:add_to_load_path)
|
52
|
-
|
53
|
-
if insert_index = Gem.load_path_insert_index
|
54
|
-
# Gem directories must come after -I and ENV['RUBYLIB']
|
55
|
-
$LOAD_PATH.insert(insert_index, *paths)
|
56
|
-
else
|
57
|
-
# We are probably testing in core, -I and RUBYLIB don't apply
|
58
|
-
$LOAD_PATH.unshift(*paths)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
41
|
def mark_loaded(spec)
|
63
42
|
if spec.respond_to?(:activated=)
|
64
43
|
current = Gem.loaded_specs[spec.name]
|
@@ -69,7 +48,7 @@ module Bundler
|
|
69
48
|
end
|
70
49
|
|
71
50
|
def validate(spec)
|
72
|
-
Bundler.ui.silence { spec.
|
51
|
+
Bundler.ui.silence { spec.validate_for_resolution }
|
73
52
|
rescue Gem::InvalidSpecificationException => e
|
74
53
|
error_message = "The gemspec at #{spec.loaded_from} is not valid. Please fix this gemspec.\n" \
|
75
54
|
"The validation error was '#{e.message}'\n"
|
@@ -86,22 +65,18 @@ module Bundler
|
|
86
65
|
def spec_missing_extensions?(spec, default = true)
|
87
66
|
return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
|
88
67
|
|
89
|
-
return false if
|
68
|
+
return false if spec.default_gem?
|
90
69
|
return false if spec.extensions.empty?
|
91
70
|
|
92
71
|
default
|
93
72
|
end
|
94
73
|
|
95
|
-
def spec_default_gem?(spec)
|
96
|
-
spec.respond_to?(:default_gem?) && spec.default_gem?
|
97
|
-
end
|
98
|
-
|
99
74
|
def spec_matches_for_glob(spec, glob)
|
100
75
|
return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
|
101
76
|
|
102
|
-
spec.load_paths.
|
77
|
+
spec.load_paths.flat_map do |lp|
|
103
78
|
Dir["#{lp}/#{glob}#{suffix_pattern}"]
|
104
|
-
end
|
79
|
+
end
|
105
80
|
end
|
106
81
|
|
107
82
|
def stub_set_spec(stub, spec)
|
@@ -112,18 +87,6 @@ module Bundler
|
|
112
87
|
obj.to_s
|
113
88
|
end
|
114
89
|
|
115
|
-
def configuration
|
116
|
-
require_relative "psyched_yaml"
|
117
|
-
Gem.configuration
|
118
|
-
rescue Gem::SystemExitException, LoadError => e
|
119
|
-
Bundler.ui.error "#{e.class}: #{e.message}"
|
120
|
-
Bundler.ui.trace e
|
121
|
-
raise
|
122
|
-
rescue YamlLibrarySyntaxError => e
|
123
|
-
raise YamlSyntaxError.new(e, "Your RubyGems configuration, which is " \
|
124
|
-
"usually located in ~/.gemrc, contains invalid YAML syntax.")
|
125
|
-
end
|
126
|
-
|
127
90
|
def ruby_engine
|
128
91
|
Gem.ruby_engine
|
129
92
|
end
|
@@ -136,29 +99,6 @@ module Bundler
|
|
136
99
|
Gem::Util.inflate(obj)
|
137
100
|
end
|
138
101
|
|
139
|
-
def correct_for_windows_path(path)
|
140
|
-
if Gem::Util.respond_to?(:correct_for_windows_path)
|
141
|
-
Gem::Util.correct_for_windows_path(path)
|
142
|
-
elsif path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":"
|
143
|
-
path[1..-1]
|
144
|
-
else
|
145
|
-
path
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
def sources=(val)
|
150
|
-
# Gem.configuration creates a new Gem::ConfigFile, which by default will read ~/.gemrc
|
151
|
-
# If that file exists, its settings (including sources) will overwrite the values we
|
152
|
-
# are about to set here. In order to avoid that, we force memoizing the config file now.
|
153
|
-
configuration
|
154
|
-
|
155
|
-
Gem.sources = val
|
156
|
-
end
|
157
|
-
|
158
|
-
def sources
|
159
|
-
Gem.sources
|
160
|
-
end
|
161
|
-
|
162
102
|
def gem_dir
|
163
103
|
Gem.dir
|
164
104
|
end
|
@@ -194,7 +134,7 @@ module Bundler
|
|
194
134
|
def spec_cache_dirs
|
195
135
|
@spec_cache_dirs ||= begin
|
196
136
|
dirs = gem_path.map {|dir| File.join(dir, "specifications") }
|
197
|
-
dirs << Gem.spec_cache_dir
|
137
|
+
dirs << Gem.spec_cache_dir
|
198
138
|
dirs.uniq.select {|dir| File.directory? dir }
|
199
139
|
end
|
200
140
|
end
|
@@ -216,18 +156,6 @@ module Bundler
|
|
216
156
|
loaded_gem_paths.flatten
|
217
157
|
end
|
218
158
|
|
219
|
-
def load_plugins
|
220
|
-
Gem.load_plugins if Gem.respond_to?(:load_plugins)
|
221
|
-
end
|
222
|
-
|
223
|
-
def load_plugin_files(files)
|
224
|
-
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
|
225
|
-
end
|
226
|
-
|
227
|
-
def load_env_plugins
|
228
|
-
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
|
229
|
-
end
|
230
|
-
|
231
159
|
def ui=(obj)
|
232
160
|
Gem::DefaultUserInteraction.ui = obj
|
233
161
|
end
|
@@ -236,32 +164,9 @@ module Bundler
|
|
236
164
|
EXT_LOCK
|
237
165
|
end
|
238
166
|
|
239
|
-
def
|
240
|
-
|
241
|
-
|
242
|
-
begin
|
243
|
-
self.build_args = args
|
244
|
-
yield
|
245
|
-
ensure
|
246
|
-
self.build_args = old_args
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
250
|
-
|
251
|
-
def spec_from_gem(path, policy = nil)
|
252
|
-
require "rubygems/security"
|
253
|
-
require_relative "psyched_yaml"
|
254
|
-
gem_from_path(path, security_policies[policy]).spec
|
255
|
-
rescue Exception, Gem::Exception, Gem::Security::Exception => e # rubocop:disable Lint/RescueException
|
256
|
-
if e.is_a?(Gem::Security::Exception) ||
|
257
|
-
e.message =~ /unknown trust policy|unsigned gem/i ||
|
258
|
-
e.message =~ /couldn't verify (meta)?data signature/i
|
259
|
-
raise SecurityError,
|
260
|
-
"The gem #{File.basename(path, ".gem")} can't be installed because " \
|
261
|
-
"the security policy didn't allow it, with the message: #{e.message}"
|
262
|
-
else
|
263
|
-
raise e
|
264
|
-
end
|
167
|
+
def spec_from_gem(path)
|
168
|
+
require "rubygems/package"
|
169
|
+
Gem::Package.new(path).spec
|
265
170
|
end
|
266
171
|
|
267
172
|
def build_gem(gem_dir, spec)
|
@@ -283,23 +188,23 @@ module Bundler
|
|
283
188
|
|
284
189
|
def reverse_rubygems_kernel_mixin
|
285
190
|
# Disable rubygems' gem activation system
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
191
|
+
if Gem.respond_to?(:discover_gems_on_require=)
|
192
|
+
Gem.discover_gems_on_require = false
|
193
|
+
else
|
194
|
+
[::Kernel.singleton_class, ::Kernel].each do |k|
|
195
|
+
if k.private_method_defined?(:gem_original_require)
|
196
|
+
redefine_method(k, :require, k.instance_method(:gem_original_require))
|
197
|
+
end
|
290
198
|
end
|
291
199
|
end
|
292
200
|
end
|
293
201
|
|
294
202
|
def replace_gem(specs, specs_by_name)
|
295
|
-
reverse_rubygems_kernel_mixin
|
296
|
-
|
297
203
|
executables = nil
|
298
204
|
|
299
|
-
|
300
|
-
[kernel, ::Kernel].each do |kernel_class|
|
205
|
+
[::Kernel.singleton_class, ::Kernel].each do |kernel_class|
|
301
206
|
redefine_method(kernel_class, :gem) do |dep, *reqs|
|
302
|
-
if executables
|
207
|
+
if executables&.include?(File.basename(caller_locations(1, 1).first.path))
|
303
208
|
break
|
304
209
|
end
|
305
210
|
|
@@ -328,11 +233,7 @@ module Bundler
|
|
328
233
|
|
329
234
|
e = Gem::LoadError.new(message)
|
330
235
|
e.name = dep.name
|
331
|
-
|
332
|
-
e.requirement = dep.requirement
|
333
|
-
elsif e.respond_to?(:version_requirement=)
|
334
|
-
e.version_requirement = dep.requirement
|
335
|
-
end
|
236
|
+
e.requirement = dep.requirement
|
336
237
|
raise e
|
337
238
|
end
|
338
239
|
|
@@ -414,6 +315,14 @@ module Bundler
|
|
414
315
|
def replace_entrypoints(specs)
|
415
316
|
specs_by_name = add_default_gems_to(specs)
|
416
317
|
|
318
|
+
reverse_rubygems_kernel_mixin
|
319
|
+
begin
|
320
|
+
# bundled_gems only provide with Ruby 3.3 or later
|
321
|
+
require "bundled_gems"
|
322
|
+
rescue LoadError
|
323
|
+
else
|
324
|
+
Gem::BUNDLED_GEMS.replace_require(specs) if Gem::BUNDLED_GEMS.respond_to?(:replace_require)
|
325
|
+
end
|
417
326
|
replace_gem(specs, specs_by_name)
|
418
327
|
stub_rubygems(specs)
|
419
328
|
replace_bin_path(specs_by_name)
|
@@ -503,110 +412,92 @@ module Bundler
|
|
503
412
|
Gem::Specification.all = specs
|
504
413
|
end
|
505
414
|
|
506
|
-
def fetch_specs(remote, name)
|
415
|
+
def fetch_specs(remote, name, fetcher)
|
416
|
+
require "rubygems/remote_fetcher"
|
507
417
|
path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
|
508
|
-
fetcher = gem_remote_fetcher
|
509
|
-
fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
|
510
418
|
string = fetcher.fetch_path(path)
|
511
|
-
Bundler.
|
512
|
-
|
419
|
+
specs = Bundler.safe_load_marshal(string)
|
420
|
+
raise MarshalError, "Specs #{name} from #{remote} is expected to be an Array but was unexpected class #{specs.class}" unless specs.is_a?(Array)
|
421
|
+
specs
|
422
|
+
rescue Gem::RemoteFetcher::FetchError
|
513
423
|
# it's okay for prerelease to fail
|
514
|
-
raise
|
424
|
+
raise unless name == "prerelease_specs"
|
515
425
|
end
|
516
426
|
|
517
|
-
def fetch_all_remote_specs(remote)
|
518
|
-
specs = fetch_specs(remote, "specs")
|
519
|
-
pres = fetch_specs(remote, "prerelease_specs") || []
|
427
|
+
def fetch_all_remote_specs(remote, gem_remote_fetcher)
|
428
|
+
specs = fetch_specs(remote, "specs", gem_remote_fetcher)
|
429
|
+
pres = fetch_specs(remote, "prerelease_specs", gem_remote_fetcher) || []
|
520
430
|
|
521
431
|
specs.concat(pres)
|
522
432
|
end
|
523
433
|
|
524
|
-
def download_gem(spec, uri,
|
434
|
+
def download_gem(spec, uri, cache_dir, fetcher)
|
435
|
+
require "rubygems/remote_fetcher"
|
525
436
|
uri = Bundler.settings.mirror_for(uri)
|
526
|
-
fetcher = gem_remote_fetcher
|
527
|
-
fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
|
528
437
|
Bundler::Retry.new("download gem from #{uri}").attempts do
|
529
|
-
|
438
|
+
gem_file_name = spec.file_name
|
439
|
+
local_gem_path = File.join cache_dir, gem_file_name
|
440
|
+
return if File.exist? local_gem_path
|
441
|
+
|
442
|
+
begin
|
443
|
+
remote_gem_path = uri + "gems/#{gem_file_name}"
|
444
|
+
|
445
|
+
SharedHelpers.filesystem_access(local_gem_path) do
|
446
|
+
fetcher.cache_update_path remote_gem_path, local_gem_path
|
447
|
+
end
|
448
|
+
rescue Gem::RemoteFetcher::FetchError
|
449
|
+
raise if spec.original_platform == spec.platform
|
450
|
+
|
451
|
+
original_gem_file_name = "#{spec.original_name}.gem"
|
452
|
+
raise if gem_file_name == original_gem_file_name
|
453
|
+
|
454
|
+
gem_file_name = original_gem_file_name
|
455
|
+
retry
|
456
|
+
end
|
530
457
|
end
|
531
458
|
rescue Gem::RemoteFetcher::FetchError => e
|
532
459
|
raise Bundler::HTTPError, "Could not download gem from #{uri} due to underlying error <#{e.message}>"
|
533
460
|
end
|
534
461
|
|
535
|
-
def gem_remote_fetcher
|
536
|
-
require "rubygems/remote_fetcher"
|
537
|
-
proxy = configuration[:http_proxy]
|
538
|
-
Gem::RemoteFetcher.new(proxy)
|
539
|
-
end
|
540
|
-
|
541
|
-
def gem_from_path(path, policy = nil)
|
542
|
-
require "rubygems/package"
|
543
|
-
p = Gem::Package.new(path)
|
544
|
-
p.security_policy = policy if policy
|
545
|
-
p
|
546
|
-
end
|
547
|
-
|
548
462
|
def build(spec, skip_validation = false)
|
549
463
|
require "rubygems/package"
|
550
464
|
Gem::Package.build(spec, skip_validation)
|
551
465
|
end
|
552
466
|
|
553
|
-
def repository_subdirectories
|
554
|
-
Gem::REPOSITORY_SUBDIRECTORIES
|
555
|
-
end
|
556
|
-
|
557
|
-
def install_with_build_args(args)
|
558
|
-
yield
|
559
|
-
end
|
560
|
-
|
561
467
|
def path_separator
|
562
468
|
Gem.path_separator
|
563
469
|
end
|
564
470
|
|
565
471
|
def all_specs
|
472
|
+
SharedHelpers.major_deprecation 2, "Bundler.rubygems.all_specs has been removed in favor of Bundler.rubygems.installed_specs"
|
473
|
+
|
566
474
|
Gem::Specification.stubs.map do |stub|
|
567
475
|
StubSpecification.from_stub(stub)
|
568
476
|
end
|
569
477
|
end
|
570
478
|
|
571
|
-
def
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
RUBY
|
577
|
-
|
578
|
-
require "rubygems/ext/builder"
|
579
|
-
|
580
|
-
Gem::Ext::Builder.class_eval do
|
581
|
-
unless const_defined?(:CHDIR_MONITOR)
|
582
|
-
const_set(:CHDIR_MONITOR, EXT_LOCK)
|
583
|
-
end
|
479
|
+
def installed_specs
|
480
|
+
Gem::Specification.stubs.reject(&:default_gem?).map do |stub|
|
481
|
+
StubSpecification.from_stub(stub)
|
482
|
+
end
|
483
|
+
end
|
584
484
|
|
585
|
-
|
586
|
-
|
485
|
+
def default_specs
|
486
|
+
Gem::Specification.default_stubs.map do |stub|
|
487
|
+
StubSpecification.from_stub(stub)
|
587
488
|
end
|
588
489
|
end
|
589
490
|
|
590
|
-
def
|
591
|
-
|
491
|
+
def find_bundler(version)
|
492
|
+
find_name("bundler").find {|s| s.version.to_s == version }
|
592
493
|
end
|
593
494
|
|
594
|
-
|
595
|
-
|
596
|
-
Gem::Specification.default_stubs("*.gemspec")
|
597
|
-
end
|
598
|
-
else
|
599
|
-
def default_stubs
|
600
|
-
Gem::Specification.send(:default_stubs, "*.gemspec")
|
601
|
-
end
|
495
|
+
def find_name(name)
|
496
|
+
Gem::Specification.stubs_for(name).map(&:to_spec)
|
602
497
|
end
|
603
498
|
|
604
|
-
def
|
605
|
-
|
606
|
-
require_relative "gemdeps"
|
607
|
-
runtime = Bundler.setup
|
608
|
-
activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
|
609
|
-
[Gemdeps.new(runtime), activated_spec_names]
|
499
|
+
def default_stubs
|
500
|
+
Gem::Specification.default_stubs("*.gemspec")
|
610
501
|
end
|
611
502
|
end
|
612
503
|
|