bundler 2.6.9 → 4.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2212 -1879
- data/README.md +11 -11
- data/bundler.gemspec +5 -5
- data/lib/bundler/build_metadata.rb +10 -11
- data/lib/bundler/capistrano.rb +1 -19
- data/lib/bundler/checksum.rb +6 -0
- data/lib/bundler/cli/add.rb +10 -0
- data/lib/bundler/cli/cache.rb +1 -12
- data/lib/bundler/cli/common.rb +21 -4
- data/lib/bundler/cli/config.rb +1 -2
- data/lib/bundler/cli/console.rb +5 -0
- data/lib/bundler/cli/exec.rb +29 -4
- data/lib/bundler/cli/gem.rb +89 -63
- data/lib/bundler/cli/install.rb +15 -90
- data/lib/bundler/cli/issue.rb +2 -2
- data/lib/bundler/cli/list.rb +33 -2
- data/lib/bundler/cli/lock.rb +5 -5
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/plugin.rb +5 -1
- data/lib/bundler/cli/pristine.rb +5 -1
- data/lib/bundler/cli/show.rb +3 -7
- data/lib/bundler/cli/update.rb +5 -5
- data/lib/bundler/cli.rb +162 -127
- data/lib/bundler/compact_index_client.rb +1 -6
- data/lib/bundler/current_ruby.rb +17 -5
- data/lib/bundler/definition.rb +199 -117
- data/lib/bundler/dependency.rb +1 -1
- data/lib/bundler/deployment.rb +1 -64
- data/lib/bundler/digest.rb +1 -1
- data/lib/bundler/dsl.rb +48 -48
- data/lib/bundler/environment_preserver.rb +1 -0
- data/lib/bundler/errors.rb +1 -5
- data/lib/bundler/feature_flag.rb +5 -35
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher/dependency.rb +9 -2
- data/lib/bundler/fetcher/downloader.rb +33 -8
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +6 -0
- data/lib/bundler/fetcher.rb +49 -19
- data/lib/bundler/friendly_errors.rb +4 -3
- data/lib/bundler/index.rb +7 -9
- data/lib/bundler/injector.rb +1 -2
- data/lib/bundler/inline.rb +9 -1
- data/lib/bundler/installer/gem_installer.rb +14 -11
- data/lib/bundler/installer/parallel_installer.rb +63 -17
- data/lib/bundler/installer.rb +6 -19
- data/lib/bundler/lazy_specification.rb +47 -20
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +11 -5
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +3 -6
- data/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
- data/lib/bundler/man/bundle-cache.1 +2 -14
- data/lib/bundler/man/bundle-cache.1.ronn +1 -14
- data/lib/bundler/man/bundle-check.1 +2 -5
- data/lib/bundler/man/bundle-check.1.ronn +0 -5
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +206 -148
- data/lib/bundler/man/bundle-config.1.ronn +135 -118
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +43 -4
- data/lib/bundler/man/bundle-doctor.1.ronn +48 -4
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +2 -5
- data/lib/bundler/man/bundle-exec.1.ronn +1 -5
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +64 -44
- data/lib/bundler/man/bundle-gem.1.ronn +10 -9
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +16 -59
- data/lib/bundler/man/bundle-install.1.ronn +27 -108
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +6 -1
- data/lib/bundler/man/bundle-list.1.ronn +5 -0
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +33 -15
- data/lib/bundler/man/bundle-plugin.1.ronn +36 -15
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +2 -8
- data/lib/bundler/man/bundle-remove.1.ronn +1 -8
- data/lib/bundler/man/bundle-show.1 +2 -5
- data/lib/bundler/man/bundle-show.1.ronn +0 -4
- data/lib/bundler/man/bundle-update.1 +5 -5
- data/lib/bundler/man/bundle-update.1.ronn +4 -4
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -10
- data/lib/bundler/man/bundle.1.ronn +0 -9
- data/lib/bundler/man/gemfile.5 +32 -1
- data/lib/bundler/man/gemfile.5.ronn +28 -0
- data/lib/bundler/man/index.txt +0 -2
- data/lib/bundler/match_platform.rb +31 -12
- data/lib/bundler/materialization.rb +3 -3
- data/lib/bundler/plugin/api/source.rb +8 -0
- data/lib/bundler/plugin/index.rb +6 -0
- data/lib/bundler/plugin/installer.rb +2 -11
- data/lib/bundler/plugin/source_list.rb +1 -1
- data/lib/bundler/plugin.rb +7 -4
- data/lib/bundler/resolver/package.rb +2 -1
- data/lib/bundler/resolver/strategy.rb +6 -3
- data/lib/bundler/resolver.rb +20 -4
- data/lib/bundler/retry.rb +30 -4
- data/lib/bundler/ruby_dsl.rb +17 -12
- data/lib/bundler/ruby_version.rb +1 -3
- data/lib/bundler/rubygems_ext.rb +117 -121
- data/lib/bundler/rubygems_gem_installer.rb +5 -4
- data/lib/bundler/rubygems_integration.rb +13 -12
- data/lib/bundler/runtime.rb +14 -3
- data/lib/bundler/self_manager.rb +34 -43
- data/lib/bundler/settings/validator.rb +5 -21
- data/lib/bundler/settings.rb +17 -32
- data/lib/bundler/shared_helpers.rb +12 -18
- data/lib/bundler/source/gemspec.rb +4 -0
- data/lib/bundler/source/git/git_proxy.rb +55 -29
- data/lib/bundler/source/git.rb +2 -3
- data/lib/bundler/source/path.rb +12 -7
- data/lib/bundler/source/rubygems.rb +59 -43
- data/lib/bundler/source/rubygems_aggregate.rb +4 -1
- data/lib/bundler/source.rb +3 -1
- data/lib/bundler/source_list.rb +5 -50
- data/lib/bundler/source_map.rb +8 -7
- data/lib/bundler/spec_set.rb +9 -14
- data/lib/bundler/stub_specification.rb +1 -0
- data/lib/bundler/templates/Executable +0 -11
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
- data/lib/bundler/templates/newgem/Cargo.toml.tt +6 -0
- data/lib/bundler/templates/newgem/Rakefile.tt +5 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +8 -1
- data/lib/bundler/templates/newgem/ext/newgem/build.rs.tt +5 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
- data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +13 -2
- data/lib/bundler/templates/newgem/github/workflows/build-gems.yml.tt +69 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +12 -1
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +10 -10
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +8 -0
- data/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +6 -0
- data/lib/bundler/ui/shell.rb +12 -8
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +84 -42
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
- data/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
- data/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
- data/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
- data/lib/bundler/version.rb +10 -2
- data/lib/bundler/vlad.rb +1 -14
- data/lib/bundler/worker.rb +12 -4
- data/lib/bundler.rb +20 -40
- metadata +13 -25
- data/lib/bundler/cli/inject.rb +0 -60
- data/lib/bundler/cli/viz.rb +0 -31
- data/lib/bundler/gem_helpers.rb +0 -144
- data/lib/bundler/graph.rb +0 -152
- data/lib/bundler/man/bundle-inject.1 +0 -31
- data/lib/bundler/man/bundle-inject.1.ronn +0 -32
- data/lib/bundler/man/bundle-viz.1 +0 -30
- data/lib/bundler/man/bundle-viz.1.ronn +0 -36
- data/lib/bundler/similarity_detector.rb +0 -63
- data/lib/bundler/templates/Executable.bundler +0 -109
- data/lib/bundler/vendor/connection_pool/.document +0 -1
- data/lib/bundler/vendor/fileutils/.document +0 -1
- data/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/lib/bundler/vendor/pub_grub/.document +0 -1
- data/lib/bundler/vendor/securerandom/.document +0 -1
- data/lib/bundler/vendor/thor/.document +0 -1
- data/lib/bundler/vendor/tsort/.document +0 -1
- data/lib/bundler/vendor/uri/.document +0 -1
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Bundler makes sure Ruby applications run the same code on every machine.
|
|
|
6
6
|
|
|
7
7
|
It does this by managing the gems that the application depends on. Given a list of gems, it can automatically download and install those gems, as well as any other gems needed by the gems that are listed. Before installing gems, it checks the versions of every gem to make sure that they are compatible, and can all be loaded at the same time. After the gems have been installed, Bundler can help you update some or all of them when new versions become available. Finally, it records the exact versions that have been installed, so that others can install the exact same gems.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Installation and usage
|
|
10
10
|
|
|
11
11
|
To install (or update to the latest version):
|
|
12
12
|
|
|
@@ -27,32 +27,32 @@ bundle exec rspec
|
|
|
27
27
|
|
|
28
28
|
See [bundler.io](https://bundler.io) for the full documentation.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
## Troubleshooting
|
|
31
31
|
|
|
32
32
|
For help with common problems, see [TROUBLESHOOTING](../doc/bundler/TROUBLESHOOTING.md).
|
|
33
33
|
|
|
34
|
-
Still stuck? Try [filing an issue](https://github.com/
|
|
34
|
+
Still stuck? Try [filing an issue](https://github.com/ruby/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md).
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
## Other questions
|
|
37
37
|
|
|
38
38
|
To see what has changed in recent versions of Bundler, see the [CHANGELOG](CHANGELOG.md).
|
|
39
39
|
|
|
40
40
|
To get in touch with the Bundler core team and other Bundler users, please join [the Bundler slack](https://join.slack.com/t/bundler/shared_invite/zt-1rrsuuv3m-OmXKWQf8K6iSla4~F1DBjQ).
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## Contributing
|
|
43
43
|
|
|
44
|
-
If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [the Bundler contributor guide](https://github.com/
|
|
44
|
+
If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [the Bundler contributor guide](https://github.com/ruby/rubygems/blob/master/doc/bundler/contributing/README.md) with all of the information you need to get started.
|
|
45
45
|
|
|
46
46
|
If you'd like to request a substantial change to Bundler or its documentation, refer to the [Bundler RFC process](https://github.com/rubygems/rfcs) for more information.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
## Supporting
|
|
49
49
|
|
|
50
50
|
RubyGems is managed by [Ruby Central](https://rubycentral.org), a non-profit organization that supports the Ruby community through projects like this one, as well as [RubyConf](https://rubyconf.org), [RailsConf](https://railsconf.org), and [RubyGems.org](https://rubygems.org). You can support Ruby Central by attending or [sponsoring](sponsors@rubycentral.org) a conference, or by [joining as a supporting member](https://rubycentral.org/#/portal/signup).
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
## Code of Conduct
|
|
53
53
|
|
|
54
|
-
Everyone interacting in the Bundler project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/
|
|
54
|
+
Everyone interacting in the Bundler project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/ruby/rubygems/blob/master/CODE_OF_CONDUCT.md).
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
## License
|
|
57
57
|
|
|
58
|
-
Bundler is available under an [MIT License](https://github.com/
|
|
58
|
+
Bundler is available under an [MIT License](https://github.com/ruby/rubygems/blob/master/bundler/LICENSE.md).
|
data/bundler.gemspec
CHANGED
|
@@ -23,16 +23,16 @@ Gem::Specification.new do |s|
|
|
|
23
23
|
s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably"
|
|
24
24
|
|
|
25
25
|
s.metadata = {
|
|
26
|
-
"bug_tracker_uri" => "https://github.com/
|
|
27
|
-
"changelog_uri" => "https://github.com/
|
|
26
|
+
"bug_tracker_uri" => "https://github.com/ruby/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler",
|
|
27
|
+
"changelog_uri" => "https://github.com/ruby/rubygems/blob/master/bundler/CHANGELOG.md",
|
|
28
28
|
"homepage_uri" => "https://bundler.io/",
|
|
29
|
-
"source_code_uri" => "https://github.com/
|
|
29
|
+
"source_code_uri" => "https://github.com/ruby/rubygems/tree/master/bundler",
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
s.required_ruby_version = ">= 3.
|
|
32
|
+
s.required_ruby_version = ">= 3.2.0"
|
|
33
33
|
|
|
34
34
|
# It should match the RubyGems version shipped with `required_ruby_version` above
|
|
35
|
-
s.required_rubygems_version = ">= 3.
|
|
35
|
+
s.required_rubygems_version = ">= 3.4.1"
|
|
36
36
|
|
|
37
37
|
s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
|
38
38
|
|
|
@@ -4,23 +4,27 @@ module Bundler
|
|
|
4
4
|
# Represents metadata from when the Bundler gem was built.
|
|
5
5
|
module BuildMetadata
|
|
6
6
|
# begin ivars
|
|
7
|
-
@built_at =
|
|
8
|
-
@git_commit_sha = "
|
|
9
|
-
@release = true
|
|
7
|
+
@built_at = nil
|
|
8
|
+
@git_commit_sha = "1c1d885018".freeze
|
|
10
9
|
# end ivars
|
|
11
10
|
|
|
12
11
|
# A hash representation of the build metadata.
|
|
13
12
|
def self.to_h
|
|
14
13
|
{
|
|
15
|
-
"
|
|
14
|
+
"Timestamp" => timestamp,
|
|
16
15
|
"Git SHA" => git_commit_sha,
|
|
17
|
-
"Released Version" => release?,
|
|
18
16
|
}
|
|
19
17
|
end
|
|
20
18
|
|
|
19
|
+
# A timestamp representing the date the bundler gem was built, or the
|
|
20
|
+
# current time if never built
|
|
21
|
+
def self.timestamp
|
|
22
|
+
@timestamp ||= @built_at || Time.now.utc.strftime("%Y-%m-%d").freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
21
25
|
# A string representing the date the bundler gem was built.
|
|
22
26
|
def self.built_at
|
|
23
|
-
@built_at
|
|
27
|
+
@built_at
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
# The SHA for the git commit the bundler gem was built from.
|
|
@@ -36,10 +40,5 @@ module Bundler
|
|
|
36
40
|
|
|
37
41
|
@git_commit_sha ||= "unknown"
|
|
38
42
|
end
|
|
39
|
-
|
|
40
|
-
# Whether this is an official release build of Bundler.
|
|
41
|
-
def self.release?
|
|
42
|
-
@release
|
|
43
|
-
end
|
|
44
43
|
end
|
|
45
44
|
end
|
data/lib/bundler/capistrano.rb
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "shared_helpers"
|
|
4
|
-
Bundler::SharedHelpers.
|
|
5
|
-
"The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler"
|
|
6
|
-
|
|
7
|
-
# Capistrano task for Bundler.
|
|
8
|
-
#
|
|
9
|
-
# Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
|
|
10
|
-
# Bundler will be activated after each new deployment.
|
|
11
|
-
require_relative "deployment"
|
|
12
|
-
require "capistrano/version"
|
|
13
|
-
|
|
14
|
-
if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
|
|
15
|
-
raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
|
19
|
-
before "deploy:finalize_update", "bundle:install"
|
|
20
|
-
Bundler::Deployment.define_task(self, :task, except: { no_release: true })
|
|
21
|
-
set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
|
|
22
|
-
end
|
|
4
|
+
Bundler::SharedHelpers.feature_removed! "The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler"
|
data/lib/bundler/checksum.rb
CHANGED
|
@@ -205,6 +205,12 @@ module Bundler
|
|
|
205
205
|
@store[spec.lock_name].nil?
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
+
def empty?(spec)
|
|
209
|
+
return false unless spec.source.is_a?(Bundler::Source::Rubygems)
|
|
210
|
+
|
|
211
|
+
@store[spec.lock_name].empty?
|
|
212
|
+
end
|
|
213
|
+
|
|
208
214
|
def register(spec, checksum)
|
|
209
215
|
register_checksum(spec.lock_name, checksum)
|
|
210
216
|
end
|
data/lib/bundler/cli/add.rb
CHANGED
|
@@ -36,6 +36,16 @@ module Bundler
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def validate_options!
|
|
39
|
+
raise InvalidOption, "You cannot specify `--git` and `--github` at the same time." if options["git"] && options["github"]
|
|
40
|
+
|
|
41
|
+
unless options["git"] || options["github"]
|
|
42
|
+
raise InvalidOption, "You cannot specify `--branch` unless `--git` or `--github` is specified." if options["branch"]
|
|
43
|
+
|
|
44
|
+
raise InvalidOption, "You cannot specify `--ref` unless `--git` or `--github` is specified." if options["ref"]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
raise InvalidOption, "You cannot specify `--branch` and `--ref` at the same time." if options["branch"] && options["ref"]
|
|
48
|
+
|
|
39
49
|
raise InvalidOption, "You cannot specify `--strict` and `--optimistic` at the same time." if options[:strict] && options[:optimistic]
|
|
40
50
|
|
|
41
51
|
# raise error when no gems are specified
|
data/lib/bundler/cli/cache.rb
CHANGED
|
@@ -10,17 +10,12 @@ module Bundler
|
|
|
10
10
|
|
|
11
11
|
def run
|
|
12
12
|
Bundler.ui.level = "warn" if options[:quiet]
|
|
13
|
-
Bundler.settings.set_command_option_if_given :path, options[:path]
|
|
14
13
|
Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
|
|
15
14
|
|
|
16
|
-
setup_cache_all
|
|
17
15
|
install
|
|
18
16
|
|
|
19
|
-
# TODO: move cache contents here now that all bundles are locked
|
|
20
|
-
custom_path = Bundler.settings[:path] if options[:path]
|
|
21
|
-
|
|
22
17
|
Bundler.settings.temporary(cache_all_platforms: options["all-platforms"]) do
|
|
23
|
-
Bundler.load.cache
|
|
18
|
+
Bundler.load.cache
|
|
24
19
|
end
|
|
25
20
|
end
|
|
26
21
|
|
|
@@ -33,11 +28,5 @@ module Bundler
|
|
|
33
28
|
options["no-cache"] = true
|
|
34
29
|
Bundler::CLI::Install.new(options).run
|
|
35
30
|
end
|
|
36
|
-
|
|
37
|
-
def setup_cache_all
|
|
38
|
-
all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
|
|
39
|
-
|
|
40
|
-
Bundler.settings.set_command_option_if_given :cache_all, all
|
|
41
|
-
end
|
|
42
31
|
end
|
|
43
32
|
end
|
data/lib/bundler/cli/common.rb
CHANGED
|
@@ -94,11 +94,14 @@ module Bundler
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def self.gem_not_found_message(missing_gem_name, alternatives)
|
|
97
|
-
require_relative "../similarity_detector"
|
|
98
97
|
message = "Could not find gem '#{missing_gem_name}'."
|
|
99
98
|
alternate_names = alternatives.map {|a| a.respond_to?(:name) ? a.name : a }
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
if alternate_names.include?(missing_gem_name.downcase)
|
|
100
|
+
message += "\nDid you mean '#{missing_gem_name.downcase}'?"
|
|
101
|
+
elsif defined?(DidYouMean::SpellChecker)
|
|
102
|
+
suggestions = DidYouMean::SpellChecker.new(dictionary: alternate_names).correct(missing_gem_name)
|
|
103
|
+
message += "\nDid you mean #{word_list(suggestions)}?" unless suggestions.empty?
|
|
104
|
+
end
|
|
102
105
|
message
|
|
103
106
|
end
|
|
104
107
|
|
|
@@ -130,9 +133,23 @@ module Bundler
|
|
|
130
133
|
def self.clean_after_install?
|
|
131
134
|
clean = Bundler.settings[:clean]
|
|
132
135
|
return clean unless clean.nil?
|
|
133
|
-
clean ||= Bundler.feature_flag.
|
|
136
|
+
clean ||= Bundler.feature_flag.bundler_5_mode? && Bundler.settings[:path].nil?
|
|
134
137
|
clean &&= !Bundler.use_system_gems?
|
|
135
138
|
clean
|
|
136
139
|
end
|
|
140
|
+
|
|
141
|
+
def self.word_list(words)
|
|
142
|
+
if words.empty?
|
|
143
|
+
return ""
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
words = words.map {|word| "'#{word}'" }
|
|
147
|
+
|
|
148
|
+
if words.length == 1
|
|
149
|
+
return words[0]
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
[words[0..-2].join(", "), words[-1]].join(" or ")
|
|
153
|
+
end
|
|
137
154
|
end
|
|
138
155
|
end
|
data/lib/bundler/cli/config.rb
CHANGED
|
@@ -26,8 +26,7 @@ module Bundler
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
message = "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
|
|
29
|
-
|
|
30
|
-
SharedHelpers.major_deprecation 3, message, removed_message: removed_message
|
|
29
|
+
SharedHelpers.feature_deprecated! message
|
|
31
30
|
|
|
32
31
|
Base.new(options, name, value, self).run
|
|
33
32
|
end
|
data/lib/bundler/cli/console.rb
CHANGED
|
@@ -21,6 +21,11 @@ module Bundler
|
|
|
21
21
|
get_constant(name)
|
|
22
22
|
rescue LoadError
|
|
23
23
|
if name == "irb"
|
|
24
|
+
if defined?(Gem::BUNDLED_GEMS) && Gem::BUNDLED_GEMS.respond_to?(:force_activate)
|
|
25
|
+
Gem::BUNDLED_GEMS.force_activate "irb"
|
|
26
|
+
require name
|
|
27
|
+
return get_constant(name)
|
|
28
|
+
end
|
|
24
29
|
Bundler.ui.error "#{name} is not available"
|
|
25
30
|
exit 1
|
|
26
31
|
else
|
data/lib/bundler/cli/exec.rb
CHANGED
|
@@ -19,11 +19,13 @@ module Bundler
|
|
|
19
19
|
validate_cmd!
|
|
20
20
|
SharedHelpers.set_bundle_environment
|
|
21
21
|
if bin_path = Bundler.which(cmd)
|
|
22
|
-
if !Bundler.settings[:disable_exec_load] &&
|
|
23
|
-
|
|
22
|
+
if !Bundler.settings[:disable_exec_load] && directly_loadable?(bin_path)
|
|
23
|
+
bin_path.delete_suffix!(".bat") if Gem.win_platform?
|
|
24
|
+
kernel_load(bin_path, *args)
|
|
25
|
+
else
|
|
26
|
+
bin_path = "./" + bin_path unless File.absolute_path?(bin_path)
|
|
27
|
+
kernel_exec(bin_path, *args)
|
|
24
28
|
end
|
|
25
|
-
bin_path = "./" + bin_path unless File.absolute_path?(bin_path)
|
|
26
|
-
kernel_exec(bin_path, *args)
|
|
27
29
|
else
|
|
28
30
|
# exec using the given command
|
|
29
31
|
kernel_exec(cmd, *args)
|
|
@@ -69,6 +71,29 @@ module Bundler
|
|
|
69
71
|
"#{file} #{args.join(" ")}".strip
|
|
70
72
|
end
|
|
71
73
|
|
|
74
|
+
def directly_loadable?(file)
|
|
75
|
+
if Gem.win_platform?
|
|
76
|
+
script_wrapper?(file)
|
|
77
|
+
else
|
|
78
|
+
ruby_shebang?(file)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def script_wrapper?(file)
|
|
83
|
+
script_file = file.delete_suffix(".bat")
|
|
84
|
+
return false unless File.exist?(script_file)
|
|
85
|
+
|
|
86
|
+
if File.zero?(script_file)
|
|
87
|
+
Bundler.ui.warn "#{script_file} is empty"
|
|
88
|
+
return false
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
header = File.open(file, "r") {|f| f.read(32) }
|
|
92
|
+
ruby_exe = "#{RbConfig::CONFIG["RUBY_INSTALL_NAME"]}#{RbConfig::CONFIG["EXEEXT"]}"
|
|
93
|
+
ruby_exe = "ruby.exe" if ruby_exe.empty?
|
|
94
|
+
header.include?(ruby_exe)
|
|
95
|
+
end
|
|
96
|
+
|
|
72
97
|
def ruby_shebang?(file)
|
|
73
98
|
possibilities = [
|
|
74
99
|
"#!/usr/bin/env ruby\n",
|