bundler 1.11.1 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2125 -840
- data/LICENSE.md +18 -19
- data/README.md +33 -11
- data/bundler.gemspec +34 -21
- data/exe/bundle +36 -6
- data/exe/bundler +2 -18
- data/lib/bundler.rb +435 -160
- data/lib/bundler/build_metadata.rb +45 -0
- data/lib/bundler/capistrano.rb +9 -3
- data/lib/bundler/cli.rb +550 -130
- data/lib/bundler/cli/add.rb +47 -0
- data/lib/bundler/cli/binstubs.rb +26 -10
- data/lib/bundler/cli/cache.rb +25 -17
- data/lib/bundler/cli/check.rb +8 -7
- data/lib/bundler/cli/clean.rb +8 -8
- data/lib/bundler/cli/common.rb +69 -9
- data/lib/bundler/cli/config.rb +170 -76
- data/lib/bundler/cli/console.rb +6 -1
- data/lib/bundler/cli/doctor.rb +140 -0
- data/lib/bundler/cli/exec.rb +63 -21
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +158 -42
- data/lib/bundler/cli/info.rb +73 -0
- data/lib/bundler/cli/init.rb +22 -7
- data/lib/bundler/cli/inject.rb +38 -10
- data/lib/bundler/cli/install.rb +139 -104
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +60 -0
- data/lib/bundler/cli/lock.rb +27 -5
- data/lib/bundler/cli/open.rb +13 -5
- data/lib/bundler/cli/outdated.rb +251 -46
- data/lib/bundler/cli/platform.rb +6 -2
- data/lib/bundler/cli/plugin.rb +41 -0
- data/lib/bundler/cli/pristine.rb +52 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +5 -4
- data/lib/bundler/cli/update.rb +67 -26
- data/lib/bundler/cli/viz.rb +11 -6
- data/lib/bundler/compact_index_client.rb +125 -0
- data/lib/bundler/compact_index_client/cache.rb +110 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +104 -0
- data/lib/bundler/constants.rb +2 -0
- data/lib/bundler/current_ruby.rb +51 -174
- data/lib/bundler/definition.rb +533 -216
- data/lib/bundler/dep_proxy.rb +18 -8
- data/lib/bundler/dependency.rb +39 -12
- data/lib/bundler/deployment.rb +7 -0
- data/lib/bundler/deprecate.rb +31 -2
- data/lib/bundler/dsl.rb +188 -91
- data/lib/bundler/endpoint_specification.rb +51 -10
- data/lib/bundler/env.rb +116 -48
- data/lib/bundler/environment_preserver.rb +82 -0
- data/lib/bundler/errors.rb +108 -31
- data/lib/bundler/feature_flag.rb +60 -0
- data/lib/bundler/fetcher.rb +81 -52
- data/lib/bundler/fetcher/base.rb +15 -3
- data/lib/bundler/fetcher/compact_index.rb +140 -0
- data/lib/bundler/fetcher/dependency.rb +36 -42
- data/lib/bundler/fetcher/downloader.rb +39 -12
- data/lib/bundler/fetcher/index.rb +34 -9
- data/lib/bundler/friendly_errors.rb +132 -88
- data/lib/bundler/gem_helper.rb +92 -50
- data/lib/bundler/gem_helpers.rb +90 -5
- data/lib/bundler/gem_tasks.rb +3 -1
- data/lib/bundler/gem_version_promoter.rb +190 -0
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +20 -41
- data/lib/bundler/index.rb +74 -57
- data/lib/bundler/injector.rb +242 -31
- data/lib/bundler/inline.rb +49 -23
- data/lib/bundler/installer.rb +190 -74
- data/lib/bundler/installer/gem_installer.rb +33 -20
- data/lib/bundler/installer/parallel_installer.rb +201 -97
- data/lib/bundler/installer/standalone.rb +10 -6
- data/lib/bundler/lazy_specification.rb +74 -10
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +126 -74
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/lib/bundler/man/bundle-add.1 +66 -0
- data/lib/bundler/man/bundle-add.1.ronn +46 -0
- data/lib/bundler/man/bundle-binstubs.1 +42 -0
- data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -16
- data/lib/bundler/man/bundle-check.1 +31 -0
- data/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/lib/bundler/man/bundle-clean.1 +24 -0
- data/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/lib/bundler/man/bundle-config.1 +488 -0
- data/lib/bundler/man/bundle-config.1.ronn +388 -0
- data/lib/bundler/man/bundle-doctor.1 +44 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/lib/bundler/man/bundle-exec.1 +165 -0
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +20 -4
- data/lib/bundler/man/bundle-gem.1 +102 -0
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +37 -13
- data/lib/bundler/man/bundle-info.1 +20 -0
- data/lib/bundler/man/bundle-info.1.ronn +17 -0
- data/lib/bundler/man/bundle-init.1 +25 -0
- data/lib/bundler/man/bundle-init.1.ronn +29 -0
- data/lib/bundler/man/bundle-inject.1 +33 -0
- data/lib/bundler/man/bundle-inject.1.ronn +22 -0
- data/lib/bundler/man/bundle-install.1 +338 -0
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +82 -76
- data/lib/bundler/man/bundle-list.1 +50 -0
- data/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/lib/bundler/man/bundle-lock.1 +84 -0
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +47 -0
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/lib/bundler/man/bundle-open.1.ronn +19 -0
- data/lib/bundler/man/bundle-outdated.1 +155 -0
- data/lib/bundler/man/bundle-outdated.1.ronn +111 -0
- data/lib/bundler/man/bundle-platform.1 +61 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +1 -1
- data/lib/bundler/man/bundle-pristine.1 +34 -0
- data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/lib/bundler/man/bundle-remove.1 +31 -0
- data/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/lib/bundler/man/bundle-show.1 +23 -0
- data/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/lib/bundler/man/bundle-update.1 +394 -0
- data/lib/bundler/man/bundle-update.1.ronn +350 -0
- data/lib/bundler/man/bundle-viz.1 +39 -0
- data/lib/bundler/man/bundle-viz.1.ronn +30 -0
- data/lib/bundler/man/bundle.1 +136 -0
- data/lib/bundler/man/bundle.1.ronn +111 -0
- data/lib/bundler/man/gemfile.5 +686 -0
- data/{man → lib/bundler/man}/gemfile.5.ronn +117 -95
- data/lib/bundler/man/index.txt +25 -0
- data/lib/bundler/match_platform.rb +15 -4
- data/lib/bundler/mirror.rb +223 -0
- data/lib/bundler/plugin.rb +330 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/api/source.rb +304 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +182 -0
- data/lib/bundler/plugin/installer.rb +109 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +27 -0
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +2 -6
- data/lib/bundler/remote_specification.rb +42 -9
- data/lib/bundler/resolver.rb +312 -225
- data/lib/bundler/resolver/spec_group.rb +122 -0
- data/lib/bundler/retry.rb +11 -5
- data/lib/bundler/ruby_dsl.rb +9 -2
- data/lib/bundler/ruby_version.rb +84 -61
- data/lib/bundler/rubygems_ext.rb +92 -53
- data/lib/bundler/rubygems_gem_installer.rb +84 -0
- data/lib/bundler/rubygems_integration.rb +320 -395
- data/lib/bundler/runtime.rb +87 -75
- data/lib/bundler/settings.rb +297 -119
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +13 -12
- data/lib/bundler/shared_helpers.rb +234 -53
- data/lib/bundler/similarity_detector.rb +5 -3
- data/lib/bundler/source.rb +63 -4
- data/lib/bundler/source/gemspec.rb +18 -0
- data/lib/bundler/source/git.rb +97 -50
- data/lib/bundler/source/git/git_proxy.rb +138 -65
- data/lib/bundler/source/metadata.rb +67 -0
- data/lib/bundler/source/path.rb +83 -47
- data/lib/bundler/source/path/installer.rb +42 -11
- data/lib/bundler/source/rubygems.rb +231 -116
- data/lib/bundler/source/rubygems/remote.rb +30 -1
- data/lib/bundler/source_list.rb +103 -21
- data/lib/bundler/spec_set.rb +96 -51
- data/lib/bundler/stub_specification.rb +87 -4
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +14 -1
- data/lib/bundler/templates/Executable.bundler +114 -0
- data/lib/bundler/templates/Executable.standalone +6 -4
- data/lib/bundler/templates/Gemfile +4 -1
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +79 -44
- data/lib/bundler/templates/newgem/Gemfile.tt +18 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +16 -10
- data/lib/bundler/templates/newgem/Rakefile.tt +22 -8
- data/lib/bundler/templates/newgem/bin/console.tt +2 -1
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/lib/bundler/templates/newgem/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +6 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -28
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +4 -4
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -2
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
- data/lib/bundler/ui.rb +5 -3
- data/lib/bundler/ui/rg_proxy.rb +3 -1
- data/lib/bundler/ui/shell.rb +54 -21
- data/lib/bundler/ui/silent.rb +26 -1
- data/lib/bundler/uri_credentials_filter.rb +43 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1764 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +113 -134
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +158 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +82 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +4 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +6 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +555 -150
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +6 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +19 -12
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +310 -467
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +58 -25
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +50 -33
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +5 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +9 -19
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +79 -22
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +33 -20
- data/lib/bundler/vendor/thor/lib/thor/base.rb +110 -67
- data/lib/bundler/vendor/thor/lib/thor/command.rb +33 -24
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/error.rb +81 -3
- data/lib/bundler/vendor/thor/lib/thor/group.rb +16 -16
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +18 -18
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +60 -26
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +31 -13
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +42 -39
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +109 -39
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_fileutils.rb +4 -0
- data/lib/bundler/vendored_molinillo.rb +3 -1
- data/lib/bundler/vendored_persistent.rb +45 -9
- data/lib/bundler/vendored_thor.rb +8 -3
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +7 -4
- data/lib/bundler/version_ranges.rb +122 -0
- data/lib/bundler/vlad.rb +8 -2
- data/lib/bundler/worker.rb +38 -6
- data/lib/bundler/yaml_serializer.rb +89 -0
- metadata +164 -158
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -105
- data/.rubocop_todo.yml +0 -120
- data/.travis.yml +0 -97
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -32
- data/DEVELOPMENT.md +0 -118
- data/ISSUES.md +0 -96
- data/Rakefile +0 -309
- data/bin/rake +0 -14
- data/bin/rspec +0 -10
- data/bin/rubocop +0 -11
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -45
- data/lib/bundler/environment.rb +0 -41
- data/lib/bundler/gem_path_manipulation.rb +0 -8
- data/lib/bundler/gem_remote_fetcher.rb +0 -41
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -64
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/net/http/faster.rb +0 -26
- data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -128
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -10
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -98
- data/man/bundle-config.ronn +0 -187
- data/man/bundle-update.ronn +0 -188
- data/man/bundle.ronn +0 -98
- data/man/index.txt +0 -8
@@ -0,0 +1,122 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Resolver
|
5
|
+
class SpecGroup
|
6
|
+
include GemHelpers
|
7
|
+
|
8
|
+
attr_accessor :name, :version, :source
|
9
|
+
attr_accessor :ignores_bundler_dependencies, :activated_platforms
|
10
|
+
|
11
|
+
def initialize(all_specs)
|
12
|
+
@all_specs = all_specs
|
13
|
+
raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
|
14
|
+
@name = exemplary_spec.name
|
15
|
+
@version = exemplary_spec.version
|
16
|
+
@source = exemplary_spec.source
|
17
|
+
|
18
|
+
@activated_platforms = []
|
19
|
+
@dependencies = nil
|
20
|
+
@specs = Hash.new do |specs, platform|
|
21
|
+
specs[platform] = select_best_platform_match(all_specs, platform)
|
22
|
+
end
|
23
|
+
@ignores_bundler_dependencies = true
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_specs
|
27
|
+
@activated_platforms.map do |p|
|
28
|
+
specs = @specs[p]
|
29
|
+
next unless specs.any?
|
30
|
+
|
31
|
+
specs.map do |s|
|
32
|
+
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
33
|
+
lazy_spec.dependencies.replace s.dependencies
|
34
|
+
lazy_spec
|
35
|
+
end
|
36
|
+
end.flatten.compact.uniq
|
37
|
+
end
|
38
|
+
|
39
|
+
def copy_for(platforms)
|
40
|
+
platforms.select! {|p| for?(p) }
|
41
|
+
return unless platforms.any?
|
42
|
+
|
43
|
+
copied_sg = self.class.new(@all_specs)
|
44
|
+
copied_sg.ignores_bundler_dependencies = @ignores_bundler_dependencies
|
45
|
+
copied_sg.activated_platforms = platforms
|
46
|
+
copied_sg
|
47
|
+
end
|
48
|
+
|
49
|
+
def for?(platform)
|
50
|
+
@specs[platform].any?
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_s
|
54
|
+
activated_platforms_string = sorted_activated_platforms.join(", ")
|
55
|
+
"#{name} (#{version}) (#{activated_platforms_string})"
|
56
|
+
end
|
57
|
+
|
58
|
+
def dependencies_for_activated_platforms
|
59
|
+
dependencies = @activated_platforms.map {|p| __dependencies[p] }
|
60
|
+
metadata_dependencies = @activated_platforms.map do |platform|
|
61
|
+
metadata_dependencies(@specs[platform].first, platform)
|
62
|
+
end
|
63
|
+
dependencies.concat(metadata_dependencies).flatten
|
64
|
+
end
|
65
|
+
|
66
|
+
def ==(other)
|
67
|
+
return unless other.is_a?(SpecGroup)
|
68
|
+
name == other.name &&
|
69
|
+
version == other.version &&
|
70
|
+
sorted_activated_platforms == other.sorted_activated_platforms &&
|
71
|
+
source == other.source
|
72
|
+
end
|
73
|
+
|
74
|
+
def eql?(other)
|
75
|
+
return unless other.is_a?(SpecGroup)
|
76
|
+
name.eql?(other.name) &&
|
77
|
+
version.eql?(other.version) &&
|
78
|
+
sorted_activated_platforms.eql?(other.sorted_activated_platforms) &&
|
79
|
+
source.eql?(other.source)
|
80
|
+
end
|
81
|
+
|
82
|
+
def hash
|
83
|
+
name.hash ^ version.hash ^ sorted_activated_platforms.hash ^ source.hash
|
84
|
+
end
|
85
|
+
|
86
|
+
protected
|
87
|
+
|
88
|
+
def sorted_activated_platforms
|
89
|
+
@activated_platforms.sort_by(&:to_s)
|
90
|
+
end
|
91
|
+
|
92
|
+
private
|
93
|
+
|
94
|
+
def __dependencies
|
95
|
+
@dependencies = Hash.new do |dependencies, platform|
|
96
|
+
dependencies[platform] = []
|
97
|
+
specs = @specs[platform]
|
98
|
+
if spec = specs.first
|
99
|
+
spec.dependencies.each do |dep|
|
100
|
+
next if dep.type == :development
|
101
|
+
next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
|
102
|
+
dependencies[platform] << DepProxy.get_proxy(dep, platform)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
dependencies[platform]
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def metadata_dependencies(spec, platform)
|
110
|
+
return [] unless spec && spec.is_a?(Gem::Specification)
|
111
|
+
dependencies = []
|
112
|
+
if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
|
113
|
+
dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
|
114
|
+
end
|
115
|
+
if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
|
116
|
+
dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
|
117
|
+
end
|
118
|
+
dependencies
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
data/lib/bundler/retry.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
# General purpose class for retrying code that may fail
|
3
5
|
class Retry
|
@@ -30,21 +32,25 @@ module Bundler
|
|
30
32
|
end
|
31
33
|
alias_method :attempts, :attempt
|
32
34
|
|
33
|
-
|
35
|
+
private
|
34
36
|
|
35
37
|
def run(&block)
|
36
|
-
@failed
|
38
|
+
@failed = false
|
37
39
|
@current_run += 1
|
38
40
|
@result = block.call
|
39
|
-
rescue => e
|
41
|
+
rescue StandardError => e
|
40
42
|
fail_attempt(e)
|
41
43
|
end
|
42
44
|
|
43
45
|
def fail_attempt(e)
|
44
46
|
@failed = true
|
45
|
-
|
47
|
+
if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
|
48
|
+
Bundler.ui.info "" unless Bundler.ui.debug?
|
49
|
+
raise e
|
50
|
+
end
|
46
51
|
return true unless name
|
47
|
-
Bundler.ui.
|
52
|
+
Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this
|
53
|
+
Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
|
48
54
|
end
|
49
55
|
|
50
56
|
def keep_trying?
|
data/lib/bundler/ruby_dsl.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
module RubyDsl
|
3
|
-
def ruby(ruby_version
|
5
|
+
def ruby(*ruby_version)
|
6
|
+
options = ruby_version.last.is_a?(Hash) ? ruby_version.pop : {}
|
7
|
+
ruby_version.flatten!
|
4
8
|
raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
|
5
9
|
raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
|
6
10
|
|
7
|
-
|
11
|
+
if options[:engine] == "ruby" && options[:engine_version] &&
|
12
|
+
ruby_version != Array(options[:engine_version])
|
13
|
+
raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
|
14
|
+
end
|
8
15
|
@ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
|
9
16
|
end
|
10
17
|
end
|
data/lib/bundler/ruby_version.rb
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
class RubyVersion
|
3
|
-
attr_reader :
|
5
|
+
attr_reader :versions,
|
6
|
+
:patchlevel,
|
7
|
+
:engine,
|
8
|
+
:engine_versions,
|
9
|
+
:gem_version,
|
10
|
+
:engine_gem_version
|
4
11
|
|
5
|
-
def initialize(
|
12
|
+
def initialize(versions, patchlevel, engine, engine_version)
|
6
13
|
# The parameters to this method must satisfy the
|
7
14
|
# following constraints, which are verified in
|
8
15
|
# the DSL:
|
@@ -15,29 +22,62 @@ module Bundler
|
|
15
22
|
# must not be specified, or the engine version
|
16
23
|
# specified must match the version.
|
17
24
|
|
18
|
-
@
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@
|
25
|
+
@versions = Array(versions).map do |v|
|
26
|
+
op, v = Gem::Requirement.parse(v)
|
27
|
+
op == "=" ? v.to_s : "#{op} #{v}"
|
28
|
+
end
|
29
|
+
|
30
|
+
@gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
|
31
|
+
@input_engine = engine && engine.to_s
|
32
|
+
@engine = engine && engine.to_s || "ruby"
|
33
|
+
@engine_versions = (engine_version && Array(engine_version)) || @versions
|
34
|
+
@engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
|
35
|
+
@patchlevel = patchlevel
|
24
36
|
end
|
25
37
|
|
26
|
-
def to_s
|
27
|
-
output = "ruby #{
|
38
|
+
def to_s(versions = self.versions)
|
39
|
+
output = String.new("ruby #{versions_string(versions)}")
|
28
40
|
output << "p#{patchlevel}" if patchlevel
|
29
|
-
output << " (#{engine} #{
|
41
|
+
output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
|
30
42
|
|
31
43
|
output
|
32
44
|
end
|
33
45
|
|
46
|
+
# @private
|
47
|
+
PATTERN = /
|
48
|
+
ruby\s
|
49
|
+
([\d.]+) # ruby version
|
50
|
+
(?:p(-?\d+))? # optional patchlevel
|
51
|
+
(?:\s\((\S+)\s(.+)\))? # optional engine info
|
52
|
+
/xo.freeze
|
53
|
+
|
54
|
+
# Returns a RubyVersion from the given string.
|
55
|
+
# @param [String] the version string to match.
|
56
|
+
# @return [RubyVersion,Nil] The version if the string is a valid RubyVersion
|
57
|
+
# description, and nil otherwise.
|
58
|
+
def self.from_string(string)
|
59
|
+
new($1, $2, $3, $4) if string =~ PATTERN
|
60
|
+
end
|
61
|
+
|
62
|
+
def single_version_string
|
63
|
+
to_s(gem_version)
|
64
|
+
end
|
65
|
+
|
34
66
|
def ==(other)
|
35
|
-
|
67
|
+
versions == other.versions &&
|
36
68
|
engine == other.engine &&
|
37
|
-
|
69
|
+
engine_versions == other.engine_versions &&
|
38
70
|
patchlevel == other.patchlevel
|
39
71
|
end
|
40
72
|
|
73
|
+
def host
|
74
|
+
@host ||= [
|
75
|
+
RbConfig::CONFIG["host_cpu"],
|
76
|
+
RbConfig::CONFIG["host_vendor"],
|
77
|
+
RbConfig::CONFIG["host_os"],
|
78
|
+
].join("-")
|
79
|
+
end
|
80
|
+
|
41
81
|
# Returns a tuple of these things:
|
42
82
|
# [diff, this, other]
|
43
83
|
# The priority of attributes are
|
@@ -45,70 +85,53 @@ module Bundler
|
|
45
85
|
# 2. ruby_version
|
46
86
|
# 3. engine_version
|
47
87
|
def diff(other)
|
88
|
+
raise ArgumentError, "Can only diff with a RubyVersion, not a #{other.class}" unless other.is_a?(RubyVersion)
|
48
89
|
if engine != other.engine && @input_engine
|
49
90
|
[:engine, engine, other.engine]
|
50
|
-
elsif
|
51
|
-
[:version,
|
52
|
-
elsif
|
53
|
-
[:engine_version,
|
54
|
-
elsif patchlevel
|
91
|
+
elsif versions.empty? || !matches?(versions, other.gem_version)
|
92
|
+
[:version, versions_string(versions), versions_string(other.versions)]
|
93
|
+
elsif @input_engine && !matches?(engine_versions, other.engine_gem_version)
|
94
|
+
[:engine_version, versions_string(engine_versions), versions_string(other.engine_versions)]
|
95
|
+
elsif patchlevel && (!patchlevel.is_a?(String) || !other.patchlevel.is_a?(String) || !matches?(patchlevel, other.patchlevel))
|
55
96
|
[:patchlevel, patchlevel, other.patchlevel]
|
56
97
|
end
|
57
98
|
end
|
58
99
|
|
59
|
-
def
|
60
|
-
|
61
|
-
RbConfig::CONFIG["host_cpu"],
|
62
|
-
RbConfig::CONFIG["host_vendor"],
|
63
|
-
RbConfig::CONFIG["host_os"]
|
64
|
-
].join("-")
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
# A subclass of RubyVersion that implements version,
|
69
|
-
# engine and engine_version based upon the current
|
70
|
-
# information in the system. It can be used anywhere
|
71
|
-
# a RubyVersion object is expected, and can be
|
72
|
-
# compared with a RubyVersion object.
|
73
|
-
class SystemRubyVersion < RubyVersion
|
74
|
-
def initialize(*)
|
75
|
-
# override the default initialize, because
|
76
|
-
# we will implement version, engine and
|
77
|
-
# engine_version dynamically
|
100
|
+
def versions_string(versions)
|
101
|
+
Array(versions).join(", ")
|
78
102
|
end
|
79
103
|
|
80
|
-
def
|
81
|
-
|
82
|
-
|
104
|
+
def self.system
|
105
|
+
ruby_engine = RUBY_ENGINE.dup
|
106
|
+
ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
|
107
|
+
ruby_engine_version = RUBY_ENGINE_VERSION.dup
|
108
|
+
patchlevel = RUBY_PATCHLEVEL.to_s
|
83
109
|
|
84
|
-
|
85
|
-
@gem_version ||= Gem::Version.new(version)
|
110
|
+
@ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
|
86
111
|
end
|
87
112
|
|
88
|
-
def
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
"ruby"
|
113
|
+
def to_gem_version_with_patchlevel
|
114
|
+
@gem_version_with_patch ||= begin
|
115
|
+
Gem::Version.create("#{@gem_version}.#{@patchlevel}")
|
116
|
+
rescue ArgumentError
|
117
|
+
@gem_version
|
94
118
|
end
|
95
119
|
end
|
96
120
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
100
|
-
RUBY_VERSION.dup
|
101
|
-
when "rbx"
|
102
|
-
Rubinius::VERSION.dup
|
103
|
-
when "jruby"
|
104
|
-
JRUBY_VERSION.dup
|
105
|
-
else
|
106
|
-
raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized"
|
107
|
-
end
|
121
|
+
def exact?
|
122
|
+
return @exact if defined?(@exact)
|
123
|
+
@exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
|
108
124
|
end
|
109
125
|
|
110
|
-
|
111
|
-
|
126
|
+
private
|
127
|
+
|
128
|
+
def matches?(requirements, version)
|
129
|
+
# Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
|
130
|
+
return requirements == version if requirements.to_s == "-1" || version.to_s == "-1"
|
131
|
+
|
132
|
+
Array(requirements).all? do |requirement|
|
133
|
+
Gem::Requirement.create(requirement).satisfied_by?(Gem::Version.create(version))
|
134
|
+
end
|
112
135
|
end
|
113
136
|
end
|
114
137
|
end
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -1,29 +1,35 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
# Gem Prelude makes me a sad panda :'(
|
5
|
-
Gem::QuickLoader.load_full_rubygems_library
|
6
|
-
end
|
3
|
+
require "pathname"
|
7
4
|
|
8
|
-
require "rubygems"
|
9
5
|
require "rubygems/specification"
|
10
|
-
require "bundler/match_platform"
|
11
6
|
|
12
|
-
|
13
|
-
|
7
|
+
# Possible use in Gem::Specification#source below and require
|
8
|
+
# shouldn't be deferred.
|
9
|
+
require "rubygems/source"
|
10
|
+
|
11
|
+
require_relative "match_platform"
|
14
12
|
|
13
|
+
module Gem
|
15
14
|
class Specification
|
16
15
|
attr_accessor :remote, :location, :relative_loaded_from
|
17
16
|
|
18
|
-
remove_method :source
|
19
|
-
|
17
|
+
remove_method :source
|
18
|
+
attr_writer :source
|
19
|
+
def source
|
20
|
+
(defined?(@source) && @source) || Gem::Source::Installed.new
|
21
|
+
end
|
20
22
|
|
21
23
|
alias_method :rg_full_gem_path, :full_gem_path
|
22
24
|
alias_method :rg_loaded_from, :loaded_from
|
23
25
|
|
24
26
|
def full_gem_path
|
25
|
-
|
26
|
-
|
27
|
+
# this cannot check source.is_a?(Bundler::Plugin::API::Source)
|
28
|
+
# because that _could_ trip the autoload, and if there are unresolved
|
29
|
+
# gems at that time, this method could be called inside another require,
|
30
|
+
# thus raising with that constant being undefined. Better to check a method
|
31
|
+
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
|
32
|
+
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
27
33
|
else
|
28
34
|
rg_full_gem_path
|
29
35
|
end
|
@@ -38,32 +44,20 @@ module Gem
|
|
38
44
|
end
|
39
45
|
|
40
46
|
def load_paths
|
41
|
-
|
42
|
-
|
43
|
-
require_paths.map do |require_path|
|
44
|
-
if require_path.include?(full_gem_path)
|
45
|
-
require_path
|
46
|
-
else
|
47
|
-
File.join(full_gem_path, require_path)
|
48
|
-
end
|
49
|
-
end
|
47
|
+
full_require_paths
|
50
48
|
end
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
end
|
50
|
+
alias_method :rg_extension_dir, :extension_dir
|
51
|
+
def extension_dir
|
52
|
+
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
|
53
|
+
unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
|
54
|
+
File.expand_path(File.join(extensions_dir, unique_extension_dir))
|
55
|
+
else
|
56
|
+
rg_extension_dir
|
60
57
|
end
|
61
58
|
end
|
62
59
|
|
63
|
-
|
64
|
-
methods = instance_methods(false)
|
65
|
-
gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
|
66
|
-
remove_method :gem_dir if methods.include?(gem_dir)
|
60
|
+
remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
|
67
61
|
def gem_dir
|
68
62
|
full_gem_path
|
69
63
|
end
|
@@ -78,7 +72,7 @@ module Gem
|
|
78
72
|
end
|
79
73
|
|
80
74
|
def to_gemfile(path = nil)
|
81
|
-
gemfile = "source 'https://rubygems.org'\n"
|
75
|
+
gemfile = String.new("source 'https://rubygems.org'\n")
|
82
76
|
gemfile << dependencies_to_gemfile(nondevelopment_dependencies)
|
83
77
|
unless development_dependencies.empty?
|
84
78
|
gemfile << "\n"
|
@@ -91,10 +85,10 @@ module Gem
|
|
91
85
|
dependencies - development_dependencies
|
92
86
|
end
|
93
87
|
|
94
|
-
|
88
|
+
private
|
95
89
|
|
96
90
|
def dependencies_to_gemfile(dependencies, group = nil)
|
97
|
-
gemfile =
|
91
|
+
gemfile = String.new
|
98
92
|
if dependencies.any?
|
99
93
|
gemfile << "group :#{group} do\n" if group
|
100
94
|
dependencies.each do |dependency|
|
@@ -111,7 +105,7 @@ module Gem
|
|
111
105
|
end
|
112
106
|
|
113
107
|
class Dependency
|
114
|
-
attr_accessor :source, :groups
|
108
|
+
attr_accessor :source, :groups, :all_sources
|
115
109
|
|
116
110
|
alias_method :eql?, :==
|
117
111
|
|
@@ -122,33 +116,62 @@ module Gem
|
|
122
116
|
end
|
123
117
|
|
124
118
|
def to_yaml_properties
|
125
|
-
instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
|
119
|
+
instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
|
126
120
|
end
|
127
121
|
|
128
122
|
def to_lock
|
129
|
-
out = " #{name}"
|
130
|
-
unless requirement
|
123
|
+
out = String.new(" #{name}")
|
124
|
+
unless requirement.none?
|
131
125
|
reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
|
132
126
|
out << " (#{reqs.join(", ")})"
|
133
127
|
end
|
134
128
|
out
|
135
129
|
end
|
130
|
+
end
|
136
131
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
132
|
+
# comparison is done order independently since rubygems 3.2.0.rc.2
|
133
|
+
unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
|
134
|
+
class Requirement
|
135
|
+
module OrderIndependentComparison
|
136
|
+
def ==(other)
|
137
|
+
if _requirements_sorted? && other._requirements_sorted?
|
138
|
+
super
|
139
|
+
else
|
140
|
+
_with_sorted_requirements == other._with_sorted_requirements
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
protected
|
145
|
+
|
146
|
+
def _requirements_sorted?
|
147
|
+
return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
|
148
|
+
strings = as_list
|
149
|
+
@_are_requirements_sorted = strings == strings.sort
|
150
|
+
end
|
142
151
|
|
143
|
-
|
144
|
-
|
152
|
+
def _with_sorted_requirements
|
153
|
+
@_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
prepend OrderIndependentComparison
|
158
|
+
end
|
145
159
|
end
|
146
160
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
161
|
+
if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
|
162
|
+
class Requirement
|
163
|
+
module CorrectHashForLambdaOperator
|
164
|
+
def hash
|
165
|
+
if requirements.any? {|r| r.first == "~>" }
|
166
|
+
requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
|
167
|
+
else
|
168
|
+
super
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
prepend CorrectHashForLambdaOperator
|
174
|
+
end
|
152
175
|
end
|
153
176
|
|
154
177
|
class Platform
|
@@ -166,6 +189,22 @@ module Gem
|
|
166
189
|
undef_method :eql? if method_defined? :eql?
|
167
190
|
alias_method :eql?, :==
|
168
191
|
end
|
192
|
+
|
193
|
+
require "rubygems/util"
|
194
|
+
|
195
|
+
Util.singleton_class.module_eval do
|
196
|
+
if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
|
197
|
+
remove_method :glob_files_in_dir
|
198
|
+
end
|
199
|
+
|
200
|
+
def glob_files_in_dir(glob, base_path)
|
201
|
+
if RUBY_VERSION >= "2.5"
|
202
|
+
Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
|
203
|
+
else
|
204
|
+
Dir.glob(File.join(base_path.to_s.gsub(/[\[\]]/, '\\\\\\&'), glob)).map! {|f| File.expand_path(f) }
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
169
208
|
end
|
170
209
|
|
171
210
|
module Gem
|