Skip to content

Move Pathname to core [Ruby 4.0]#9062

Closed
headius wants to merge 2 commits intojruby:ruby-4.0from
headius:pathname.rb
Closed

Move Pathname to core [Ruby 4.0]#9062
headius wants to merge 2 commits intojruby:ruby-4.0from
headius:pathname.rb

Conversation

@headius
Copy link
Copy Markdown
Member

@headius headius commented Nov 5, 2025

  • RubyPathname is stripped down to match the remaining extension in CRuby 4.0 (<=> and sub).
  • RubyPathname.path field is bound to @path instance variable.
  • pathname.rb comes from ruby/pathname, with undef preamble, extension load, and a few utility methods removed.
  • stdlib pathname.rb contains those utility methods.

See ruby/pathname#57 and ruby/pathname#17

Fixes #9060

@headius headius mentioned this pull request Nov 5, 2025
@headius headius force-pushed the pathname.rb branch 2 times, most recently from cbd3f63 to 97cc08d Compare November 5, 2025 06:07
@headius
Copy link
Copy Markdown
Member Author

headius commented Nov 5, 2025

This will require some additional work to support our URI path forms. We may need to continue overriding more of the pure-Ruby logic than I'd hoped.

@headius headius marked this pull request as draft November 5, 2025 09:19
@headius headius changed the title Move Pathname to core and use mostly-Ruby version Move Pathname to core [Ruby 3.5] Nov 5, 2025
@headius headius changed the base branch from master to ruby-4.0 November 11, 2025 23:17
@headius headius changed the title Move Pathname to core [Ruby 3.5] Move Pathname to core [Ruby 4.0] Nov 11, 2025
* RubyPathname is stripped down to match the remaining extension
  in CRuby 3.5 (<=> and sub).
* RubyPathname.path field is bound to @path instance variable.
* pathname.rb comes from ruby/pathname, with undef preamble,
  extension load, and a few utility methods removed.
* stdlib pathname.rb contains those utility methods.

See ruby/pathname#57 and ruby/pathname#17

Fixes jruby#9060
headius added a commit that referenced this pull request Feb 24, 2026
Ideally we would be able to use the same pure-Ruby sources as the
gem (see #9062) but there are additional tweaks needed
there to support our URI forms. For now we just internalize our
existing implementation to get things working.

See ruby/pathname#57 and ruby/pathname#17 for the Pathname move in
Ruby 4.0 and #9060 for our issue to switch to the pure-
Ruby version.
@headius
Copy link
Copy Markdown
Member Author

headius commented Feb 24, 2026

Because of the missing URI support, I've temporarily just internalized the existing implementation we already had.

@headius headius deleted the branch jruby:ruby-4.0 March 1, 2026 05:19
@headius headius closed this Mar 1, 2026
@enebo enebo added this to the Invalid or Duplicate milestone Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt pure-Ruby Pathname

2 participants