Skip to content

Commit a0dbf2a

Browse files
committed
Move Pathname to core and use mostly-Ruby version
* 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
1 parent 7af7ec5 commit a0dbf2a

File tree

10 files changed

+1234
-943
lines changed

10 files changed

+1234
-943
lines changed

core/src/main/java/org/jruby/Ruby.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.jruby.exceptions.LocalJumpError;
5151
import org.jruby.exceptions.SystemExit;
5252
import org.jruby.ext.jruby.JRubyUtilLibrary;
53+
import org.jruby.ext.pathname.RubyPathname;
5354
import org.jruby.ext.thread.ConditionVariable;
5455
import org.jruby.ext.thread.Mutex;
5556
import org.jruby.ext.thread.Queue;
@@ -477,6 +478,7 @@ private Ruby(RubyInstanceConfig config) {
477478
processModule = profile.allowModule("Process") ? RubyProcess.createProcessModule(context, objectClass, structClass) : null;
478479
timeClass = profile.allowClass("Time") ? RubyTime.createTimeClass(context, objectClass, comparableModule) : null;
479480
unboundMethodClass = profile.allowClass("UnboundMethod") ? RubyUnboundMethod.defineUnboundMethodClass(context, objectClass) : null;
481+
pathnameClass = RubyPathname.createPathnameClass(context);
480482

481483
if (profile.allowModule("Signal")) RubySignal.createSignal(context);
482484

@@ -5253,6 +5255,7 @@ public interface RecursiveFunctionEx<T> extends ThreadContext.RecursiveFunctionE
52535255
private final RubyClass closedQueueError;
52545256
private final RubyClass sizedQueueClass;
52555257
private final RubyClass dataClass;
5258+
private final RubyClass pathnameClass;
52565259

52575260
private RubyClass tmsStruct;
52585261
private RubyClass passwdStruct;

core/src/main/java/org/jruby/ext/pathname/PathnameLibrary.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)