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.
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.
d84e9dcf09
Such is the case if you embed JRuby into an application dynamically (such
as via OSGi). From my test environment:
```
irb(main):006:0> $LOADED_FEATURES.grep(/cli.rb/)
=> ["uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/cli.rb"]
```
75ac5d46a7
We did this because RubyGems `require` would call `gem` on self, so
defining a `gem` method in the CLI would cause conflicts. However, this
is not the case since
439c446489,
so this should no longer be necessary.
3e5c861046
We have some places that already use `bundle config auto_install true`,
ie:
7a144f3374/bundler/lib/bundler/cli.rb (L11)
This applies the same logic (copy and pasted) to happen when you
`require "bundler/setup"`.
bb3c922341
Bundler online documentation says that if the gem is located within a subdirectory of a git repository,
you can use the `:glob` option to specify the location of its .gemspec
`gem 'cf-copilot', git: 'https://github.com/cloudfoundry/copilot', glob: 'sdk/ruby/*.gemspec'`
This change allows for equivalent functionality from the bundler CLI
`bundle add cf-copilot --git=https://github.com/cloudfoundry/copilot --glob=sdk/ruby/*.gemspec`
91052e5868
Generally the removed message is very similar, but often it needs to
specify that the feature has "been removed" instead of "will be
removed", or "been deprecated". And a few chunks of text needed more
substantial updates. And a number of them seemed to have been carefully
crafted to make sense in either context, so I left those alone.
8d42cf9104
Currently, auto-install with git gems fails, when
it would succeed with a rubygems-source gem
Fix the issue by doing the same fallback for git errors as we do for
missing gems, the git errors should only bubble up in these cases when
the gem is not installed, meaning we want to go through the install flow
(and any persistent errors will be raised through there)
e25a339f7a
Gem::RemoteFetcher uses Gem::Request, which adds the RubyGems UA.
Gem::RemoteFetcher is used to download gems, as well as the full index.
We would like the bundler UA to be used whenever bundler is making
requests.
This PR also avoids unsafely mutating the headers hash on the shared
`Gem::RemoteFetcher.fetcher` instance, which could cause corruption or
incorrect headers when making parallel requests. Instead, we create one
remote fetcher per rubygems remote, which is similar to the connection
segregation bundler is already doing
f0e8dacdec