summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
AgeCommit message (Collapse)Author
2025-12-16[ruby/rubygems] Allow to show cli_help with bundler executableHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/a091e3fd10
2025-12-09[ruby/rubygems] Fix indentation of the info message for default_cli_commandBenoit Daloze
* It looked like: In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`. Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD. You can use the future behavior now with `bundle config set default_cli_command cli_help --global`, or you can continue to use the current behavior with `bundle config set default_cli_command install --global`. This message will be removed after a default_cli_command value is set. Bundler version 4.0.0 (2025-12-08 commit https://github.com/ruby/rubygems/commit/9b4819ae18) * And now looks like: In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`. Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD. You can use the future behavior now with `bundle config set default_cli_command cli_help --global`, or you can continue to use the current behavior with `bundle config set default_cli_command install --global`. This message will be removed after a default_cli_command value is set. Bundler version 4.0.0 (2025-12-08 commit https://github.com/ruby/rubygems/commit/9b4819ae18) https://github.com/ruby/rubygems/commit/979dada8f3
2025-12-09[ruby/rubygems] Fix the config suggestion in the warning for `$ bundle`Benoit Daloze
* `install_or_cli_help` does not exist for older Bundler like Bundler 2 and so results in a confusing error on Bundler 2: ``` $ bundle Could not find command "". ``` * See https://github.com/ruby/rubygems/pull/9136/files#r2592366837 * Merge the behavior of `install_or_cli_help` in `install`. https://github.com/ruby/rubygems/commit/9b4819ae18
2025-12-02[ruby/rubygems] Make BUNDLE_LOCKFILE environment variable have precedence ↵Jeremy Evans
over lockfile method in Gemfile It would be simpler to do `options[:lockfile] ||= ENV["BUNDLE_LOCKFILE"]`, but that doesn't work as `options` is frozen. Fixes https://github.com/ruby/rubygems/pull/9117 https://github.com/ruby/rubygems/commit/6e3603a0e9
2025-12-02[ruby/rubygems] Improve banner message for the default command.Hiroshi SHIBATA
Co-authored-by: Benoit Daloze <eregontp@gmail.com> https://github.com/ruby/rubygems/commit/463488b439 Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
2025-11-28[ruby/rubygems] Add informational message when default_cli_command is unset.Hiroshi SHIBATA
https://github.com/ruby/rubygems/commit/9e44b5ebc4
2025-11-28[ruby/rubygems] Print help summary when the default command failJean Boussier
As mentioned in https://github.com/ruby/rubygems/issues/9124, the intent for changing the default command was to be more welcoming. I think we can acheive that by attempting to install, but to print that same help message if there is no Gemfile. That should address both concerns. https://github.com/ruby/rubygems/commit/f3f505c02a
2025-11-28[ruby/rubygems] Restore `install` as default commandJean Boussier
Fix: https://github.com/ruby/rubygems/issues/9124 This behavior is a deeply entrenched convention and changing it will annoy lots of developers with unclear gains. https://github.com/ruby/rubygems/commit/628e0ede46
2025-11-25[ruby/rubygems] Support bundle install --lockfile optionJeremy Evans
This allows for specifying the lockfile to read and write. It mirrors the --gemfile option, and has higher priority than the lockfile method in the Gemfile. It also mirrors the bundle lock --lockfile option. When the --lockfile option is used, it is applied twice. First, before the Gemfile is read, to specify the lockfile to operate on, and again after the Gemfile is read, so that if the Gemfile has a lockfile method that overrides the defintion's lockfile, the --lockfile option still has higher precedence. https://github.com/ruby/rubygems/commit/17acdd4a89
2025-11-20[ruby/rubygems] Add support for bundle install --no-lockJeremy Evans
This allows for the same behavior as including `lockfile false` in the Gemfile. This allows you to get the behavior without modifying the Gemfile, which is useful if you do not control the Gemfile. This is similar to the --no-lock option already supported by `gem install -g Gemfile`. https://github.com/ruby/rubygems/commit/6c94623881 Co-authored-by: Colby Swandale <996377+colby-swandale@users.noreply.github.com>
2025-11-19[ruby/rubygems] Warn users that `bundle` now display the help:Edouard CHIN
- In https://github.com/ruby/rubygems/commit/31d67ecc056fb5a9193bc66a6e69e21576a87702 we enforced the new behaviour where running `bundle` no longer installs gems but displays the help. Users now have a way to configure their preferred default command using the `BUNDLE_DEFAULT_CLI_COMMAND` flag. With the preview of Ruby 4.0 now being released, some people will start to see this new change. The problem is that the previous behaviour had existed for like an eternity and we didn't warn users about this change in advance. I'd like to provide a deprecation/warning cycle because this is confusing users already and this breaks various CI setup that now needs to be changed immediately. https://github.com/ruby/rubygems/commit/e415480ac5
2025-11-19[ruby/rubygems] Add `--ext=go` to `bundle gem`Go Sueyoshi
(https://github.com/ruby/rubygems/pull/8183) * Add new gem templates * Add `--ext=go` in `bundle gem` * Add setup-go to .github/workflows/main.yml * Embed go version in go.mod * Use go in bundler CI * Add example method to template * Install Go in .circleci/config.yml * Install Go in .gitlab-ci.yml * Allow hard tabs in go template * Run `rake update_manifest` * Fix test * Move go_gem to gemspec Respect to 9b0ec80 * nits: :golf: * includes valid module name in go.mod * generate header file * Run `go mod tidy` to create `go.sum` * Check if `go.sum` is generated only when Go is installed To avoid test failure in environments where Go is not installed * Run CI * Workaround for hung up c.f. https://github.com/rubygems/rubygems/actions/runs/11639408044/job/32415545422 * Write man for --ext=go * Re-generate man with `./bin/rake man:build` * pinning :pushpin: * Update with `./bin/rake man:build` * nits: Extract to method * nits: Use `sys_exec` instead of `system` * Clean go module cache after test Workaround following error ``` 1) bundle gem gem naming with underscore --ext parameter set with go includes go_gem extension in extconf.rb Failure/Error: FileUtils.rm_r(dir) Errno::EACCES: Permission denied @ apply2files - /home/runner/work/rubygems/rubygems/bundler/tmp/2.2/home/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/decode_test.go # ./spec/support/helpers.rb:37:in `block in reset!' # ./spec/support/helpers.rb:21:in `each' # ./spec/support/helpers.rb:21:in `reset!' # ./spec/spec_helper.rb:130:in `block (2 levels) in <top (required)>' # /home/runner/work/rubygems/rubygems/lib/rubygems.rb:303:in `load' # /home/runner/work/rubygems/rubygems/lib/rubygems.rb:303:in `activate_and_load_bin_path' ``` Files installed with `go get` have permissions set to 444 ref. https://github.com/golang/go/issues/35615 ``` $ ls -l /home/runner/work/rubygems/rubygems/bundler/tmp/2.2/home/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/decode_test.go -r--r--r-- 1 runner runner 42320 Nov 15 06:38 /home/runner/work/rubygems/rubygems/bundler/tmp/2.2/home/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/decode_test.go ``` So they cannot be deleted by `FileUtils.rm_r`. Therefore, this is necessary to execute `go clean -modcache` separately from `FileUtils.rm_r` to circumvent it. * Remove needless changes ref. https://github.com/ruby/rubygems/pull/8183#discussion_r2532902051 * ci: setup-go is needless * Don't run go command in `bundle gem` ref. https://github.com/ruby/rubygems/pull/8183#discussion_r2532765470 * Revert unrelated date changes --------- https://github.com/ruby/rubygems/commit/260d7d60b3 Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2025-10-27[ruby/rubygems] bundler_4_mode always return trueHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/b2e1810067
2025-10-15[rubygems/rubygems] Fixed wrong option messageHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/15be905c44
2025-10-15[rubygems/rubygems] Replaced Bundler::SharedHelpers.major_deprecation to ↵Hiroshi SHIBATA
feature_removed! or feature_deprecated! https://github.com/rubygems/rubygems/commit/b1b963b34a Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com>
2025-10-10[rubygems/rubygems] Make default_cli_command flag to settingsHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/31d67ecc05
2025-10-10[rubygems/rubygems] Replaced Bundler.feature_flag.plugins? to Bundler.settingsHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/ced8ef3a12 Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com>
2025-09-19[rubygems/rubygems] Completely remove passing `--ext` to `bundle gem` ↵David Rodríguez
without a value https://github.com/rubygems/rubygems/commit/9f34bf6854 Co-authored-by: Martin Emde <martinemde@users.noreply.github.com>
2025-09-19[rubygems/rubygems] Make `bundle show --outdated` raise an errorDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3bbbf4a4e5
2025-09-17[rubygems/rubygems] Finalize `bundle install --binstubs` removalDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ccb65ce0ea
2025-09-17[rubygems/rubygems] Fix grammar in `bundle install --binstubs` removal messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/feb258c712
2025-09-17[rubygems/rubygems] Move `bundle install --binstubs` deprecation to cli.rbDavid Rodríguez
For consistency with the other deprecations. https://github.com/rubygems/rubygems/commit/28e300cee1
2025-09-17[rubygems/rubygems] Make `bundle remove --install` raise an errorDavid Rodríguez
https://github.com/rubygems/rubygems/commit/444022cfd3
2025-09-16[rubygems/rubygems] Complete rubocop flags and settings removalDavid Rodríguez
If the CLI flags are used, we abort early as usual. As per the settings, I decided to ignore them. We've been migrating them automatically to the new name for a long time and we don't yet have a standard way to deprecate and remove settings (we should probably use the existing setting validators). So I think it's fine for now to do what we normally do (ignore the setting). https://github.com/rubygems/rubygems/commit/8311de6e69
2025-09-11[rubygems/rubygems] Complete remembered options removalDavid Rodríguez
https://github.com/rubygems/rubygems/commit/573ffad3ea
2025-09-11[rubygems/rubygems] Fix grammar in remembered options removal messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/825e29a9ec
2025-09-11[rubygems/rubygems] Add missing part in `bundle cache --path` removal messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f5bf473b34
2025-09-03[rubygems/rubygems] Deprecate `bundle cache --frozen` and `bundle cache ↵David Rodríguez
--no-prune` Since they are remembered flags, too. I also restored a previous spec about `--frozen`, but didn't bother with `--no-prune`. https://github.com/rubygems/rubygems/commit/7802f016fc
2025-09-03Completely remove `bundle viz` commandDavid Rodríguez
2025-09-03Completely remove `bundle inject` commandDavid Rodríguez
2025-09-03[rubygems/rubygems] The `bundle clean` command should not be hiddenDavid Rodríguez
https://github.com/rubygems/rubygems/commit/eab6366e2e
2025-08-18[rubygems/rubygems] Consistently use banner of desc when defining CLI flagsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/2cbe7ea0a5
2025-08-18[rubygems/rubygems] Fix `bundle show --verbose` and recommend it as an ↵David Rodríguez
alternative to `bundle show --outdated` https://github.com/rubygems/rubygems/commit/7cad1e4947
2025-08-18[rubygems/rubygems] Introduce `bundle list --format=json`Schneems
The `bundle list` command is a convenient way for human to know what gems and versions are available. By introducing a `--format=json` option, we can provide the same information to machines in a stable format that is robust to UI additions or modifications. It indirectly supports `Gemfile.lock` modifications by discouraging external tools from attempting to parse that format. This addition allows for the scripting of installation tools, such as buildpacks, that wish to branch logic based on gem versions. For example: ```ruby require "json" command = "bundle list --format=json" output = `#{command}` raise "Command `#{command}` errored: #{output}" unless $?.success? railties = JSON.parse(output).find {|gem| gem["name"] == railties } if railties && Gem::Version.new(railties["version"]) >= Gem::Version.new("7") puts "Using Rails greater than 7!" end ``` The top level is an object with a single key, "gems", this structure allows us to add other information in the future (should we desire) without having to change the json schema. https://github.com/rubygems/rubygems/commit/9e081b0689
2025-08-18[rubygems/rubygems] Fix Bundler printing more flags than actually passed in ↵David Rodríguez
verbose mode This reverts commit https://github.com/rubygems/rubygems/commit/bea87eab0b17 and adds a regression spec for it. https://github.com/rubygems/rubygems/commit/ac98107864
2025-08-18[rubygems/rubygems] Fix `bundle cache --no-all` not printing a deprecation ↵David Rodríguez
warning Like others, it's a remembered option which we are deprecating in favor of configuration. https://github.com/rubygems/rubygems/commit/9ea55e0df2
2025-07-17Cancel `--force` deprecation in favor of `--redownload`David Rodríguez
I realized `--redownload` is not a good name, because it does not necessarily redownloads gems. It only forces reinstallation even if gem is already installed. So I believe `--force` is actually a better name and the introduction of `--force` was a misunderstanding of what the `--force` flag did at the time. Let's cancel the deprecation of `--force`. For now the `--redownload` alias is left around until we decide what to do with it.
2025-07-17[rubygems/rubygems] Fix `bundle binstub --path=foo` not printing a ↵David Rodríguez
deprecation warning Like others, it's a remembered option which we are deprecating in favor of configuration. https://github.com/rubygems/rubygems/commit/801d5dd943
2025-07-17[rubygems/rubygems] Fix `bundle cache path=foo` not printing a deprecation ↵David Rodríguez
message https://github.com/rubygems/rubygems/commit/0af03eea5d
2025-07-17[rubygems/rubygems] Remove unnecessary `flag_deprecation` methodDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d1f8e1c4ac
2025-07-17[rubygems/rubygems] Refactor remembered flag deprecation logicDavid Rodríguez
https://github.com/rubygems/rubygems/commit/88dd7d2d45
2025-07-03Sync RubyGemsDavid Rodríguez
2025-07-02[rubygems/rubygems] Add a `verbose` setting to enable verbose output for all ↵David Rodríguez
commands https://github.com/rubygems/rubygems/commit/0aa1be946f
2025-07-02[rubygems/rubygems] Consistently access CLI flags with symbolsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/1497d3f146
2025-07-02[rubygems/rubygems] Log when `simulate_version` is enabledDavid Rodríguez
Tweak version output and verbose mode to be transparent about Bundler simulating a different version than the real one. https://github.com/rubygems/rubygems/commit/179354d153
2025-07-02[rubygems/rubygems] None of the global options have default so this seems ↵David Rodríguez
unnecessary https://github.com/rubygems/rubygems/commit/bea87eab0b
2025-07-02[rubygems/rubygems] Remove `print_only_version_number` settingDavid Rodríguez
I don't think it makes sense to make this tiny behavior change configurable. If someone wants to parse version output, and we have a public setting, they are going to need to accommodate their regexps to both values of the setting. In addition to this, I plan to enhance version output with a note about "simulated version", and in that case, "print_only_version_number" would no longer hold, since what we print will be more than that anyways. So, I'd like to remove the setting and change the output in Bundler 4 with no way to opt out. https://github.com/rubygems/rubygems/commit/d84e9dcf09
2025-06-30[rubygems/rubygems] Use Bundler.settings[gem.bundle]Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/b16511598e
2025-06-30[rubygems/rubygems] Added bundle option to method_optionHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/1413086e92
2025-06-19Skip to Bundler 4 directlyDavid Rodríguez