From a9b959d27e16e9ff98be9e8a6432e68faea0cc77 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Fri, 27 Oct 2017 17:43:47 +0100 Subject: [PATCH] Test in ruby 2.4 --- .travis.yml | 5 ++++- CHANGELOG.md | 3 +++ lib/edn/core_ext.rb | 17 ++++++++++------- lib/edn/version.rb | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53e6c1e..0fe030c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ +sudo: false language: ruby rvm: - - "1.9.2" - "1.9.3" - "2.0.0" + - "2.2" + - "2.3" + - "2.4" - jruby-19mode # JRuby in 1.9 mode # - "1.8.7" # - jruby-18mode # JRuby in 1.8 mode diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a03026..0df3482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.2.0 +* Remove ruby Bignum + # 1.0.2 * Handle numbers with M precision diff --git a/lib/edn/core_ext.rb b/lib/edn/core_ext.rb index 316ce2c..41e7e2c 100644 --- a/lib/edn/core_ext.rb +++ b/lib/edn/core_ext.rb @@ -16,12 +16,6 @@ def allows_metadata? end end - module Bignum - def to_edn - self.to_s + 'M' - end - end - module BigDecimal def to_edn self.to_s('F') + 'M' @@ -90,11 +84,20 @@ def to_edn EDN.tagout("inst", self.xmlschema) end end + + if RUBY_VERSION >= '2.4.0' + module Bignum + def to_edn + self.to_s + 'M' + end + end + ::Bignum.send(:include, EDN::CoreExt::Bignum) + end + end end Numeric.send(:include, EDN::CoreExt::Unquoted) -Bignum.send(:include, EDN::CoreExt::Bignum) BigDecimal.send(:include, EDN::CoreExt::BigDecimal) TrueClass.send(:include, EDN::CoreExt::Unquoted) FalseClass.send(:include, EDN::CoreExt::Unquoted) diff --git a/lib/edn/version.rb b/lib/edn/version.rb index 5c9d1c8..5b15ee6 100644 --- a/lib/edn/version.rb +++ b/lib/edn/version.rb @@ -1,3 +1,3 @@ module EDN - VERSION = "1.1.1" + VERSION = "1.2.0" end