diff --git a/core/src/main/java/org/jruby/Ruby.java b/core/src/main/java/org/jruby/Ruby.java index 03dbc4da8dcb..f24ecba7807e 100644 --- a/core/src/main/java/org/jruby/Ruby.java +++ b/core/src/main/java/org/jruby/Ruby.java @@ -591,6 +591,7 @@ private void initBootLibraries() { loadService.provide("rational.rb"); loadService.provide("complex.rb"); loadService.provide("thread.rb"); + loadService.provide("fiber.rb"); loadService.provide("ruby2_keywords.rb"); // Load preludes diff --git a/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java b/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java index f29be1be42a0..c676c7dd64b4 100644 --- a/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java +++ b/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java @@ -305,7 +305,7 @@ private static void handleExceptionDuringExchange(ThreadContext context, FiberDa } @JRubyMethod(rest = true) - public IRubyObject __transfer__(ThreadContext context, IRubyObject[] values) { + public IRubyObject transfer(ThreadContext context, IRubyObject[] values) { Ruby runtime = context.runtime; final FiberData data = this.data; @@ -455,13 +455,13 @@ private static FiberData verifyCurrentFiber(ThreadContext context, Ruby runtime) return currentFiberData; } - @JRubyMethod - public IRubyObject __alive__(ThreadContext context) { + @JRubyMethod(name = "alive?") + public IRubyObject alive_p(ThreadContext context) { return RubyBoolean.newBoolean(context, alive()); } @JRubyMethod(meta = true) - public static IRubyObject __current__(ThreadContext context, IRubyObject recv) { + public static IRubyObject current(ThreadContext context, IRubyObject recv) { return context.getFiber(); } diff --git a/lib/ruby/stdlib/fiber.rb b/lib/ruby/stdlib/fiber.rb deleted file mode 100644 index d568fc8e963e..000000000000 --- a/lib/ruby/stdlib/fiber.rb +++ /dev/null @@ -1,12 +0,0 @@ -## -# Extensions to Fiber. In JRuby, these are all still defined in the normal -# Fiber class, so we alias them to the right names here. -# -class Fiber - class << self - alias current __current__ - end - - alias transfer __transfer__ - alias alive? __alive__ -end \ No newline at end of file