<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/bundled_gems.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Bug #20737] Do not warn default gems to be promoted in Ruby 3.5 (#11613)</title>
<updated>2024-09-17T00:28:08+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-09-17T00:28:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4e59e7d35fbd6ff87f63cd0aa5d6a2f923323fee'/>
<id>4e59e7d35fbd6ff87f63cd0aa5d6a2f923323fee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Backport warning feature for bundled gems from master (#11420)</title>
<updated>2024-08-21T16:40:11+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-08-21T16:40:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9ae91eb2aa8a82315026e72fb58d89bc23432335'/>
<id>9ae91eb2aa8a82315026e72fb58d89bc23432335</id>
<content type='text'>
* 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" &lt;hsbt@ruby-lang.org&gt;

* 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 `&lt;main&gt;'"
---

* 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 34adc07372c10170b8ca36111d216cbd8e4699be

---------

Co-authored-by: David Rodríguez &lt;deivid.rodriguez@riseup.net&gt;
Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
Co-authored-by: Kentaro Takeyama &lt;75117116+obregonia1@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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" &lt;hsbt@ruby-lang.org&gt;

* 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 `&lt;main&gt;'"
---

* 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 34adc07372c10170b8ca36111d216cbd8e4699be

---------

Co-authored-by: David Rodríguez &lt;deivid.rodriguez@riseup.net&gt;
Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
Co-authored-by: Kentaro Takeyama &lt;75117116+obregonia1@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bundled_gems.rb: Add a fast path (#11221)</title>
<updated>2024-07-22T23:35:22+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2024-07-22T23:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4667f8ec10269b0b5deca459f098abbdf3bae4ec'/>
<id>4667f8ec10269b0b5deca459f098abbdf3bae4ec</id>
<content type='text'>
bundled_gems.rb: Add a fast path

[Bug #20641] `Gem::BUNDLED_GEMS.warning?` adds a lot of extra
work on top of `require`. When the call end up atually loading code
the overhead is somewhat marginal.

However it's not uncommon for code to go some late `require` in some
paths, so it's expected that calling `require` with something already
required is somewhat fast, and `bundled_gems.rb` breaks this assumption.

To avoid this, we can have a fast path that in most case allow to
short-circuit all the heavy computations. If we extract the feature
basename and it doesn't match any of the bundled gems we care about
we can return very early.

With this change `require 'date'` is now only 1.33x slower on Ruby
3.3.3, than it was on Ruby 3.2.2, whereas before this change it
was at least 100x slower.

Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bundled_gems.rb: Add a fast path

[Bug #20641] `Gem::BUNDLED_GEMS.warning?` adds a lot of extra
work on top of `require`. When the call end up atually loading code
the overhead is somewhat marginal.

However it's not uncommon for code to go some late `require` in some
paths, so it's expected that calling `require` with something already
required is somewhat fast, and `bundled_gems.rb` breaks this assumption.

To avoid this, we can have a fast path that in most case allow to
short-circuit all the heavy computations. If we extract the feature
basename and it doesn't match any of the bundled gems we care about
we can return very early.

With this change `require 'date'` is now only 1.33x slower on Ruby
3.3.3, than it was on Ruby 3.2.2, whereas before this change it
was at least 100x slower.

Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20450] Remove rubyarchdir from bootsnap paths</title>
<updated>2024-05-28T20:29:22+00:00</updated>
<author>
<name>Eugene Kenny</name>
<email>elkenny@gmail.com</email>
</author>
<published>2024-04-24T11:10:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6edd65a080b156f1ce78fdcf57214c1644a049db'/>
<id>6edd65a080b156f1ce78fdcf57214c1644a049db</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix error when default gem is loaded from `-r` option</title>
<updated>2024-05-28T20:29:22+00:00</updated>
<author>
<name>Masataka Pocke Kuwabara</name>
<email>kuwabara@pocke.me</email>
</author>
<published>2024-04-08T03:41:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7a3cc549465125d48bedd0a22660a379914340a8'/>
<id>7a3cc549465125d48bedd0a22660a379914340a8</id>
<content type='text'>
This patch fixes an error when a default gem that will be migrated to
a bundled gem is loaded from `-r` option.

Problem
===

`bundle exec ruby -rostruct -e ''` unexpectedly raises the following error:

```console
$ ruby -v
ruby 3.4.0dev (2024-04-08T02:39:00Z master 6f7e8e278f) [arm64-darwin21]
$ bundle init &amp;&amp; bundle install
$ bundle exec ruby -rostruct -e ''
/Users/kuwabara.masataka/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:111:in 'Gem::BUNDLED_GEMS.warning?': undefined method 'find' for nil (NoMethodError)

      caller = caller_locations(3, 3).find {|c| c&amp;.absolute_path}
                                     ^^^^^
        from /Users/kuwabara.masataka/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require'
```

Solution
===

This patch uses a safe navigation operator to fix this problem. By this
change, the command will show the warning message correctly.

```console
$ bundle exec ruby -rostruct -e ''
warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes an error when a default gem that will be migrated to
a bundled gem is loaded from `-r` option.

Problem
===

`bundle exec ruby -rostruct -e ''` unexpectedly raises the following error:

```console
$ ruby -v
ruby 3.4.0dev (2024-04-08T02:39:00Z master 6f7e8e278f) [arm64-darwin21]
$ bundle init &amp;&amp; bundle install
$ bundle exec ruby -rostruct -e ''
/Users/kuwabara.masataka/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:111:in 'Gem::BUNDLED_GEMS.warning?': undefined method 'find' for nil (NoMethodError)

      caller = caller_locations(3, 3).find {|c| c&amp;.absolute_path}
                                     ^^^^^
        from /Users/kuwabara.masataka/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require'
```

Solution
===

This patch uses a safe navigation operator to fix this problem. By this
change, the command will show the warning message correctly.

```console
$ bundle exec ruby -rostruct -e ''
warning: ostruct was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0. Add ostruct to your Gemfile or gemspec.
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Ignore warnings on the bundled gems repo</title>
<updated>2024-05-28T20:29:22+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-01-19T07:08:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=121cec845a0c3d3529ebfdebafb339dddbfdeb90'/>
<id>121cec845a0c3d3529ebfdebafb339dddbfdeb90</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/bundled_gems.rb: dynamically ignore Kernel.require decorators</title>
<updated>2024-05-28T20:29:22+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2024-03-25T07:45:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b3a2cf5d33688378a0d947f1623879838fb9c4c'/>
<id>0b3a2cf5d33688378a0d947f1623879838fb9c4c</id>
<content type='text'>
Followup: https://github.com/ruby/ruby/pull/10347

This avoid directly referencing bootsnap and zeitwerk, and also
handle other gems that may decorate `require`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Followup: https://github.com/ruby/ruby/pull/10347

This avoid directly referencing bootsnap and zeitwerk, and also
handle other gems that may decorate `require`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Backport https://github.com/ruby/ruby/pull/10347 (#10349)</title>
<updated>2024-03-25T08:09:56+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-03-25T08:09:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f654588d9e0cefff1c23529d2f2672029e1bd21'/>
<id>2f654588d9e0cefff1c23529d2f2672029e1bd21</id>
<content type='text'>
Fix incorrect warning target with Zeitwerk and support warning with Bootsnap.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix incorrect warning target with Zeitwerk and support warning with Bootsnap.</pre>
</div>
</content>
</entry>
<entry>
<title>Backport bundled_gems.rb for Ruby 3.3 (#9457)</title>
<updated>2024-02-01T04:34:32+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-02-01T04:34:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=57d8d6e58a13c9de7bb84c1c76625789f435bca1'/>
<id>57d8d6e58a13c9de7bb84c1c76625789f435bca1</id>
<content type='text'>
racc is extracted at Ruby 3.3, not 3.4</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
racc is extracted at Ruby 3.3, not 3.4</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] No ducuments for internal library</title>
<updated>2023-12-19T01:20:40+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-12-18T11:22:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=46085ef970ab50b5e1c7878345a39528823461ac'/>
<id>46085ef970ab50b5e1c7878345a39528823461ac</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
