<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/rubygems/package.rb, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Merge RubyGems/Bundler 4.0.10</title>
<updated>2026-04-08T22:49:38+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2026-04-08T08:07:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4edfd93c0ab3c90006564a6e3ae9b4ea4924db07'/>
<id>4edfd93c0ab3c90006564a6e3ae9b4ea4924db07</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Make verification methods private</title>
<updated>2025-11-10T08:24:04+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-11-03T20:24:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=57daafc1da2eea71b50746893d77ad21658dd3b1'/>
<id>57daafc1da2eea71b50746893d77ad21658dd3b1</id>
<content type='text'>
I would like to start making some of the methods in Gem::Package
private so that we can refactor them better.  Right now we have many
methods that are public, and since they are public we can't refactor
them.  Historically, I think "private" methods have just been tagged
with :nodoc:, but I would like to be more strict about our APIs

https://github.com/ruby/rubygems/commit/fb352e9176
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I would like to start making some of the methods in Gem::Package
private so that we can refactor them better.  Right now we have many
methods that are public, and since they are public we can't refactor
them.  Historically, I think "private" methods have just been tagged
with :nodoc:, but I would like to be more strict about our APIs

https://github.com/ruby/rubygems/commit/fb352e9176
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Pull `Gem.win_platform?` out of a hot path</title>
<updated>2025-09-19T10:30:10+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-09-17T09:10:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3bf695a767b0f03e39a93e27296499eca1bec64f'/>
<id>3bf695a767b0f03e39a93e27296499eca1bec64f</id>
<content type='text'>
`normalize_path` is a pretty hot path, it's called many times per file
in each gem. Since the platform isn't going to change from call to call,
we can conditionally define `normalize_path` based on the value of
`Gem.win_platform?`.

https://github.com/rubygems/rubygems/commit/d5e61411f2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`normalize_path` is a pretty hot path, it's called many times per file
in each gem. Since the platform isn't going to change from call to call,
we can conditionally define `normalize_path` based on the value of
`Gem.win_platform?`.

https://github.com/rubygems/rubygems/commit/d5e61411f2
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Stop trying to remove every file on extraction</title>
<updated>2025-09-17T06:42:23+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-09-16T08:45:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e4fc0d4b3ff483224d7264d1c734532636840da5'/>
<id>e4fc0d4b3ff483224d7264d1c734532636840da5</id>
<content type='text'>
When we're extracting a gem, it should be extracted to an empty
directory.  Trying to remove every file before extracting the file
greatly slows the tar extraction process.

This change increases tar extraction speed by about 10%:

Master branch:

```
aaron@tc ~/g/tartest (main)&gt; ruby -I../rubygems/lib:../vernier/lib test.rb
{MEAN: 0.https://github.com/rubygems/rubygems/commit/670195550005}
{stddev: 0.https://github.com/rubygems/rubygems/commit/029875687861}
{"mib/s": 20.https://github.com/rubygems/rubygems/commit/889425481677}
```

This commit:

```
aaron@tc ~/g/tartest (main)&gt; ruby -I../rubygems/lib:../vernier/lib test.rb
{MEAN: 0.https://github.com/rubygems/rubygems/commit/600223749969}
{stddev: 0.https://github.com/rubygems/rubygems/commit/037224226667}
{"mib/s": 23.https://github.com/rubygems/rubygems/commit/324635189326}
```

https://github.com/rubygems/rubygems/commit/e40a153560
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we're extracting a gem, it should be extracted to an empty
directory.  Trying to remove every file before extracting the file
greatly slows the tar extraction process.

This change increases tar extraction speed by about 10%:

Master branch:

```
aaron@tc ~/g/tartest (main)&gt; ruby -I../rubygems/lib:../vernier/lib test.rb
{MEAN: 0.https://github.com/rubygems/rubygems/commit/670195550005}
{stddev: 0.https://github.com/rubygems/rubygems/commit/029875687861}
{"mib/s": 20.https://github.com/rubygems/rubygems/commit/889425481677}
```

This commit:

```
aaron@tc ~/g/tartest (main)&gt; ruby -I../rubygems/lib:../vernier/lib test.rb
{MEAN: 0.https://github.com/rubygems/rubygems/commit/600223749969}
{stddev: 0.https://github.com/rubygems/rubygems/commit/037224226667}
{"mib/s": 23.https://github.com/rubygems/rubygems/commit/324635189326}
```

https://github.com/rubygems/rubygems/commit/e40a153560
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Use `IO.copy_stream` with IO object directly</title>
<updated>2025-09-16T08:17:32+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-09-12T22:34:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12aa9e7457458245c9452ca5f786f6191742edf2'/>
<id>12aa9e7457458245c9452ca5f786f6191742edf2</id>
<content type='text'>
Before this patch we would use `IO.copy_stream` with the tar entry
object rather than just straight to the IO.  That means every time
copy_stream wanted data, we would have to proxy the call.

The reason we did this is because every tar entry object _shares_ the
same IO object, and previous to https://github.com/rubygems/rubygems/commit/8927533b0a47
we would call `IO.copy_stream` _without_ a size.  Without passing a
size, copy_stream will just read until there is nothing left to read, so
these proxy object emulate finding "the end of the file" (where "end of
file" means "end of tar chunk").  Without emulating this "end of file"
behavior, copy_stream would just keep reading past the end of the tar
chunk.

However, now that we're passing the size to copy_stream, we can bypass
the proxy object overhead and just use the IO object directly because
copy_stream knows exactly the number of bytes it needs to read and will
stop when it reaches the goal.

https://github.com/rubygems/rubygems/commit/857002c135
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this patch we would use `IO.copy_stream` with the tar entry
object rather than just straight to the IO.  That means every time
copy_stream wanted data, we would have to proxy the call.

The reason we did this is because every tar entry object _shares_ the
same IO object, and previous to https://github.com/rubygems/rubygems/commit/8927533b0a47
we would call `IO.copy_stream` _without_ a size.  Without passing a
size, copy_stream will just read until there is nothing left to read, so
these proxy object emulate finding "the end of the file" (where "end of
file" means "end of tar chunk").  Without emulating this "end of file"
behavior, copy_stream would just keep reading past the end of the tar
chunk.

However, now that we're passing the size to copy_stream, we can bypass
the proxy object overhead and just use the IO object directly because
copy_stream knows exactly the number of bytes it needs to read and will
stop when it reaches the goal.

https://github.com/rubygems/rubygems/commit/857002c135
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Pass the file size to IO.copy_stream</title>
<updated>2025-09-16T08:17:32+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-09-12T07:29:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a71b339477a291a93fc9f83266eaad3423df6acc'/>
<id>a71b339477a291a93fc9f83266eaad3423df6acc</id>
<content type='text'>
When extracting tar files, the tar header actually knows the exact size
of the file we need to extract.  Before this commit, we would read the
file from the tar file until it returned `nil`. We can be a little more
efficient when copying by passing the size to copy_stream

https://github.com/rubygems/rubygems/commit/8927533b0a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When extracting tar files, the tar header actually knows the exact size
of the file we need to extract.  Before this commit, we would read the
file from the tar file until it returned `nil`. We can be a little more
efficient when copying by passing the size to copy_stream

https://github.com/rubygems/rubygems/commit/8927533b0a
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Use File#chmod rather than FileUtils.chmod</title>
<updated>2025-09-16T08:17:32+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-09-11T08:27:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ca9c0f91311e01625e10272798ff2cc831bbee60'/>
<id>ca9c0f91311e01625e10272798ff2cc831bbee60</id>
<content type='text'>
We already have the open file descriptor, so we can avoid the overhead
of resolving the filepath (as well as the overhead inside `FileUtils`)
by just calling `chmod` on the file descriptor itself.

https://github.com/rubygems/rubygems/commit/60c14bbeee
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We already have the open file descriptor, so we can avoid the overhead
of resolving the filepath (as well as the overhead inside `FileUtils`)
by just calling `chmod` on the file descriptor itself.

https://github.com/rubygems/rubygems/commit/60c14bbeee
</pre>
</div>
</content>
</entry>
<entry>
<title>Psych and SafeYAML was loaded Gem.load_yml, these changes is unnecessary</title>
<updated>2025-05-13T06:49:20+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-05-13T05:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e46fbe624aa9242c9eb9c7f0fcff28af74e6846e'/>
<id>e46fbe624aa9242c9eb9c7f0fcff28af74e6846e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>namespace on read</title>
<updated>2025-05-11T14:32:50+00:00</updated>
<author>
<name>Satoshi Tagomori</name>
<email>tagomoris@gmail.com</email>
</author>
<published>2025-04-30T04:48:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=382645d440d5da66a0c04557f3ff2ca226de3a27'/>
<id>382645d440d5da66a0c04557f3ff2ca226de3a27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Remove `Gem::Specification#mark_version`</title>
<updated>2024-05-03T15:12:55+00:00</updated>
<author>
<name>David Rodriguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-02-05T19:19:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=281df1e495eeb8533b963c63a14c614fcab97859'/>
<id>281df1e495eeb8533b963c63a14c614fcab97859</id>
<content type='text'>
This gets in the middle if we ever start allowing to build as if using a
different RubyGems version than the one being run.

This could be useful to make `gem rebuild` a little more usable, and
it's already done by Bundler specs which already make this method a noop
when they need this.

I'm not sure forcefully setting this, even if user explicitly specified
something else is helpful.

Since this could potentially prevent gems explicitly setting a constant
RubyGems version from building, I changed the error of incorrect
RubyGems version from a hard error to a warning, since it will start
happening in those cases if we stop overwriting the version.

https://github.com/rubygems/rubygems/commit/45676af80d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This gets in the middle if we ever start allowing to build as if using a
different RubyGems version than the one being run.

This could be useful to make `gem rebuild` a little more usable, and
it's already done by Bundler specs which already make this method a noop
when they need this.

I'm not sure forcefully setting this, even if user explicitly specified
something else is helpful.

Since this could potentially prevent gems explicitly setting a constant
RubyGems version from building, I changed the error of incorrect
RubyGems version from a hard error to a warning, since it will start
happening in those cases if we stop overwriting the version.

https://github.com/rubygems/rubygems/commit/45676af80d
</pre>
</div>
</content>
</entry>
</feed>
