Skip to content

[pull] master from ruby:master#836

Merged
pull[bot] merged 27 commits intoturkdevops:masterfrom
ruby:master
Mar 9, 2026
Merged

[pull] master from ruby:master#836
pull[bot] merged 27 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link

@pull pull bot commented Mar 9, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

nobu and others added 27 commits March 9, 2026 16:14
This cast is safe because `rb_absint_size` returns `nlz` within the
range `0...CHAR_BIT`.
Use the appropriate modifier.  `size_t` is not always `unsigned long`,
even if the size is the same.
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.

ruby/rubygems@bffb238b35
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.

ruby/rubygems@053b576c20
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.

ruby/rubygems@fe1a29ef2d
…YAML backend

Add Gem.use_psych? and Gem.load_yaml branching so that YAMLSerializer
is used by default, while Psych remains available via the use_psych
config option in .gemrc or RUBYGEMS_USE_PSYCH environment variable.

ruby/rubygems@d67561aa06

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…h fallback

ruby/rubygems@895c8799fc

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@9d54d0f830

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruby/rubygems@825d4eba3c

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests covering the full pure-Ruby YAML implementation:
- Gem object serialization round-trips (dump and load)
- YAML anchors and aliases (enabled and disabled)
- Permitted classes and symbols validation
- Real-world gemspec parsing (fileutils, rubygems-bundler)
- Edge cases: empty requirements, Hash-to-Array normalization,
  rdoc_options conversion, flow notation, non-specific tags,
  comment-only documents, special character quoting

ruby/rubygems@b38681e4e8
* I always had an interest about the benchmark stdlib and did significant
  contributions to it, notably 979ec8d.
* Ref: https://bugs.ruby-lang.org/issues/21948
* The timeout could trigger before the `raise`.

ruby/timeout@e4aa36096f
@pull pull bot locked and limited conversation to collaborators Mar 9, 2026
@pull pull bot added the ⤵️ pull label Mar 9, 2026
@pull pull bot merged commit 4ce8515 into turkdevops:master Mar 9, 2026
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants