bundler 2.7.0 → 4.0.1
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 +1058 -896
- data/README.md +4 -4
- data/bundler.gemspec +3 -3
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/capistrano.rb +1 -19
- data/lib/bundler/checksum.rb +6 -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 +19 -33
- data/lib/bundler/cli/install.rb +10 -85
- 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/plugin.rb +5 -1
- data/lib/bundler/cli/show.rb +3 -7
- data/lib/bundler/cli/update.rb +4 -4
- data/lib/bundler/cli.rb +157 -122
- data/lib/bundler/compact_index_client.rb +0 -1
- data/lib/bundler/current_ruby.rb +3 -15
- data/lib/bundler/definition.rb +143 -95
- data/lib/bundler/deployment.rb +1 -64
- data/lib/bundler/digest.rb +1 -1
- data/lib/bundler/dsl.rb +27 -37
- data/lib/bundler/environment_preserver.rb +1 -0
- data/lib/bundler/errors.rb +1 -5
- data/lib/bundler/feature_flag.rb +0 -33
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +6 -0
- data/lib/bundler/friendly_errors.rb +2 -2
- data/lib/bundler/index.rb +0 -7
- data/lib/bundler/inline.rb +9 -1
- data/lib/bundler/installer/gem_installer.rb +0 -11
- data/lib/bundler/installer.rb +0 -6
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +2 -12
- 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 +39 -46
- data/lib/bundler/man/bundle-config.1.ronn +73 -75
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +4 -4
- data/lib/bundler/man/bundle-doctor.1.ronn +4 -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 +3 -6
- data/lib/bundler/man/bundle-gem.1.ronn +2 -5
- 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/materialization.rb +1 -1
- data/lib/bundler/plugin/installer.rb +0 -10
- data/lib/bundler/plugin/source_list.rb +1 -1
- data/lib/bundler/plugin.rb +1 -1
- data/lib/bundler/resolver/package.rb +1 -0
- data/lib/bundler/resolver.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +2 -0
- data/lib/bundler/ruby_version.rb +1 -3
- data/lib/bundler/rubygems_ext.rb +1 -1
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +1 -5
- data/lib/bundler/runtime.rb +5 -1
- data/lib/bundler/self_manager.rb +1 -1
- data/lib/bundler/settings.rb +9 -27
- data/lib/bundler/shared_helpers.rb +12 -20
- data/lib/bundler/source/gemspec.rb +4 -0
- data/lib/bundler/source/git/git_proxy.rb +3 -11
- data/lib/bundler/source/git.rb +2 -3
- data/lib/bundler/source/path.rb +5 -7
- data/lib/bundler/source/rubygems.rb +11 -17
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +4 -45
- data/lib/bundler/source_map.rb +2 -5
- data/lib/bundler/spec_set.rb +6 -15
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
- 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 +1 -1
- 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/github/workflows/main.yml.tt +6 -0
- 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 +7 -4
- data/lib/bundler/ui/shell.rb +10 -6
- 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/lib/net/http/persistent.rb +5 -2
- 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 +1 -1
- data/lib/bundler/vlad.rb +1 -14
- data/lib/bundler.rb +6 -28
- metadata +9 -13
- data/lib/bundler/cli/inject.rb +0 -60
- data/lib/bundler/cli/viz.rb +0 -31
- 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/cli/update.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Bundler
|
|
|
15
15
|
|
|
16
16
|
Bundler.self_manager.update_bundler_and_restart_with_it_if_needed(update_bundler) if update_bundler
|
|
17
17
|
|
|
18
|
-
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.
|
|
18
|
+
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
|
|
19
19
|
|
|
20
20
|
sources = Array(options[:source])
|
|
21
21
|
groups = Array(options[:group]).map(&:to_sym)
|
|
@@ -23,10 +23,10 @@ module Bundler
|
|
|
23
23
|
full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !update_bundler
|
|
24
24
|
|
|
25
25
|
if full_update && !options[:all]
|
|
26
|
-
if Bundler.
|
|
26
|
+
if Bundler.settings[:update_requires_all_flag]
|
|
27
27
|
raise InvalidOption, "To update everything, pass the `--all` flag."
|
|
28
28
|
end
|
|
29
|
-
SharedHelpers.
|
|
29
|
+
SharedHelpers.feature_deprecated! "Pass --all to `bundle update` to update everything"
|
|
30
30
|
elsif !full_update && options[:all]
|
|
31
31
|
raise InvalidOption, "Cannot specify --all along with specific options."
|
|
32
32
|
end
|
|
@@ -63,7 +63,7 @@ module Bundler
|
|
|
63
63
|
opts = options.dup
|
|
64
64
|
opts["update"] = true
|
|
65
65
|
opts["local"] = options[:local]
|
|
66
|
-
opts["force"] = options[:redownload]
|
|
66
|
+
opts["force"] = options[:redownload] if options[:redownload]
|
|
67
67
|
|
|
68
68
|
Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
|
|
69
69
|
|
data/lib/bundler/cli.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Bundler
|
|
|
11
11
|
|
|
12
12
|
AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
|
|
13
13
|
PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze
|
|
14
|
-
EXTENSIONS = ["c", "rust"].freeze
|
|
14
|
+
EXTENSIONS = ["c", "rust", "go"].freeze
|
|
15
15
|
|
|
16
16
|
COMMAND_ALIASES = {
|
|
17
17
|
"check" => "c",
|
|
@@ -24,7 +24,7 @@ module Bundler
|
|
|
24
24
|
}.freeze
|
|
25
25
|
|
|
26
26
|
def self.start(*)
|
|
27
|
-
|
|
27
|
+
check_invalid_ext_option(ARGV) if ARGV.include?("--ext")
|
|
28
28
|
|
|
29
29
|
super
|
|
30
30
|
ensure
|
|
@@ -59,17 +59,29 @@ module Bundler
|
|
|
59
59
|
def initialize(*args)
|
|
60
60
|
super
|
|
61
61
|
|
|
62
|
+
current_cmd = args.last[:current_command].name
|
|
63
|
+
|
|
62
64
|
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
|
63
65
|
if custom_gemfile && !custom_gemfile.empty?
|
|
64
66
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
|
|
65
|
-
|
|
67
|
+
reset_settings = true
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# lock --lockfile works differently than install --lockfile
|
|
71
|
+
unless current_cmd == "lock"
|
|
72
|
+
custom_lockfile = options[:lockfile] || ENV["BUNDLE_LOCKFILE"] || Bundler.settings[:lockfile]
|
|
73
|
+
if custom_lockfile && !custom_lockfile.empty?
|
|
74
|
+
Bundler::SharedHelpers.set_env "BUNDLE_LOCKFILE", File.expand_path(custom_lockfile)
|
|
75
|
+
reset_settings = true
|
|
76
|
+
end
|
|
66
77
|
end
|
|
67
78
|
|
|
79
|
+
Bundler.reset_settings_and_root! if reset_settings
|
|
80
|
+
|
|
68
81
|
Bundler.auto_switch
|
|
69
82
|
|
|
70
83
|
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
|
71
84
|
|
|
72
|
-
current_cmd = args.last[:current_command].name
|
|
73
85
|
Bundler.auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
|
|
74
86
|
rescue UnknownArgumentError => e
|
|
75
87
|
raise InvalidOption, e.message
|
|
@@ -107,7 +119,33 @@ module Bundler
|
|
|
107
119
|
shell.say
|
|
108
120
|
self.class.send(:class_options_help, shell)
|
|
109
121
|
end
|
|
110
|
-
|
|
122
|
+
|
|
123
|
+
desc "install_or_cli_help", "Deprecated alias of install", hide: true
|
|
124
|
+
def install_or_cli_help
|
|
125
|
+
Bundler.ui.warn <<~MSG
|
|
126
|
+
`bundle install_or_cli_help` is a deprecated alias of `bundle install`.
|
|
127
|
+
It might be called due to the 'default_cli_command' being set to 'install_or_cli_help',
|
|
128
|
+
if so fix that by running `bundle config set default_cli_command install --global`.
|
|
129
|
+
MSG
|
|
130
|
+
invoke_other_command("install")
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def self.default_command(meth = nil)
|
|
134
|
+
return super if meth
|
|
135
|
+
|
|
136
|
+
unless Bundler.settings[:default_cli_command]
|
|
137
|
+
Bundler.ui.info <<~MSG
|
|
138
|
+
In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.
|
|
139
|
+
Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
|
|
140
|
+
You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,
|
|
141
|
+
or you can continue to use the current behavior with `bundle config set default_cli_command install --global`.
|
|
142
|
+
This message will be removed after a default_cli_command value is set.
|
|
143
|
+
|
|
144
|
+
MSG
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
Bundler.settings[:default_cli_command] || "install"
|
|
148
|
+
end
|
|
111
149
|
|
|
112
150
|
class_option "no-color", type: :boolean, desc: "Disable colorization in output"
|
|
113
151
|
class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
|
|
@@ -143,7 +181,7 @@ module Bundler
|
|
|
143
181
|
end
|
|
144
182
|
|
|
145
183
|
def self.handle_no_command_error(command, has_namespace = $thor_runner)
|
|
146
|
-
if Bundler.
|
|
184
|
+
if Bundler.settings[:plugins] && Bundler::Plugin.command?(command)
|
|
147
185
|
return Bundler::Plugin.exec_command(command, ARGV[1..-1])
|
|
148
186
|
end
|
|
149
187
|
|
|
@@ -173,7 +211,7 @@ module Bundler
|
|
|
173
211
|
D
|
|
174
212
|
method_option "dry-run", type: :boolean, default: false, banner: "Lock the Gemfile"
|
|
175
213
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
|
176
|
-
method_option "path", type: :string, banner: "Specify a different path than the system default
|
|
214
|
+
method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)"
|
|
177
215
|
def check
|
|
178
216
|
remembered_flag_deprecation("path")
|
|
179
217
|
|
|
@@ -187,12 +225,11 @@ module Bundler
|
|
|
187
225
|
long_desc <<-D
|
|
188
226
|
Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
|
|
189
227
|
D
|
|
190
|
-
method_option "install", type: :boolean, banner: "Runs 'bundle install' after removing the gems from the Gemfile"
|
|
228
|
+
method_option "install", type: :boolean, banner: "Runs 'bundle install' after removing the gems from the Gemfile (removed)"
|
|
191
229
|
def remove(*gems)
|
|
192
230
|
if ARGV.include?("--install")
|
|
193
|
-
message = "The `--install` flag has been deprecated. `bundle install` is triggered by default."
|
|
194
231
|
removed_message = "The `--install` flag has been removed. `bundle install` is triggered by default."
|
|
195
|
-
|
|
232
|
+
raise InvalidOption, removed_message
|
|
196
233
|
end
|
|
197
234
|
|
|
198
235
|
require_relative "cli/remove"
|
|
@@ -210,42 +247,52 @@ module Bundler
|
|
|
210
247
|
|
|
211
248
|
If the bundle has already been installed, bundler will tell you so and then exit.
|
|
212
249
|
D
|
|
213
|
-
method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin"
|
|
214
|
-
method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install"
|
|
215
|
-
method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments"
|
|
216
|
-
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install"
|
|
250
|
+
method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin (removed)"
|
|
251
|
+
method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install (removed)"
|
|
252
|
+
method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments (removed)"
|
|
253
|
+
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install (removed)"
|
|
217
254
|
method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
|
|
218
255
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
|
219
256
|
method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
|
|
220
257
|
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
|
258
|
+
method_option "lockfile", type: :string, banner: "Use the specified lockfile instead of the default."
|
|
221
259
|
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
|
|
222
260
|
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
|
|
223
|
-
method_option "
|
|
224
|
-
method_option "
|
|
225
|
-
method_option "
|
|
261
|
+
method_option "no-lock", type: :boolean, banner: "Don't create a lockfile."
|
|
262
|
+
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
|
|
263
|
+
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)."
|
|
264
|
+
method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
|
|
226
265
|
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
|
227
|
-
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default
|
|
266
|
+
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default, usually 'ruby' (removed)"
|
|
228
267
|
method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
|
|
229
|
-
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
|
268
|
+
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application (removed)"
|
|
230
269
|
method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
|
|
231
270
|
method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
|
|
232
|
-
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
|
|
233
|
-
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
|
|
271
|
+
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group (removed)."
|
|
272
|
+
method_option "with", type: :array, banner: "Include gems that are part of the specified named group (removed)."
|
|
234
273
|
def install
|
|
235
|
-
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
|
236
|
-
|
|
237
274
|
%w[clean deployment frozen no-prune path shebang without with].each do |option|
|
|
238
275
|
remembered_flag_deprecation(option)
|
|
239
276
|
end
|
|
240
277
|
|
|
241
278
|
print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
|
|
242
279
|
|
|
243
|
-
|
|
280
|
+
remembered_flag_deprecation("deployment", negative: true)
|
|
281
|
+
|
|
282
|
+
if ARGV.include?("--binstubs")
|
|
283
|
+
removed_message = "The --binstubs option has been removed in favor of `bundle binstubs --all`"
|
|
284
|
+
raise InvalidOption, removed_message
|
|
285
|
+
end
|
|
244
286
|
|
|
245
287
|
require_relative "cli/install"
|
|
288
|
+
options = self.options.dup
|
|
289
|
+
options["lockfile"] ||= ENV["BUNDLE_LOCKFILE"]
|
|
246
290
|
Bundler.settings.temporary(no_install: false) do
|
|
247
|
-
Install.new(options
|
|
291
|
+
Install.new(options).run
|
|
248
292
|
end
|
|
293
|
+
rescue GemfileNotFound => error
|
|
294
|
+
invoke_other_command("cli_help")
|
|
295
|
+
raise error # re-raise to show the error and get a failing exit status
|
|
249
296
|
end
|
|
250
297
|
|
|
251
298
|
map aliases_for("install")
|
|
@@ -263,7 +310,7 @@ module Bundler
|
|
|
263
310
|
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
|
264
311
|
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
|
265
312
|
method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
|
|
266
|
-
method_option "
|
|
313
|
+
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
|
|
267
314
|
method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
|
|
268
315
|
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
|
|
269
316
|
method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
|
|
@@ -274,7 +321,6 @@ module Bundler
|
|
|
274
321
|
method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
|
|
275
322
|
method_option "all", type: :boolean, banner: "Update everything."
|
|
276
323
|
def update(*gems)
|
|
277
|
-
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
|
278
324
|
require_relative "cli/update"
|
|
279
325
|
Bundler.settings.temporary(no_install: false) do
|
|
280
326
|
Update.new(options, gems).run
|
|
@@ -287,12 +333,11 @@ module Bundler
|
|
|
287
333
|
Calling show with [GEM] will list the exact location of that gem on your machine.
|
|
288
334
|
D
|
|
289
335
|
method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
|
|
290
|
-
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
|
|
336
|
+
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated (removed)."
|
|
291
337
|
def show(gem_name = nil)
|
|
292
338
|
if ARGV.include?("--outdated")
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
|
|
339
|
+
removed_message = "the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`"
|
|
340
|
+
raise InvalidOption, removed_message
|
|
296
341
|
end
|
|
297
342
|
require_relative "cli/show"
|
|
298
343
|
Show.new(options, gem_name).run
|
|
@@ -302,6 +347,7 @@ module Bundler
|
|
|
302
347
|
method_option "name-only", type: :boolean, banner: "print only the gem names"
|
|
303
348
|
method_option "only-group", type: :array, default: [], banner: "print gems from a given set of groups"
|
|
304
349
|
method_option "without-group", type: :array, default: [], banner: "print all gems except from a given set of groups"
|
|
350
|
+
method_option "format", type: :string, banner: "format output ('json' is the only supported format)"
|
|
305
351
|
method_option "paths", type: :boolean, banner: "print the path to each gem in the bundle"
|
|
306
352
|
def list
|
|
307
353
|
require_relative "cli/list"
|
|
@@ -325,12 +371,14 @@ module Bundler
|
|
|
325
371
|
will create binstubs for all given gems.
|
|
326
372
|
D
|
|
327
373
|
method_option "force", type: :boolean, default: false, banner: "Overwrite existing binstubs if they exist"
|
|
328
|
-
method_option "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory
|
|
374
|
+
method_option "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory, `bin` by default (removed)"
|
|
329
375
|
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
|
|
330
376
|
method_option "standalone", type: :boolean, banner: "Make binstubs that can work without the Bundler runtime"
|
|
331
377
|
method_option "all", type: :boolean, banner: "Install binstubs for all gems"
|
|
332
378
|
method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
|
|
333
379
|
def binstubs(*gems)
|
|
380
|
+
remembered_flag_deprecation("path", option_name: "bin")
|
|
381
|
+
|
|
334
382
|
require_relative "cli/binstubs"
|
|
335
383
|
Binstubs.new(options, gems).run
|
|
336
384
|
end
|
|
@@ -396,15 +444,15 @@ module Bundler
|
|
|
396
444
|
end
|
|
397
445
|
|
|
398
446
|
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
|
399
|
-
method_option "all", type: :boolean, default: Bundler.
|
|
447
|
+
method_option "all", type: :boolean, default: Bundler.settings[:cache_all], banner: "Include all sources (including path and git) (removed)."
|
|
400
448
|
method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
|
|
401
449
|
method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
|
|
402
450
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
|
403
451
|
method_option "no-install", type: :boolean, banner: "Don't install the gems, only update the cache."
|
|
404
|
-
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
|
|
405
|
-
method_option "path", type: :string, banner: "Specify a different path than the system default
|
|
452
|
+
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)."
|
|
453
|
+
method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
|
|
406
454
|
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
|
|
407
|
-
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
|
|
455
|
+
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install (removed)"
|
|
408
456
|
long_desc <<-D
|
|
409
457
|
The cache command will copy the .gem files for every gem in the bundle into the
|
|
410
458
|
directory ./vendor/cache. If you then check that directory into your source
|
|
@@ -413,18 +461,19 @@ module Bundler
|
|
|
413
461
|
D
|
|
414
462
|
def cache
|
|
415
463
|
print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
|
|
464
|
+
print_remembered_flag_deprecation("--no-all", "cache_all", "false") if ARGV.include?("--no-all")
|
|
416
465
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
"and stop using this flag"
|
|
466
|
+
%w[frozen no-prune].each do |option|
|
|
467
|
+
remembered_flag_deprecation(option)
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
if flag_passed?("--path")
|
|
423
471
|
removed_message =
|
|
424
472
|
"The `--path` flag has been removed because its semantics were unclear. " \
|
|
425
473
|
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
|
426
|
-
"and `bundle config path` to configure the path where your gems are installed
|
|
427
|
-
|
|
474
|
+
"and `bundle config path` to configure the path where your gems are installed, " \
|
|
475
|
+
"and stop using this flag"
|
|
476
|
+
raise InvalidOption, removed_message
|
|
428
477
|
end
|
|
429
478
|
|
|
430
479
|
require_relative "cli/cache"
|
|
@@ -434,7 +483,7 @@ module Bundler
|
|
|
434
483
|
map aliases_for("cache")
|
|
435
484
|
|
|
436
485
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
|
437
|
-
method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is
|
|
486
|
+
method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is not permitted (removed)."
|
|
438
487
|
method_option :gemfile, type: :string, required: false, banner: "Use the specified gemfile instead of Gemfile"
|
|
439
488
|
long_desc <<-D
|
|
440
489
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
|
@@ -443,9 +492,8 @@ module Bundler
|
|
|
443
492
|
D
|
|
444
493
|
def exec(*args)
|
|
445
494
|
if ARGV.include?("--no-keep-file-descriptors")
|
|
446
|
-
message = "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to"
|
|
447
495
|
removed_message = "The `--no-keep-file-descriptors` has been removed. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to"
|
|
448
|
-
|
|
496
|
+
raise InvalidOption, removed_message
|
|
449
497
|
end
|
|
450
498
|
|
|
451
499
|
require_relative "cli/exec"
|
|
@@ -489,7 +537,7 @@ module Bundler
|
|
|
489
537
|
build_info = " (#{BuildMetadata.timestamp} commit #{BuildMetadata.git_commit_sha})"
|
|
490
538
|
end
|
|
491
539
|
|
|
492
|
-
if !cli_help
|
|
540
|
+
if !cli_help
|
|
493
541
|
Bundler.ui.info "#{Bundler.verbose_version}#{build_info}"
|
|
494
542
|
else
|
|
495
543
|
Bundler.ui.info "Bundler version #{Bundler.verbose_version}#{build_info}"
|
|
@@ -512,42 +560,32 @@ module Bundler
|
|
|
512
560
|
end
|
|
513
561
|
end
|
|
514
562
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
Viz generates a PNG file of the current Gemfile as a dependency graph.
|
|
519
|
-
Viz requires the ruby-graphviz gem (and its dependencies).
|
|
520
|
-
The associated gems must also be installed via 'bundle install'.
|
|
521
|
-
D
|
|
522
|
-
method_option :file, type: :string, default: "gem_graph", aliases: "-f", desc: "The name to use for the generated file. see format option"
|
|
523
|
-
method_option :format, type: :string, default: "png", aliases: "-F", desc: "This is output format option. Supported format is png, jpg, svg, dot ..."
|
|
524
|
-
method_option :requirements, type: :boolean, default: false, aliases: "-R", desc: "Set to show the version of each required dependency."
|
|
525
|
-
method_option :version, type: :boolean, default: false, aliases: "-v", desc: "Set to show each gem version."
|
|
526
|
-
method_option :without, type: :array, default: [], aliases: "-W", banner: "GROUP[ GROUP...]", desc: "Exclude gems that are part of the specified named group."
|
|
527
|
-
def viz
|
|
528
|
-
SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
|
529
|
-
require_relative "cli/viz"
|
|
530
|
-
Viz.new(options.dup).run
|
|
531
|
-
end
|
|
563
|
+
desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
|
|
564
|
+
def viz
|
|
565
|
+
SharedHelpers.feature_removed! "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
|
|
532
566
|
end
|
|
533
567
|
|
|
534
568
|
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
|
535
|
-
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"],
|
|
536
|
-
method_option :coc, type: :boolean,
|
|
537
|
-
method_option :edit, type: :string, aliases: "-e", required: false,
|
|
538
|
-
method_option :ext, type: :string,
|
|
539
|
-
method_option :git, type: :boolean, default: true,
|
|
540
|
-
method_option :mit, type: :boolean,
|
|
541
|
-
method_option :rubocop, type: :boolean,
|
|
542
|
-
method_option :changelog, type: :boolean,
|
|
569
|
+
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], banner: "Generate a binary executable for your library."
|
|
570
|
+
method_option :coc, type: :boolean, banner: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
|
|
571
|
+
method_option :edit, type: :string, aliases: "-e", required: false, lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, banner: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
|
572
|
+
method_option :ext, type: :string, banner: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
|
|
573
|
+
method_option :git, type: :boolean, default: true, banner: "Initialize a git repo inside your library."
|
|
574
|
+
method_option :mit, type: :boolean, banner: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
|
575
|
+
method_option :rubocop, type: :boolean, banner: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true` (removed)."
|
|
576
|
+
method_option :changelog, type: :boolean, banner: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
|
|
543
577
|
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
|
544
|
-
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle],
|
|
545
|
-
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard],
|
|
578
|
+
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], banner: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
|
|
579
|
+
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], banner: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
|
546
580
|
method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
|
547
|
-
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"],
|
|
581
|
+
method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], banner: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
|
|
548
582
|
|
|
549
583
|
def gem(name)
|
|
550
584
|
require_relative "cli/gem"
|
|
585
|
+
|
|
586
|
+
raise InvalidOption, "--rubocop has been removed, use --linter=rubocop" if ARGV.include?("--rubocop")
|
|
587
|
+
raise InvalidOption, "--no-rubocop has been removed, use --no-linter" if ARGV.include?("--no-rubocop")
|
|
588
|
+
|
|
551
589
|
cmd_args = args + [self]
|
|
552
590
|
cmd_args.unshift(options)
|
|
553
591
|
|
|
@@ -558,7 +596,7 @@ module Bundler
|
|
|
558
596
|
File.expand_path("templates", __dir__)
|
|
559
597
|
end
|
|
560
598
|
|
|
561
|
-
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
|
|
599
|
+
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
|
|
562
600
|
method_option "dry-run", type: :boolean, default: false, banner: "Only print out changes, do not clean gems"
|
|
563
601
|
method_option "force", type: :boolean, default: false, banner: "Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application."
|
|
564
602
|
def clean
|
|
@@ -574,12 +612,8 @@ module Bundler
|
|
|
574
612
|
end
|
|
575
613
|
|
|
576
614
|
desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", hide: true
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
def inject(name, version)
|
|
580
|
-
SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
|
|
581
|
-
require_relative "cli/inject"
|
|
582
|
-
Inject.new(options.dup, name, version).run
|
|
615
|
+
def inject(*)
|
|
616
|
+
SharedHelpers.feature_removed! "The `inject` command has been replaced by the `add` command"
|
|
583
617
|
end
|
|
584
618
|
|
|
585
619
|
desc "lock", "Creates a lockfile without installing"
|
|
@@ -633,7 +667,7 @@ module Bundler
|
|
|
633
667
|
end
|
|
634
668
|
end
|
|
635
669
|
|
|
636
|
-
if Bundler.
|
|
670
|
+
if Bundler.settings[:plugins]
|
|
637
671
|
require_relative "cli/plugin"
|
|
638
672
|
desc "plugin", "Manage the bundler plugins"
|
|
639
673
|
subcommand "plugin", Plugin
|
|
@@ -667,18 +701,15 @@ module Bundler
|
|
|
667
701
|
end
|
|
668
702
|
end
|
|
669
703
|
|
|
670
|
-
def self.
|
|
671
|
-
# when
|
|
672
|
-
|
|
673
|
-
if deprecated_ext_value?(arguments)
|
|
674
|
-
message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been deprecated. Please select a language, e.g. `--ext=rust` to generate a Rust extension. This gem will now be generated as if `--ext=c` was used."
|
|
704
|
+
def self.check_invalid_ext_option(arguments)
|
|
705
|
+
# when invalid version of `--ext` is called
|
|
706
|
+
if invalid_ext_value?(arguments)
|
|
675
707
|
removed_message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been removed. Please select a language, e.g. `--ext=rust` to generate a Rust extension."
|
|
676
|
-
|
|
677
|
-
arguments[arguments.index("--ext")] = "--ext=c"
|
|
708
|
+
raise InvalidOption, removed_message
|
|
678
709
|
end
|
|
679
710
|
end
|
|
680
711
|
|
|
681
|
-
def self.
|
|
712
|
+
def self.invalid_ext_value?(arguments)
|
|
682
713
|
index = arguments.index("--ext")
|
|
683
714
|
next_argument = arguments[index + 1]
|
|
684
715
|
|
|
@@ -686,15 +717,15 @@ module Bundler
|
|
|
686
717
|
# for example `bundle gem hello --ext c`
|
|
687
718
|
return false if EXTENSIONS.include?(next_argument)
|
|
688
719
|
|
|
689
|
-
#
|
|
720
|
+
# invalid call when --ext is called with no value in last position
|
|
690
721
|
# for example `bundle gem hello_gem --ext`
|
|
691
722
|
return true if next_argument.nil?
|
|
692
723
|
|
|
693
|
-
#
|
|
724
|
+
# invalid call when --ext is followed by other parameter
|
|
694
725
|
# for example `bundle gem --ext --no-ci hello_gem`
|
|
695
726
|
return true if next_argument.start_with?("-")
|
|
696
727
|
|
|
697
|
-
#
|
|
728
|
+
# invalid call when --ext is followed by gem name
|
|
698
729
|
# for example `bundle gem --ext hello_gem`
|
|
699
730
|
return true if next_argument
|
|
700
731
|
|
|
@@ -708,13 +739,31 @@ module Bundler
|
|
|
708
739
|
config[:current_command]
|
|
709
740
|
end
|
|
710
741
|
|
|
742
|
+
def invoke_other_command(name)
|
|
743
|
+
_, _, config = @_initializer
|
|
744
|
+
original_command = config[:current_command]
|
|
745
|
+
command = self.class.all_commands[name]
|
|
746
|
+
config[:current_command] = command
|
|
747
|
+
send(name)
|
|
748
|
+
ensure
|
|
749
|
+
config[:current_command] = original_command
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
def current_command=(command)
|
|
753
|
+
end
|
|
754
|
+
|
|
711
755
|
def print_command
|
|
712
756
|
return unless Bundler.ui.debug?
|
|
713
757
|
cmd = current_command
|
|
714
758
|
command_name = cmd.name
|
|
715
759
|
return if PARSEABLE_COMMANDS.include?(command_name)
|
|
716
760
|
command = ["bundle", command_name] + args
|
|
717
|
-
|
|
761
|
+
options_to_print = options.dup
|
|
762
|
+
options_to_print.delete_if do |k, v|
|
|
763
|
+
next unless o = cmd.options[k]
|
|
764
|
+
o.default == v
|
|
765
|
+
end
|
|
766
|
+
command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
|
|
718
767
|
command.reject!(&:empty?)
|
|
719
768
|
Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler.verbose_version}"
|
|
720
769
|
end
|
|
@@ -743,44 +792,30 @@ module Bundler
|
|
|
743
792
|
nil
|
|
744
793
|
end
|
|
745
794
|
|
|
746
|
-
def
|
|
747
|
-
positive_name = name.gsub(/\Ano-/, "")
|
|
748
|
-
option = current_command.options[positive_name]
|
|
749
|
-
flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
|
|
750
|
-
|
|
751
|
-
flag_deprecation(positive_name, flag_name, option)
|
|
752
|
-
end
|
|
753
|
-
|
|
754
|
-
def remembered_flag_deprecation(name)
|
|
795
|
+
def remembered_flag_deprecation(name, negative: false, option_name: nil)
|
|
755
796
|
option = current_command.options[name]
|
|
756
797
|
flag_name = option.switch_name
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
end
|
|
760
|
-
|
|
761
|
-
def flag_deprecation(name, flag_name, option)
|
|
762
|
-
name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
|
|
763
|
-
return unless name_index
|
|
798
|
+
flag_name = "--no-" + flag_name.gsub(/\A--/, "") if negative
|
|
799
|
+
return unless flag_passed?(flag_name)
|
|
764
800
|
|
|
765
801
|
value = options[name]
|
|
766
802
|
value = value.join(" ").to_s if option.type == :array
|
|
767
803
|
value = "'#{value}'" unless option.type == :boolean
|
|
768
804
|
|
|
769
|
-
print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
|
|
805
|
+
print_remembered_flag_deprecation(flag_name, option_name || name.tr("-", "_"), value)
|
|
770
806
|
end
|
|
771
807
|
|
|
772
808
|
def print_remembered_flag_deprecation(flag_name, option_name, option_value)
|
|
773
|
-
message =
|
|
774
|
-
"The `#{flag_name}` flag is deprecated because it relies on being " \
|
|
775
|
-
"remembered across bundler invocations, which bundler will no longer " \
|
|
776
|
-
"do in future versions. Instead please use `bundle config set #{option_name} " \
|
|
777
|
-
"#{option_value}`, and stop using this flag"
|
|
778
809
|
removed_message =
|
|
779
810
|
"The `#{flag_name}` flag has been removed because it relied on being " \
|
|
780
|
-
"remembered across bundler invocations, which bundler
|
|
781
|
-
"
|
|
782
|
-
"
|
|
783
|
-
|
|
811
|
+
"remembered across bundler invocations, which bundler no longer does. " \
|
|
812
|
+
"Instead please use `bundle config set #{option_name} #{option_value}`, " \
|
|
813
|
+
"and stop using this flag"
|
|
814
|
+
raise InvalidOption, removed_message
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
def flag_passed?(name)
|
|
818
|
+
ARGV.any? {|arg| name == arg.split("=")[0] }
|
|
784
819
|
end
|
|
785
820
|
end
|
|
786
821
|
end
|
data/lib/bundler/current_ruby.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Bundler
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
class CurrentRuby
|
|
14
|
-
ALL_RUBY_VERSIONS =
|
|
14
|
+
ALL_RUBY_VERSIONS = [*18..27, *30..34, 40].freeze
|
|
15
15
|
KNOWN_MINOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.reverse.join(".") }.freeze
|
|
16
16
|
KNOWN_MAJOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.last.to_s }.uniq.freeze
|
|
17
17
|
PLATFORM_MAP = {
|
|
@@ -50,19 +50,10 @@ module Bundler
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def maglev?
|
|
53
|
-
message =
|
|
54
|
-
"`CurrentRuby#maglev?` is deprecated with no replacement. Please use the " \
|
|
55
|
-
"built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on."
|
|
56
53
|
removed_message =
|
|
57
54
|
"`CurrentRuby#maglev?` was removed with no replacement. Please use the " \
|
|
58
55
|
"built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on."
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
unless internally_exempted
|
|
62
|
-
SharedHelpers.major_deprecation(2, message, removed_message: removed_message, print_caller_location: true)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
RUBY_ENGINE == "maglev"
|
|
56
|
+
SharedHelpers.feature_removed!(removed_message)
|
|
66
57
|
end
|
|
67
58
|
|
|
68
59
|
def truffleruby?
|
|
@@ -90,14 +81,11 @@ module Bundler
|
|
|
90
81
|
end
|
|
91
82
|
|
|
92
83
|
define_method(:"maglev_#{trimmed_version}?") do
|
|
93
|
-
message =
|
|
94
|
-
"`CurrentRuby##{__method__}` is deprecated with no replacement. Please use the " \
|
|
95
|
-
"built-in Ruby `RUBY_ENGINE` and `RUBY_VERSION` constants to perform a similar check."
|
|
96
84
|
removed_message =
|
|
97
85
|
"`CurrentRuby##{__method__}` was removed with no replacement. Please use the " \
|
|
98
86
|
"built-in Ruby `RUBY_ENGINE` and `RUBY_VERSION` constants to perform a similar check."
|
|
99
87
|
|
|
100
|
-
SharedHelpers.
|
|
88
|
+
SharedHelpers.feature_removed!(removed_message)
|
|
101
89
|
|
|
102
90
|
send(:"maglev?") && send(:"on_#{trimmed_version}?")
|
|
103
91
|
end
|