| Age | Commit message (Collapse) | Author |
|
`"a: b"` must be processed as a string value (`a: b`) not a map
value (`{"a" => "b"}`).
https://github.com/ruby/rubygems/commit/3c3dfe3168
|
|
consistently with Psych
Align YAMLSerializer's `permitted_classes` validation with Psych's whitelist
semantics: an empty `permitted_classes` list denies all tagged classes, matching
`Psych::ClassLoader::Restricted` behavior.
- Rename `@permitted_tags` to `@permitted_classes` and simplify initialization
- Extract `raise_disallowed_class!` from `validate_tag!` for clarity
- Move `check_anchor!` before `validate_tag!` in `build_mapping`
- Add test for `Gem::Version::Requirement` tag used by old gems like `escape`
https://github.com/ruby/rubygems/commit/3c5855e833
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- ### Problem
There is a regression where bundler can longer install gems that
were packaged a long time ago, like the [memoize gem](https://rubygems.org/gems/memoize).
Bundler will crash with such error:
```
Installing memoize 1.3.1
--- ERROR REPORT TEMPLATE -------------------------------------------------------
NoMethodError: undefined method 'as_list' for nil
/Users/edouard/src/opensource/rubygems/lib/rubygems/dependency.rb:146:in 'Gem::Dependency#requirements_list'
```
### Context
These very old gems were packaged at the time were a
`Gem::Dependency` had no ivars `requirement`.
This is what the dumped gemspec looks like:
```
dependencies:
- !ruby/object:Gem::Dependency
name: test-unit
type: :development
version_requirement:
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: 2.0.2
version:
```
As opposed to a gem that was packaged more recently:
```
- !ruby/object:Gem::Dependency
name: minitest-global_expectations
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
```
The change we made in https://github.com/ruby/rubygems/commit/cbe57bbbd71e8ac7fed686ae7d13a2fd1bd2e5b2#diff-5ccc8aa468df013cc970580e88642417da12284da6529a4885b9abf447ae95edL529
broke old gem installation.
### Solution
If `requirement` isn't set in the hash, look for
`version_requirements` instead.
https://github.com/ruby/rubygems/commit/cfd8b20692
|
|
Decode base64-encoded values tagged with !binary in mapping keys,
mapping values (both inline and block scalar), and sequence items.
This fixes gem install failures for gems packaged with older RubyGems
that used !binary encoding in checksums.yaml.gz.
Fixes https://github.com/ruby/rubygems/issues/9387
https://github.com/ruby/rubygems/commit/cfc31601e9
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
https://github.com/ruby/rubygems/commit/ba8e4ed9ed
|
|
https://github.com/ruby/rubygems/commit/d4c5fc58e7
|
|
https://github.com/ruby/rubygems/commit/b8f77e3860
|
|
https://github.com/ruby/rubygems/commit/e5bcde365f
|
|
https://github.com/ruby/rubygems/commit/6b0aa2a2d3
|
|
https://github.com/ruby/rubygems/commit/074e3f7f62
|
|
https://github.com/ruby/rubygems/commit/cf566c3079
|
|
https://github.com/ruby/rubygems/commit/cbe57bbbd7
|
|
https://github.com/ruby/rubygems/commit/c29b3b2240
|
|
https://github.com/ruby/rubygems/commit/940358f2c2
|
|
https://github.com/ruby/rubygems/commit/c091444047
|
|
This leads installation issue of Windows.
https://github.com/ruby/rubygems/commit/244b38acd7
|
|
|
|
https://github.com/ruby/rubygems/commit/61bfb3fff8
|
|
https://github.com/ruby/rubygems/commit/f3a1b17fce
|
|
https://github.com/ruby/rubygems/commit/faab31b5cf
|
|
https://github.com/ruby/rubygems/commit/ef022c664f
|
|
https://github.com/ruby/rubygems/commit/50becac99a
|
|
https://github.com/ruby/rubygems/commit/e07e88a232
|
|
https://github.com/ruby/rubygems/commit/bfe17c110c
|
|
Add convert_to_spec and convert_any methods that transform parsed YAML
data structures (with :tag metadata) back into Gem::Specification,
Version, Platform, Requirement, and Dependency objects. Wire these into
the load method so it returns fully reconstructed Gem objects.
convert_to_spec normalizes specification_version to Integer,
rdoc_options to Array of Strings, and other array fields (files,
test_files, executables, requirements, extra_rdoc_files) to proper
arrays. convert_any handles Gem::Version::Requirement (legacy) and
validates requirement operators and dependency type symbols against
permitted lists.
https://github.com/ruby/rubygems/commit/fe1a29ef2d
|
|
Replace the simple regex-based load method with a full recursive
descent parser (parse_any) that handles nested hashes, arrays, block
scalars (| and |-), YAML anchors (&anchor) and aliases (*alias),
!ruby/object: type tags, flow notation ({} and []), and non-specific
tag stripping (! prefix).
Add helper methods: parse_block_scalar for multiline strings,
build_permitted_tags for security validation, unquote_simple for
type coercion (booleans, integers, timestamps, quoted strings),
and improve strip_comment to handle # inside quoted strings.
The parser returns raw Ruby data structures (Hash, Array, String)
with :tag metadata for typed objects, without yet reconstructing
Gem-specific objects.
https://github.com/ruby/rubygems/commit/053b576c20
|
|
Replace the simple dump_hash method with dump_obj that can serialize
Gem::Specification, Version, Platform, Requirement, Dependency, Hash,
Array, Time, and String objects into YAML format. This enables pure-Ruby
YAML serialization without depending on Psych.
The serializer handles multiline strings (block scalars), special
character quoting ($, !, &, *, :, @, %), and proper indentation for
nested structures.
https://github.com/ruby/rubygems/commit/bffb238b35
|
|
https://github.com/rubygems/rubygems/commit/7ca06e139b
|
|
https://github.com/rubygems/rubygems/commit/7d1e8be2ce
|
|
https://github.com/rubygems/rubygems/commit/54b67fb251
|
|
https://github.com/rubygems/rubygems/commit/e6a9148ba2
|
|
String#split supports a block since Ruby 2.6, avoiding intermediate array.
https://github.com/rubygems/rubygems/commit/69cdf9e9d4
|
|
https://github.com/rubygems/rubygems/commit/70243b1d72
|
|
https://github.com/rubygems/rubygems/commit/7c0afdd9af
|
|
Running `bundle update --bundler` on a rails app locally:
```
==> memprof.after.txt <==
Total allocated: 301.90 kB (3794 objects)
Total retained: 73.24 kB (698 objects)
==> memprof.before.txt <==
Total allocated: 14.47 MB (196378 objects)
Total retained: 25.93 kB (202 objects)
```
So for a slight increase in retained memory (all keys are now retained),
we go from about 200k allocations in the settings file to under 4k
https://github.com/rubygems/rubygems/commit/e64debb6ae
|
|
https://github.com/rubygems/rubygems/commit/6a97346708
|