|
77 | 77 | import static org.jruby.api.Create.newString; |
78 | 78 | import static org.jruby.api.Define.defineClass; |
79 | 79 | import static org.jruby.api.Error.argumentError; |
| 80 | +import static org.jruby.api.Warn.warn; |
80 | 81 | import static org.jruby.runtime.ThreadContext.CALL_KEYWORD; |
81 | 82 | import static org.jruby.runtime.ThreadContext.resetCallInfo; |
82 | 83 | import static org.jruby.runtime.Visibility.PRIVATE; |
@@ -559,6 +560,16 @@ public static IRubyObject each_codepoint(ThreadContext context, IRubyObject recv |
559 | 560 | return recv; |
560 | 561 | } |
561 | 562 |
|
| 563 | + @Deprecated(since = "9.4-") |
| 564 | + public static IRubyObject codepoints(ThreadContext context, IRubyObject recv, Block block) { |
| 565 | + warn(context, "ARGF#codepoints is deprecated; use #each_codepoint instead"); |
| 566 | + |
| 567 | + if (!block.isGiven()) return RubyEnumerator.enumeratorize(context.runtime, recv, "each_line"); |
| 568 | + |
| 569 | + return each_codepoint(context, recv, block); |
| 570 | + } |
| 571 | + |
| 572 | + |
562 | 573 | /** Invoke a block for each line. |
563 | 574 | * |
564 | 575 | */ |
@@ -587,6 +598,12 @@ public static IRubyObject each_line(ThreadContext context, IRubyObject recv, IRu |
587 | 598 | return recv; |
588 | 599 | } |
589 | 600 |
|
| 601 | + @Deprecated(since = "10.0") |
| 602 | + public static IRubyObject lines(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) { |
| 603 | + if (!block.isGiven()) return RubyEnumerator.enumeratorize(context.runtime, recv, "each_line"); |
| 604 | + return each_line(context, recv, args, block); |
| 605 | + } |
| 606 | + |
590 | 607 | @JRubyMethod(name = "each", optional = 1, checkArity = false) |
591 | 608 | public static IRubyObject each(final ThreadContext context, IRubyObject recv, IRubyObject[] args, final Block block) { |
592 | 609 | return block.isGiven() ? each_line(context, recv, args, block) : enumeratorize(context.runtime, recv, "each", args); |
|
0 commit comments