Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b85fa82974db
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6b375fd392f2
Choose a head ref
  • 5 commits
  • 3 files changed
  • 2 contributors

Commits on Jan 24, 2018

  1. Define Numeric#%

    Currently `Numeric#%` is defined in the same way
    as `Numeric#modulo`.
    
    Ref: https://github.com/ruby/ruby/blob/v2_3_0/numeric.c#L4179-L4180
    yui-knk committed Jan 24, 2018
    Copy the full SHA
    c4957fc View commit details
  2. Remove Rational#modulo and Rational#%

    Currently these methods are not defined on `Rational`.
    yui-knk committed Jan 24, 2018
    Copy the full SHA
    6edca41 View commit details
  3. Remove Rational#div

    Currently this method is not defined on `Rational`.
    yui-knk committed Jan 24, 2018
    Copy the full SHA
    a559b81 View commit details
  4. Add #test_coerce2 to test targets

    Now `test_coerce2` does not fail.
    yui-knk committed Jan 24, 2018
    Copy the full SHA
    ad9b482 View commit details
  5. Merge pull request #5006 from yui-knk/fix_test_coerce2

    Fix test coerce2
    enebo authored Jan 24, 2018
    Copy the full SHA
    6b375fd View commit details
Showing with 1 addition and 4 deletions.
  1. +1 −1 core/src/main/java/org/jruby/RubyNumeric.java
  2. +0 −2 core/src/main/java/org/jruby/RubyRational.java
  3. +0 −1 test/mri/excludes/Rational_Test.rb
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -800,7 +800,7 @@ public IRubyObject modulo(ThreadContext context, IRubyObject other) {
/** num_modulo
*
*/
@JRubyMethod(name = "modulo")
@JRubyMethod(name = {"modulo", "%"})
public IRubyObject modulo19(ThreadContext context, IRubyObject other) {
IRubyObject div = sites(context).div.call(context, this, this, other);
IRubyObject product = sites(context).op_times.call(context, other, other, div);
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/RubyRational.java
Original file line number Diff line number Diff line change
@@ -730,7 +730,6 @@ public IRubyObject op_idiv(ThreadContext context, IRubyObject other) {
return op_idiv19(context, other);
}

@JRubyMethod(name = "div")
public IRubyObject op_idiv19(ThreadContext context, IRubyObject other) {
if (num2dbl(other) == 0.0) throw context.runtime.newZeroDivisionError();

@@ -744,7 +743,6 @@ public IRubyObject op_mod(ThreadContext context, IRubyObject other) {
return op_mod19(context, other);
}

@JRubyMethod(name = {"modulo", "%"})
public IRubyObject op_mod19(ThreadContext context, IRubyObject other) {
if (num2dbl(other) == 0.0) throw context.runtime.newZeroDivisionError();

1 change: 0 additions & 1 deletion test/mri/excludes/Rational_Test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exclude :test_coerce2, "needs investigation"
exclude :test_conv, "needs investigation"
exclude :test_marshal, "needs investigation"
exclude :test_power_of_0, "needs investigation"