Gem Needs Small Change I think? But don’t know how

Fractional is a simple little gem that converts your decimals to fractions (useful in a recipe application I'm building) but it's a little old and has [an issue]( that I just found regarding using :FixNum and it being deprecated in the Ruby 2.4.0 I'm using.

I'm not good enough at stuff like this to fix it (I haven't done any gem work) but maybe someone here is interested.

1 thought on “Gem Needs Small Change I think? But don’t know how”

  1. Replace lib/fractional.rb lines 16 – 21 with:

    when Integer
    @value = Rational(value)

    Fixnum and Bignum were both merged into Integer. An integer will always satisfy the line 17 condition `@value = @value.to_i`.
    Should fix your problem, and *looks like* the correct way to handle this now.


Leave a Comment