Commit graph

35 commits

Author SHA1 Message Date
Earlopain
560edfc8f7
[rubygems/rubygems] Fix bundle console printing bug report template on NameError during require
Followup to https://github.com/rubygems/rubygems/pull/8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.

1c910e5afe
2025-07-02 10:34:19 +09:00
David Rodríguez
192e57db31 [rubygems/rubygems] Remove spec.source duplication
24523a839e
2025-03-24 13:25:07 +09:00
David Rodríguez
9b2ebfc729 [rubygems/rubygems] Fix bug report template incorrectly showing up
If a gem has an internal error, that should not make `bundle console`
print the bug report template.

7432a9a084
2025-01-28 15:31:57 +09:00
David Rodríguez
83b4de8520 [rubygems/rubygems] Remove unnecessary check
At this point, `dep.autorequire` is always nil.

0fb2b0a70a
2025-01-28 15:31:57 +09:00
David Rodríguez
0e985e13fe [rubygems/rubygems] Remove unnecessary initialization
This local variable is initialized later on in this file.

5c15dbd210
2025-01-28 15:31:56 +09:00
David Rodríguez
6460777cde [rubygems/rubygems] Retry namespaced require using retry
It's simpler.

76f1e3bf05
2025-01-28 15:31:55 +09:00
David Rodríguez
7ae6aa0efc [rubygems/rubygems] Handle all Bundle.require exceptions at the same level
a5519f4f79
2025-01-28 15:31:55 +09:00
David Rodríguez
d157aa7a97 [rubygems/rubygems] Remove dead code
LoadError is not a RuntimeError.

4c67549722
2025-01-28 15:31:54 +09:00
David Rodríguez
ee7ff4a12b [rubygems/rubygems] Backwards compatibility for 2.5.17-2.5.23 caches
9dbfce76cf
2024-11-29 15:27:40 +00:00
David Rodríguez
9a4d91fa95 [rubygems/rubygems] Restore previous application cache format for git sources
And make sure `bundle install --local` can install from it without git.

7d6b631620
2024-11-29 15:27:39 +00:00
David Rodríguez
963f98a94f [rubygems/rubygems] Enable Performance/MapCompact cop
0c3a65871a
2024-11-26 15:11:05 +09:00
David Rodríguez
4b44590d39 [rubygems/rubygems] Keep only the bare clone in the per app cache
We don't need an actual checkout since the cache path is no longer used
as the install location. Now the per app cache acts just like the
standard cache.

686988923c
2024-07-23 20:15:10 +00:00
David Rodríguez
a4ec5f8747 [rubygems/rubygems] Stop removing the .git folder from cached git gems
If we want to change git gems to use a proper cache, instead of using
the cache folder as the install location, so we need to keep git
information in the cache, so that when running `bundle install` or
`bundler install --local`, we are able to figure out whether the
revision that needs to be checked out is present locally in the cache or
needs to be fetched from the remote repository.

607eda63eb
2024-07-23 20:15:09 +00:00
David Rodríguez
7e612b7414 [rubygems/rubygems] Fix strange error when running bundle add with frozen mode set
If Gemfile is empty and there's no lockfile (situation after `bundle init`), and
`frozen` is configured, running `bundle add` will result in an strange
error, like this:

```
$ bundle add rake
, but the lockfile can't be updated because frozen mode is set

You have deleted from the Gemfile:
* rake (~> 13.2)

Run `bundle install` elsewhere and add the updated Gemfile to version control.
```

This commit fixes the problem to instead print

152331a9dc
2024-07-10 08:04:07 +00:00
Hiroshi SHIBATA
7522d1bffe [rubygems/rubygems] Keep backword compatibility of Bundler.require
f6f79f4c37
2024-04-19 05:18:21 +00:00
fatkodima
09cbbe0e3d [rubygems/rubygems] Add plugin hooks for Bundler.require
b373b7ed0d
2024-04-19 05:18:20 +00:00
David Rodríguez
24d5e7176e
[rubygems/rubygems] Refactor lockfile generation
6a0c03c77f
2024-02-08 14:43:56 +09:00
David Rodríguez
5cf6f7f885
[rubygems/rubygems] Remove more methods now defined in all RubyGems versions
e015200ffa
2023-12-14 20:22:48 +08:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
David Rodríguez
21238f38a8 [rubygems/rubygems] Extract Definition#no_resolved_needed?
1ff8626571
2023-06-15 07:01:23 +09:00
David Rodríguez
9101269e94 [rubygems/rubygems] Move rubygems source specific logic to rubygems source
6aa4c422a7
2022-07-02 19:41:02 +09:00
David Rodríguez
00e5e827b1 [rubygems/rubygems] Cleanup old legacy code
531d6b5fee
2022-05-09 21:25:23 +09:00
David Rodríguez
ed0f326e88 [rubygems/rubygems] Leave ":" after MANPATH when not set
So that system man pages still work after a gem with man pages overrides
it.

1031879b87
2021-11-02 00:28:28 +09:00
David Rodríguez
d6627ab85c [rubygems/rubygems] Remove unnecessary code
All supported rubygems versions implement this.

2130782ef6
2021-10-13 16:21:41 +09:00
David Rodríguez
fe47ac213b [rubygems/rubygems] Remove unnecessary exception
If we have succeeded to materialize the bundle, all specs should be
loaded.

bd3712d824
2021-08-31 19:06:14 +09:00
David Rodríguez
8116b7fef7 [rubygems/rubygems] Move rescue block around the code that can raise it
310937a546
2021-08-31 19:06:14 +09:00
Hiroshi SHIBATA
896bbb9fad Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9 2021-07-14 10:48:07 +09:00
Hiroshi SHIBATA
d386a58f6f Merge bundler-2.2.0.rc.2 2020-10-15 17:19:02 +09:00
Jean Boussier
40f73b3a00 [rubygems/rubygems] Avoid calling LoadError#message because of its slowness
Instead we can rely on `LoadError#path`

16d5c3b43c
2020-07-15 16:05:12 +09:00
Hiroshi SHIBATA
8f37629519 Merge bundler master from upstream.
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
2019-06-09 12:44:10 +09:00
hsbt
68ddd4d300 Merge Bundler 2.1.0.pre.1 as developed version from upstream.
a53709556b

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 06:01:35 +00:00
hsbt
59c8d50653 Added bundler as default gems. Revisit [Feature #12733]
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*:
    Merge from latest stable branch of bundler/bundler repository and
    added workaround patches. I will backport them into upstream.
  * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite
    of bundler.
  * tool/sync_default_gems.rb: Added sync task for bundler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 23:07:56 +00:00
hsbt
7825e8363d Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
  I have no time to resolve it issue before 2.5 final release.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 23:08:05 +00:00
hsbt
be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00
hsbt
8598f8c2dc Merge bundler to standard libraries.
rubygems 2.7.x depends bundler-1.15.x. This is preparation for
  rubygems and bundler migration.

  * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4
  * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches.
    * https://github.com/bundler/bundler/pull/6007
    * Exclude not working examples on ruby repository.
    * Fake ruby interpriter instead of installed ruby.
  * Makefile.in: Added test task named `test-bundler`. This task is only
    working macOS/linux yet. I'm going to support Windows environment later.
  * tool/sync_default_gems.rb: Added sync task for bundler.

  [Feature #12733][ruby-core:77172]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08 08:45:41 +00:00