From 087be64d98ee16b92540c93b1c720d41f21c00a3 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Sun, 22 Dec 2013 23:28:23 -0800 Subject: amusing ruby 1.8.7 bug --- lib/ffi_yajl/encoder.rb | 1 + lib/ffi_yajl/ffi/encoder.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb index ea6c1d7..f742741 100644 --- a/lib/ffi_yajl/encoder.rb +++ b/lib/ffi_yajl/encoder.rb @@ -19,6 +19,7 @@ module FFI_Yajl # call either the ext or ffi hook str = do_yajl_encode(obj, yajl_gen_opts) str.force_encoding('UTF-8') if defined? Encoding + str end def self.encode(obj, *args) diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb index 13fd7fb..1d54389 100644 --- a/lib/ffi_yajl/ffi/encoder.rb +++ b/lib/ffi_yajl/ffi/encoder.rb @@ -121,6 +121,7 @@ end class Bignum def ffi_yajl(yajl_gen, state) + puts "ENCODING BIGNUM" str = self.to_s if str == "NaN" || str == "Infinity" || str == "-Infinity" raise ::FFI_Yajl::EncodeError.new("'#{str}' is an invalid number") -- cgit v1.2.1