From fd52dc4bcc28b780934cbc5e2236984dd5aef7c1 Mon Sep 17 00:00:00 2001 From: Sujan Gandikota Ramesh Date: Mon, 11 Dec 2017 17:12:28 -0800 Subject: [PATCH] removed Fixnum reference Fixnum and Bignum are combined into Integer class Since Ruby-2.4.0 release. This fix is to remove all Fixnum reference. --- lib/builder/xchar.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/builder/xchar.rb b/lib/builder/xchar.rb index c7daa48..29e353e 100644 --- a/lib/builder/xchar.rb +++ b/lib/builder/xchar.rb @@ -19,7 +19,7 @@ def self.check_for_name_collision(klass, method_name, defined_constant=nil) if ! defined?(Builder::XChar) and ! String.method_defined?(:encode) Builder.check_for_name_collision(String, "to_xs") - Builder.check_for_name_collision(Fixnum, "xchr") + Builder.check_for_name_collision(Integer, "xchr") end ###################################################################### @@ -108,7 +108,7 @@ module XChar # :nodoc: INVALID_XML_CHAR = Regexp.new('[^'+ Builder::XChar::VALID.map { |item| case item - when Fixnum + when Integer [item].pack('U').force_encoding('utf-8') when Range [item.first, '-'.ord, item.last].pack('UUU').force_encoding('utf-8') @@ -160,9 +160,9 @@ def XChar.encode(string) else ###################################################################### - # Enhance the Fixnum class with a XML escaped character conversion. + # Enhance the Integer class with a XML escaped character conversion. # - class Fixnum + class Integer XChar = Builder::XChar if ! defined?(XChar) # XML escaped version of chr. When escape is set to false