The mirror probing spec file was moved to our regular suite, which runs
in parallel, recently. These specs rely on starting and stopping actual
servers in localhost, but this does not play nice with parallelization,
because a spec may kill the webserver another spec has created.
This commit moves mirror probing specs to not need to start servers in
localhost and do something more similar to what the other specs do.
ca9a19706f
Currently to test Bundler 3 mode we have to actually edit the version
file to simulate we're running a future version. This is inconvenient.
Instead, allow passing an environment variable, `BUNDLER_3_MODE`, to set
the "working mode" Bundler should use.
This can now be set easily by end users to enable them to try out the
changes in the future version and give us feedback.
It's unclear how version auto-switching should work when this
environment variable is set, so the auto-switching feature will be
disabled in that case.
4e92e9b209
The "ignore" attribute is a RubyGems thing to mark when a installed gem
should be ignored for activation because its extensions are not properly
compiled.
In the case of gems from path sources, the warning is not accurate
because extensions are compiled into the local lib path, which is not
where RubyGems leaves its sentinel `gem.build_complete` file.
Also, there's a single version of each gem in the path source available
to Bundler, so we always certainly want to consider that for activation
and never makes sense to ignore it.
ec5d33695e
This changeset suppresses backtrace locations like
`<internal:array>:211` as much as possible.
Before the patch:
```
$ ruby -e '[1].fetch_values(42)'
<internal:array>:211:in 'Array#fetch': index 42 outside of array bounds: -1...1 (IndexError)
from <internal:array>:211:in 'block in Array#fetch_values'
from <internal:array>:211:in 'Array#map!'
from <internal:array>:211:in 'Array#fetch_values'
from -e:1:in '<main>'
```
After the patch:
```
$ ./miniruby -e '[1].fetch_values(42)'
-e:1:in 'Array#fetch_values': index 42 outside of array bounds: -1...1 (IndexError)
from -e:1:in '<main>'
```
Specifically:
* The special backtrace handling of BUILTIN_ATTR_C_TRACE is now always
applied to frames with `<internal:...>`.
* When multiple consecutive internal frames appear, all but the bottom
(caller-side) frame are removed.
[Misc #20968]
```
❯ bin/rspec ./spec/bundler/friendly_errors_spec.rb
/Users/hsbt/Documents/github.com/rubygems/rubygems/bundler/spec/bundler/friendly_errors_spec.rb:5: warning: CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
If you need to use the full features of CGI library, Please install cgi gem.
```
a23a951004
Make Kernel#inspect ask which instance variables should be dumped by
the result of `#instance_variables_to_inspect`.
Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
Currently ruby-dev installs an incorrect gemspec for rdoc, that does not
declare its dependency on psych.
This seems like a ruby-core bug, but it seems best for Bundler to ignore
it, go with the remote specification instead, and print a warning.
227cafd657
Make them more consistent and not silently pass even if something
regresses. These specs had a typo that made the assertion be that the
`erb --version` output includes the empty string which is always
obviously true.
451e07c305
If the `ref` option is a specific commit SHA, we can check to see if
it's already fetched locally. If it is, then we don't need to re-fetch
it from the remote.
The `ref` option might not be a commit SHA, so we're using the `#commit`
method which returns the full SHA if it's a commit ref, or the locked
revision, or nil.
This is a small improvement that will make `bundle update` slightly
faster in cases for git-sourced gems pinned to a specific commit.
f434c2e66c
This commit adds tests to capture the current behavior of `#checkout`.
They are not exhaustive, but they cover cases cloning and fetching the
repository with different ref types. This will make it easier to change
the caching behavior in a subsequent commit.
f637a412a6
Array#to_a, Hash#to_h, Enumerable#to_a, and Enumerable#to_h do not
allow you to specify subclasses. This has undesired behavior when
passing non-Set subclasses. All of these are currently allowed, and
none make sense:
```ruby
enum = [1,2,3].to_enum
enum.to_set(Hash)
enum.to_set(Struct.new("A", :a))
enum.to_set(ArgumentError)
enum.to_set(Thread){}
```
Users who want to create instances of a subclass of Set from an
enumerable should pass the enumerable to SetSubclass.new instead of
using to_set.
If you have
```
gem "rails", git: "https://github.com/rails/rails"
```
and then explicitly pin to an older ref, like
```
gem "rails", git: "https://github.com/rails/rails", ref: "99bacb5aa8"
```
Then `bundle install` fails, because locked sources fail to be updated
to use the new source.
This commit fixes the problem by making sure get their source properly
replaced.
5de8c2e0cf
Let them run against the version resolved by the `test_gems.rb` gemfile.
This should fix ruby-core CI job that was broken by the release of rake
13.3.0.