-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport warning feature for bundled gems from master (#11420)
* Make sure to always use the right `warn` * lib/bundled_gems.rb: more reliable caller detection 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" <[email protected]> * Warn ostruct for Ruby 3.5 * Warn pstore for Ruby 3.5 * Mark rdoc as bundled gems at Ruby 3.5 * Warn to use win32ole without Gemfile for Ruby 3.5 * EXACT list is mostly same as SINCE list on bundled gems. * Mark to warn fiddle as bundled gems for Ruby 3.5 * Mark to warn logger as bundled gems for Ruby 3.5 * We should use uplevel:2 in another case. 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>'" --- * Delete unnecessary rubocop disable comment * Show correct script name with sub-feature case * Skip to show script name with using ruby -r option * Don't show script name when bundle exec and call ruby script directly. * Pick word fix from 34adc07 --------- Co-authored-by: David Rodríguez <[email protected]> Co-authored-by: Jean Boussier <[email protected]> Co-authored-by: Kentaro Takeyama <[email protected]>
- Loading branch information
1 parent
66312ad
commit 9ae91eb
Showing
3 changed files
with
84 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module My | ||
def warn(msg) | ||
end | ||
|
||
def my | ||
require "bundler/inline" | ||
|
||
gemfile do | ||
source "https://rubygems.org" | ||
end | ||
|
||
require "csv" | ||
end | ||
|
||
extend self | ||
end | ||
|
||
My.my |