<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/rubygems/package/tar_reader.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>[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] Ignore non-tar format `.gem` files during search</title>
<updated>2023-10-23T19:52:22+00:00</updated>
<author>
<name>dearblue</name>
<email>dearblue@users.osdn.me</email>
</author>
<published>2023-10-23T14:49:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=062d6050b05dba8c0cc915e83a05a418a1c8ab1d'/>
<id>062d6050b05dba8c0cc915e83a05a418a1c8ab1d</id>
<content type='text'>
Previously, `rake install` or `rake update` would fail if there was a non-tar format `.gem` file in the current working directory.

https://github.com/rubygems/rubygems/commit/f562788f1d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, `rake install` or `rake update` would fail if there was a non-tar format `.gem` file in the current working directory.

https://github.com/rubygems/rubygems/commit/f562788f1d
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Raise Gem::Package::FormatError on EOF, indicating corrupt gem</title>
<updated>2023-08-17T23:16:57+00:00</updated>
<author>
<name>Martin Emde</name>
<email>martin.emde@gmail.com</email>
</author>
<published>2023-08-15T17:39:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e913431687f2fffb1a8cc435e60c95eea887b087'/>
<id>e913431687f2fffb1a8cc435e60c95eea887b087</id>
<content type='text'>
Gem::Package::TarReader::Entry now raises EOFError or returns nil
appropriately based on Ruby core IO.read and IO.readpartial behavior.

Zlib will respond accordingly by raising Zlib::GzipFile::Error on EOF.

When verifying a gem or extracting contents, raise FormatError similar
to other cases of corrupt gems.

Addresses a bug where Gem::Package would attempt to call size on nil
instead of raising a more descriptive and useful error, leading users
to assume the problem is internal to rubygems.

Remove unused error class TarReader::UnexpectedEOF that was never raised
since the NoMethodError on nil would happen first. Use EOFError instead.

https://github.com/rubygems/rubygems/commit/dc6129644b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Gem::Package::TarReader::Entry now raises EOFError or returns nil
appropriately based on Ruby core IO.read and IO.readpartial behavior.

Zlib will respond accordingly by raising Zlib::GzipFile::Error on EOF.

When verifying a gem or extracting contents, raise FormatError similar
to other cases of corrupt gems.

Addresses a bug where Gem::Package would attempt to call size on nil
instead of raising a more descriptive and useful error, leading users
to assume the problem is internal to rubygems.

Remove unused error class TarReader::UnexpectedEOF that was never raised
since the NoMethodError on nil would happen first. Use EOFError instead.

https://github.com/rubygems/rubygems/commit/dc6129644b
</pre>
</div>
</content>
</entry>
<entry>
<title>util/rubocop -A --only Style/AsciiComments</title>
<updated>2023-03-23T08:18:49+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-03-22T05:18:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=acf12b6dfdd94ce1da55eaf2dfacc75135385c2a'/>
<id>acf12b6dfdd94ce1da55eaf2dfacc75135385c2a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>util/rubocop -A --only Layout/EmptyLineAfterMagicComment</title>
<updated>2023-03-23T08:18:49+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-03-17T09:36:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f24a86d83f07f214e97aa98da190cda55092805f'/>
<id>f24a86d83f07f214e97aa98da190cda55092805f</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] Enabled Style/RedundantReturn cop</title>
<updated>2023-03-23T08:18:49+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-03-23T01:16:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2e3cd1dc3e30f4725b18032b85a36f208c9528bc'/>
<id>2e3cd1dc3e30f4725b18032b85a36f208c9528bc</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/05cc97bdf8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/05cc97bdf8
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] util/rubocop -A --only Style/Alias</title>
<updated>2023-03-17T09:50:55+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-03-16T03:55:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=83f9aa8f02c9fdcf8d22f0859c4f4fb3ad30bb42'/>
<id>83f9aa8f02c9fdcf8d22f0859c4f4fb3ad30bb42</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/fba6e94de9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/fba6e94de9
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Add TarReader::Entry#seek to seek within the tar file entry</title>
<updated>2023-03-07T20:21:43+00:00</updated>
<author>
<name>Martin Emde</name>
<email>martin.emde@gmail.com</email>
</author>
<published>2023-02-17T02:03:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=85a1738ab37b3348fc0b924804ca4b209f34fbf7'/>
<id>85a1738ab37b3348fc0b924804ca4b209f34fbf7</id>
<content type='text'>
TarReader#each previously implemented a partial version of seek.
This code moved to Entry#seek for use from TarReader#each.

Entry#close now returns nil instead of true, like IO#close.

Closing an Entry now seeks to the end of the Entry, seeking past
any remaining zero byte tar file padding and moving the io to the
correcty position to read the next file in the archive.

Uses seek for Entry#rewind and #pos=, fixing the tar-&gt;gzip-&gt;tar nested
rewind that would break previous to this change.

Add Entry.open that behaves more like File.open.

https://github.com/rubygems/rubygems/commit/f5149565d5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TarReader#each previously implemented a partial version of seek.
This code moved to Entry#seek for use from TarReader#each.

Entry#close now returns nil instead of true, like IO#close.

Closing an Entry now seeks to the end of the Entry, seeking past
any remaining zero byte tar file padding and moving the io to the
correcty position to read the next file in the archive.

Uses seek for Entry#rewind and #pos=, fixing the tar-&gt;gzip-&gt;tar nested
rewind that would break previous to this change.

Add Entry.open that behaves more like File.open.

https://github.com/rubygems/rubygems/commit/f5149565d5
</pre>
</div>
</content>
</entry>
<entry>
<title>RubyGems: Enable Style/StringLiterals cop</title>
<updated>2022-07-22T03:07:23+00:00</updated>
<author>
<name>Takuya Noguchi</name>
<email>takninnovationresearch@gmail.com</email>
</author>
<published>2022-07-17T08:08:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d7ffd3fea402239b16833cc434404a7af82d44f3'/>
<id>d7ffd3fea402239b16833cc434404a7af82d44f3</id>
<content type='text'>
Signed-off-by: Takuya Noguchi &lt;takninnovationresearch@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Takuya Noguchi &lt;takninnovationresearch@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Prefer `require_relative` to `require` for internal requires</title>
<updated>2021-08-31T10:06:14+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2019-04-22T11:56:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=54ae3f587ed42f425edc7ec741702ac764429c5d'/>
<id>54ae3f587ed42f425edc7ec741702ac764429c5d</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/c74fc58695
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/c74fc58695
</pre>
</div>
</content>
</entry>
</feed>
