Mostly replaced Fixnum with integer
also in the rx-file dependency
all travis and testing with 2.4+
This commit is contained in:
Torsten Ruger
2019-02-07 18:24:35 +02:00
parent 51eff62931
commit 8d3a1954fa
25 changed files with 30 additions and 27 deletions

View File

@ -85,7 +85,7 @@ module Parfait
# add a type, meaning the instance given must be a valid type
def add_type( type )
hash = type.hash
raise "upps #{hash} #{hash.class}" unless hash.is_a?(Fixnum)
raise "upps #{hash} #{hash.class}" unless hash.is_a?(::Integer)
was = types[hash]
return was if was
types[hash] = type

View File

@ -27,7 +27,7 @@ module Parfait
def initialize( len )
super()
self.char_length = 0
raise "Must init with int, not #{len.class}" unless len.kind_of? Fixnum
raise "Must init with int, not #{len.class}" unless len.kind_of? ::Integer
raise "Must init with positive, not #{len}" if len < 0
set_length( len , 32 ) unless len == 0 #32 being ascii space
#puts "type #{self.get_type} #{self.object_id.to_s(16)}"
@ -87,7 +87,7 @@ module Parfait
# the index starts at one, but may be negative to count from the end
# indexes out of range will raise an error
def set_char( at , char )
raise "char not fixnum #{char.class}" unless char.kind_of? Fixnum
raise "char not fixnum #{char.class}" unless char.kind_of? ::Integer
index = range_correct_index(at)
set_internal_byte( index , char)
end
@ -137,7 +137,7 @@ module Parfait
def range_correct_index( at )
index = at
# index = self.length + at if at < 0
raise "index not integer #{at.class}" unless at.is_a?(Fixnum)
raise "index not integer #{at.class}" unless at.is_a?(::Integer)
raise "index must be positive , not #{at}" if (index < 0)
raise "index too large #{at} > #{self.length}" if (index >= self.length )
return index + 11