Repository: avro
Updated Branches:
  refs/heads/master f72b620b9 -> b1233fd64


AVRO-2040: Ruby 2.4 deprecation fixes

This closes #231

Signed-off-by: sacharya <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/b1233fd6
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/b1233fd6
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/b1233fd6

Branch: refs/heads/master
Commit: b1233fd6468d4de546891cc12d19f905c55604cc
Parents: f72b620
Author: Tim Perkins <[email protected]>
Authored: Mon Jun 12 14:26:05 2017 -0400
Committer: sacharya <[email protected]>
Committed: Fri Jul 21 14:46:42 2017 -0700

----------------------------------------------------------------------
 lang/ruby/lib/avro/schema_validator.rb | 4 +---
 lang/ruby/test/test_datafile.rb        | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/b1233fd6/lang/ruby/lib/avro/schema_validator.rb
----------------------------------------------------------------------
diff --git a/lang/ruby/lib/avro/schema_validator.rb 
b/lang/ruby/lib/avro/schema_validator.rb
index ca4f7f6..89b0a9c 100644
--- a/lang/ruby/lib/avro/schema_validator.rb
+++ b/lang/ruby/lib/avro/schema_validator.rb
@@ -165,7 +165,7 @@ module Avro
       private
 
       def actual_value_message(value)
-        avro_type = if value.class == Integer
+        avro_type = if value.is_a?(Integer)
                       ruby_integer_to_avro_type(value)
                     else
                       ruby_to_avro_type(value.class)
@@ -181,8 +181,6 @@ module Avro
         {
           NilClass => 'null',
           String => 'string',
-          Fixnum => 'int',
-          Bignum => 'long',
           Float => 'float',
           Hash => 'record'
         }.fetch(ruby_class, ruby_class)

http://git-wip-us.apache.org/repos/asf/avro/blob/b1233fd6/lang/ruby/test/test_datafile.rb
----------------------------------------------------------------------
diff --git a/lang/ruby/test/test_datafile.rb b/lang/ruby/test/test_datafile.rb
index 8fe05d7..0b98abb 100644
--- a/lang/ruby/test/test_datafile.rb
+++ b/lang/ruby/test/test_datafile.rb
@@ -20,13 +20,13 @@ require 'test_help'
 class TestDataFile < Test::Unit::TestCase
   HERE = File.expand_path File.dirname(__FILE__)
   def setup
-    if File.exists?(HERE + '/data.avr')
+    if File.exist?(HERE + '/data.avr')
       File.unlink(HERE + '/data.avr')
     end
   end
 
   def teardown
-    if File.exists?(HERE + '/data.avr')
+    if File.exist?(HERE + '/data.avr')
       File.unlink(HERE + '/data.avr')
     end
   end

Reply via email to