Commit graph

104 commits

Author SHA1 Message Date
David Rodríguez
63c4223775 [rubygems/rubygems] Don't create an empty bundled_app when setting up deps
Running everything in `bundled_app` by default causes the `bundled_app`
helper to be used everytime, and that will create a scoped bundled_app
folder if it does not exist. That causes `bin/rake spec:deps` to create
an empty `tmp/2.1/bundled_app` folder which is a bit weird.

This commit changes specs to not switch to a (possibly empty)
bundled_app directory when not necessary (for example, when running
`gem` commands in order to setup test dependencies).

4bf89c0705
2025-07-25 11:10:36 +09:00
David Rodríguez
c115e3d974
[rubygems/rubygems] bundle exec does not need artifice in general
cb1f19573a
2025-06-24 12:10:50 +09:00
David Rodríguez
6d8460e0a0
[rubygems/rubygems] Fix running gem commands in a bundle exec context
They should only load plugins from gems in the bundle.

a229507820
2025-06-19 10:23:36 +09:00
David Rodríguez
3ba066e54f
[rubygems/rubygems] Improve more exec specs to avoid swallowing errors
439e9bcf81
2025-06-06 10:09:14 +09:00
David Rodríguez
3b2d068ac2
[rubygems/rubygems] Improve bundle exec with default gems specs
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
2025-06-06 10:09:14 +09:00
Hiroshi SHIBATA
de9ce8c0e0 Use erb executable again
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2025-03-12 18:02:09 +09:00
David Rodríguez
51958bae66 [rubygems/rubygems] Prefer FileUtils.rm_r to FileUtils.rm_rf for specs
Because it does not swallow errors if it fails to remove the given
folders, making issues easier to debug.

0db12d7afc
2025-03-12 18:02:09 +09:00
Hiroshi SHIBATA
3294d3d457
[rubygems/rubygems] Skip default gems executable example with Windows platform
b4a8bda811
2025-02-28 12:34:57 +09:00
Hiroshi SHIBATA
0cac191c6e
[rubygems/rubygems] Update version for broken executables with default gems
d2f90a81d9
2025-02-28 12:34:57 +09:00
Hiroshi SHIBATA
4f19f23036
Use erb for simple executable example 2025-02-27 19:53:24 +09:00
Hiroshi SHIBATA
921ca9d8a8
Use syntax_suggest instead of erb executable.
erb is only working with Ruby 3.5dev.
2025-02-27 19:50:14 +09:00
Hiroshi SHIBATA
3e8bf097ce Use erb executable instead of irb 2025-02-27 15:48:26 +09:00
Hiroshi SHIBATA
af508a6d10 Skip irb examples, I will handle related workarounds later 2025-01-30 11:24:34 +09:00
sodacris
3b519975d1 [rubygems/rubygems] remove unnecessary code
5c6ca7a58c
2025-01-02 21:02:47 +00:00
sodacris
7bf1612c87 [rubygems/rubygems] unskip print_args and fake_man tests on Windows
c8eeb0af9d
2025-01-02 21:02:46 +00:00
sodacris
a7383fc7f4 [rubygems/rubygems] Replace shell specific stuff with create_file scripts
eea07ad691
2025-01-02 21:02:46 +00:00
David Rodríguez
73c4023c2d [rubygems/rubygems] Enable pending exec spec
This is how Ruby works, and it's not going to change. So let's run the
test since it makes no sense to keep it pending.

5f78d3c737
2024-11-29 15:29:33 +00:00
David Rodríguez
d2e5994161 [rubygems/rubygems] Improve heredoc indentation in exec specs
abb658757f
2024-11-29 15:29:32 +00:00
David Rodríguez
8b75164381 [rubygems/rubygems] Unify specs testing Bundler.setup failing behavior
They had slightly different behavior in Bundler 2 and Bundler 3 because
Bundler 3 will auto-clean after `bundle install`, so one of them system
installed gems won't be present when `Bundler.setup` fails.

We can unify the specs by moving installing system gems to _after_
`bundle install`, so the behavior in both cases is the same. Also, only
this spec actually needs these gems installed, so we can move that from
the `before` block to the body of the spec.

b7251ec9c6
2024-11-29 15:29:32 +00:00
sodacris
42b0d46416 [rubygems/rubygems] move system_gems let commands
1fc1e74f4d
2024-11-21 10:29:32 +00:00
David Rodríguez
b843d4ee14 [rubygems/rubygems] Fix running bundler (with a final r) in a bundle exec context
ad95a1dfaa
2024-10-23 08:52:46 +00:00
Samuel Giddins
db6e6155d6 [rubygems/rubygems] Remove outdated conditionals from tests
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

06eec6d855
2024-10-04 20:01:51 +00:00
Nobuyoshi Nakada
f2f9d6ce49
Fix test failure of e7610582ad 2024-07-24 14:04:13 +09:00
David Rodríguez
e7610582ad [rubygems/rubygems] Fix bundle exec gem uninstall
* `bundle exec` assigns `Gem::Specification.all` to the set of specs
  known to Bundler (a `Bundler::SpecSet`).

* `gem uninstall` recently started calling `#delete` on the set of specs
  stored in `Gem::Specification#all`. This, in RubyGems, is just an
  array of specs, so has a `#delete` method that receives a single
  element.

* However, at some point I added a `SpecSet#delete` method that takes an
  array of specs, breaking the "Array-like" contract and making `gem
  uninstall` break when run in a `bundle exec` context.

The fix is to make `Bundler::SpecSet#delete` handle being given a single
spec.

e3acb7b01d
2024-07-23 19:43:26 +00:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
Thomas Marshall
b88ac94eec [rubygems/rubygems] Only validate resolution info in Bundler
This commit switches out the full gemspec validation for a partial one
which only performs resolution related checks. This will allow gem
authors to run `bundle` commands immediately after creating a new gem
with Bundler, rather than having to fix metadata validation issues in
the default gemspec.

d5aa9cae9d
2024-06-25 14:32:20 +00:00
David Rodríguez
744dd5a362 [rubygems/rubygems] Fix performance regression on applications with a local cache
Even if all gems are properly installed and no resolve is needed, we
recently started always reading all packages in `vendor/cache` and
extracting specifications from them.

This commit fixes the problem by longer making considering cached specs
the default and only enable them when a resolve is actually needed.

edeb2c42bf
2024-05-24 15:02:30 +00:00
David Rodriguez
7b3ef370f8 [rubygems/rubygems] Fix incorrect bundle update --bundler message
146de56353
2024-03-22 13:14:42 +00:00
Yusuke Endoh
92eab382e4 Update the error message format in bundler 2024-02-15 18:42:31 +09:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Samuel Giddins
62e2e1da92 [rubygems/rubygems] Allow auto-install to install missing git gems
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
2023-11-30 03:41:15 +00:00
David Rodríguez
50482cd1e5 [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in Bundler
93619c97ff
2023-11-13 11:06:10 +09:00
David Rodríguez
0e7536bf49 [rubygems/rubygems] Prefer squiggly heredocs over custom helper
258476c38a
2023-07-24 14:59:34 +09:00
Nobuyoshi Nakada
348412c7fa [rubygems/rubygems] Use indented heredoc
085d2776d8
2023-03-22 21:21:08 +00:00
David Rodríguez
72591eb73f [rubygems/rubygems] Better suggestion when bundler/setup fails due to missing gems
If the original `BUNDLE_GEMFILE` is different from the default, then the
suggestion wouldn't work as is.

Before:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install` to install missing gems.

$  rubygems git:(better-cmd-suggestion) ✗ bundle install
Could not locate Gemfile
```

After:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb` to install missing gems.

$ bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb
Fetching gem metadata from https://rubygems.org/.........
Using ast 2.4.2
Using bundler 2.4.7
Using parser 3.1.2.0
Using rainbow 3.1.1
Using parallel 1.22.1
Using regexp_parser 2.5.0
Using rubocop-ast 1.18.0
Using rexml 3.2.5
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.1.0
Fetching rubocop 1.30.1
Installing rubocop 1.30.1
Using rubocop-performance 1.14.2
Bundle complete! 2 Gemfile dependencies, 12 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$ util/rubocop
Inspecting 345 files
.........................................................................................................................................................................................................................................................................................................................................................

345 files inspected, no offenses detected
```

bf1320d805
2023-03-07 16:51:36 +09:00
Hiroshi SHIBATA
38fa8eb4cb Merge rubygems/bundler master
Pick from e9304aed7e
2023-02-21 19:28:12 +09:00
Hiroshi SHIBATA
ff3d7b720e Merge RubyGems and Bundler master 2022-02-28 11:39:20 +09:00
David Rodríguez
8d29d1292b [rubygems/rubygems] Improve errors a bit more
f481e8f41a
2021-12-17 16:35:20 +09:00
David Rodríguez
af4b4fd19b [rubygems/rubygems] Improve resolver error messages
Use a more standard naming for gems.

75121e83f1
2021-12-17 16:35:17 +09:00
Hiroshi SHIBATA
7e084ed707 Merge RubyGems and Bundler master
Merge from 793ad95ecb
2021-12-15 18:05:18 +09:00
Hiroshi SHIBATA
f3bda8987e
Merge the master branch of rubygems repo
Picked from 4b498709a0
2021-11-16 20:19:13 +09:00
David Rodríguez
0b4dbe2e6a [rubygems/rubygems] Improve "gem not found in source" errors
When printing sources inside these error messages, it's useful to only
consider the current state of the source. For example, when requiring
`bundler/setup`, the source shouldn't be configured to be able to hit
the network, so the error message should only mention "locally installed
gems" to make that more clear.

30eb14f853
2021-08-31 19:06:14 +09:00
David Rodríguez
81c0643762 [rubygems/rubygems] Remove unnecessary escape sequences
Bundler formatters already take care of this.

c24415fdd5
2021-08-31 19:06:14 +09:00
Daniel Niknam
2f9e0cf181
[rubygems/rubygems] Explicitly define a global source for tests
This is in preparation for deprecating source-less gemfiles.

d6493fa3e2
2021-07-27 09:25:57 +09:00
Hiroshi SHIBATA
896bbb9fad Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9 2021-07-14 10:48:07 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Hiroshi SHIBATA
69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Hiroshi SHIBATA
339227363c Merge RubyGems 3.2.3 and Bundler 2.2.3 2020-12-23 10:17:41 +09:00
Hiroshi SHIBATA
2fa9f3c032 Prepare to release rubygems-3.2.1 and bundler-2.2.1 2020-12-15 10:54:09 +09:00
Hiroshi SHIBATA
473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00