Fix uplevel for cgi under bundler

Since there is `bundled_gems.rb` it is not always one. Fixes the following:
```sh
$ ruby -w -rbundler/inline -e "gemfile {}; require 'cgi'"
/home/earlopain/.rbenv/versions/ruby-dev/lib/ruby/3.5.0+0/bundled_gems.rb:59: 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.
```

into:

```sh
$ ruby -w -rbundler/inline -e "gemfile {}; require 'cgi'"
-e:1: 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.
```
This commit is contained in:
Earlopain 2025-05-14 19:56:21 +02:00 committed by Hiroshi SHIBATA
parent bfe89c7a90
commit a82e7132df
Notes: git 2025-05-20 09:22:54 +00:00
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "cgi/escape" require "cgi/escape"
warn <<-WARNING, uplevel: 1 if $VERBOSE warn <<-WARNING, uplevel: Gem::BUNDLED_GEMS.uplevel if $VERBOSE
CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features. 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. If you need to use the full features of CGI library, Please install cgi gem.
WARNING WARNING

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require "cgi/escape" require "cgi/escape"
warn <<-WARNING, uplevel: 1 if $VERBOSE warn <<-WARNING, uplevel: Gem::BUNDLED_GEMS.uplevel if $VERBOSE
CGI::Util is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features. CGI::Util is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
WARNING WARNING