Skip to content

Commit

Permalink
Test in ruby 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed Oct 27, 2017
1 parent d44a75c commit a9b959d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.0
* Remove ruby Bignum

# 1.0.2
* Handle numbers with M precision

Expand Down
17 changes: 10 additions & 7 deletions lib/edn/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/edn/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EDN
VERSION = "1.1.1"
VERSION = "1.2.0"
end

0 comments on commit a9b959d

Please sign in to comment.