| Age | Commit message (Collapse) | Author |
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
PR #15822 fixed the warning for direct hyphenated gem requires like
`benchmark/ips` → `benchmark-ips`. However, hyphenated gems often
provide multiple files under their namespace.
For example, `benchmark-ips` provides:
- benchmark/ips.rb
- benchmark/timing.rb
- benchmark/compare.rb
When requiring `benchmark/timing`, the previous fix only checked for
`benchmark-timing` gem (doesn't exist), not `benchmark-ips` which
actually provides the file.
This fix checks if ANY gem matching `{prefix}-*` is in the bundle
specs, which covers all subfeatures provided by hyphenated gems.
Reported in https://github.com/ruby/ruby/pull/15822#issuecomment-123456
|
|
This patch silences the "this won't work in the next version of Ruby"
warning displayed when irb is autoloaded via `binding.irb`.
main.rb:1: warning: irb used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
You can add irb to your Gemfile or gemspec to fix this error.
/.../irb.rb:9: warning: reline used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
You can add reline to your Gemfile or gemspec to fix this error.
From: main.rb @ line 1 :
=> 1: binding.irb
/.../input-method.rb:284: warning: rdoc used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
You can add rdoc to your Gemfile or gemspec to fix this error.
This warning is incorrect and misleading: users should not need to
include irb (and its dependencies) to their Gemfiles to use
`binding.irb`, even in future versions of Ruby. It is agreed that the
runtime takes care of that.
|
|
|
|
Bundler::Runtime#setup requires a real existing lockfile (see
Bundler::SharedHelpers#default_lockfile).
|
|
This patch fixes a problem where `binding.irb` (= force_activate('irb'))
fails under `bundle exec` when the Gemfile does not contain `irb` and
does contain a gem which is (1) not installed in GEM_HOME (2) sourced
using `path:`/`git:`.
The original approach constructing a temporary definition fails since
it does not set the equalivent of `path:`/`git:`.
Always reconstructing a definition from a Gemfile and applying lockfile
constraints should be a more robust approach.
[Bug #21723]
|
|
When requiring a file like "benchmark/ips", the warning system would
incorrectly warn about the "benchmark" gem not being a default gem,
even when the user has "benchmark-ips" (a separate third-party gem)
in their Gemfile.
The fix checks if a hyphenated version of the require path exists in
the bundle specs before issuing a warning. For example, requiring
"benchmark/ips" now checks for both "benchmark" and "benchmark-ips"
in the Gemfile.
[Bug #21828]
|
|
|
|
|
|
|
|
|
|
|
|
Make Gem::BUNDLED_GEMS.uplevel returns `nil` if `require` frame is not
found, for the simplicity.
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12847
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12847
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13017
|
|
Currently evenn if the require actually fails, they suggest that the
file was actually loaded, which is confusing. I reworded them to reduce
this confusion.
|
|
The name "gem" could be confused with RubyGems activation method.
|
|
Most of the stuff is not actually necessary.
|
|
If anything, I think this may be causing some false positives.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12624
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12624
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12529
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12439
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12412
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12412
|
|
Original issue: https://github.com/ruby/rdoc/issues/1128
The problem is caused by the `# :stopdoc:` directive in `bundled_gems.rb`,
which's scope covers the redefinition of `LoadError`.
Since the goal of `# :stopdoc:` is to hide the documentation of `Gem::BUNDLED_GEMS`,
we can use `# :nodoc:` on it instead.
Notes:
Merged: https://github.com/ruby/ruby/pull/12317
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12179
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12096
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12096
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12096
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12086
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12086
|
|
I don't want to make bundled_gems.rb more complex and complicate.
Revert "Fixed warning condition with LoadError"
This reverts commit 3a9e48b9a4860022f43d8101c0f3249299437886.
Revert "Only warn fiddle as optional dependency"
This reverts commit ff3f61556fb62d12d57d017f4c54f1a8fd5208be.
Revert "Only `warn` about bundled gems when require succeeds"
This reverts commit a70adce1ce5fae8eaae385214ac0d2e7d17c1103.
Notes:
Merged: https://github.com/ruby/ruby/pull/12072
|
|
We should stop warnings at some point. I decided to that period EOL-ed versions.
ex. In 2024, Ruby 3.0 is EOL. we removed webrick, rexml, rss from warning targets.
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11550
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11560
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11560
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11357
|
|
Like the following scenario with bootsnap, that frames are same or smaller than frame_to_skip(=3).
---
"/Users/hsbt/.local/share/rbenv/versions/3.3-dev/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'"
"/Users/hsbt/.local/share/gem/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'"
"test_warn_bootsnap.rb:11:in `<main>'"
---
|
|
The `2` skipped frames went out of sync and now it should be `3`.
Rather than just update the offset, we can implement a way that
is adaptative as long as all require decorators are also called require.
Also we should compute the corresponding `uplevel` otherwise the
warning will still point decorators.
Co-authored-by: "Hiroshi SHIBATA" <hsbt@ruby-lang.org>
|
|
This change didn't work with Ruby 3.3.
We should revert this to test bundled_gems.rb with Ruby 3.3.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11296
|