Skip to content

Commit

Permalink
Use Integer instead of Fixnum.
Browse files Browse the repository at this point in the history
Fixnum and Bignum are unified in Ruby-2.4 to Integer.

Using Fixnum prints a warning at every start with ruby-2.4.
  • Loading branch information
larskanis committed Jan 12, 2017
1 parent 323fed5 commit df03506
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/rbreadline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

require "rbreadline/version"

class Fixnum
class Integer
def ord; self; end
end

Expand Down Expand Up @@ -4067,7 +4067,7 @@ def _rl_input_available
def _rl_isearch_dispatch(cxt, c)
f = nil

if c.class == Fixnum && c < 0
if c.is_a?(Integer) && c < 0
cxt.sflags |= SF_FAILED
cxt.history_pos = cxt.last_found_line
return -1
Expand Down Expand Up @@ -5660,7 +5660,7 @@ def _rl_insert_next(count)
c = rl_read_key()
rl_unsetstate(RL_STATE_MOREINPUT)

if c.class == Fixnum && c < 0
if c.is_a?(Integer) && c < 0
return -1
end

Expand Down Expand Up @@ -6655,7 +6655,7 @@ def get_y_or_n(for_pager)
if (c == 'n' || c == 'N' || c == RUBOUT)
return (0)
end
if (c == ABORT_CHAR || (c.class == Fixnum && c < 0))
if (c == ABORT_CHAR || (c.is_a?(Integer) && c < 0))
_rl_abort_internal()
end
if (for_pager && (c == NEWLINE || c == RETURN))
Expand Down Expand Up @@ -7637,7 +7637,7 @@ def _rl_char_search(count, fdir, bdir)
mbchar = ''
mb_len = _rl_read_mbchar(mbchar, MB_LEN_MAX)

if (mbchar.class == Fixnum && c < 0) || mbchar == 0.chr
if (mbchar.is_a?(Integer) && c < 0) || mbchar == 0.chr
return -1
end

Expand Down Expand Up @@ -7822,7 +7822,7 @@ def _rl_arg_dispatch(cxt, c)
rl_restore_prompt()
rl_clear_message()
rl_unsetstate(RL_STATE_NUMERICARG)
if key.class == Fixnum && key < 0
if key.is_a?(Integer) && key < 0
return -1
end
return (_rl_dispatch(key, @_rl_keymap))
Expand Down Expand Up @@ -8780,7 +8780,7 @@ def _rl_read_mbchar(mbchar, size)
c = rl_read_key()
rl_unsetstate(RL_STATE_MOREINPUT)

break if c.class == Fixnum && c < 0
break if c.is_a?(Integer) && c < 0

mbchar << c
mb_len += 1
Expand Down Expand Up @@ -8810,7 +8810,7 @@ def _rl_read_mbstring(first, mb, mlen)
# Read more for multibyte character
rl_setstate(RL_STATE_MOREINPUT)
c = rl_read_key()
break if c.class == Fixnum && c < 0
break if c.is_a?(Integer) && c < 0
rl_unsetstate(RL_STATE_MOREINPUT)
else
break
Expand Down

0 comments on commit df03506

Please sign in to comment.