diff options
author | Matt Brictson <mattbrictson@users.noreply.github.com> | 2017-04-17 17:24:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-17 17:24:30 -0700 |
commit | f236783d69dfb0fc1daa1a4f187dde3792190449 (patch) | |
tree | 76c64a52ca29f661526e61a4b53e1f9133051cf4 | |
parent | e8c8321a1a7db230f23c75517ebbeda0c614e823 (diff) | |
download | plist-f236783d69dfb0fc1daa1a4f187dde3792190449.tar.gz |
Fix Fixnum, Bignum deprecations in Ruby 2.4 (#33)
Fixnum and Bignum have been deprecated in Ruby 2.4. In any case, both of
these classes are subclasses of Integer, so using just Integer in the
case statements is sufficient. Remove references to Fixnum and Bignum to
silence the deprecations warnings.
-rw-r--r-- | CHANGELOG.rdoc | 1 | ||||
-rw-r--r-- | lib/plist/generator.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index b9f5bbd..63adfd7 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -5,6 +5,7 @@ https://github.com/patsplat/plist/compare/dece870...HEAD * Your contribution here! +* Fix Fixnum, Bignum deprecations in Ruby 2.4 === 3.2.0 (2016-01-28) diff --git a/lib/plist/generator.rb b/lib/plist/generator.rb index 3b84c30..e653675 100644 --- a/lib/plist/generator.rb +++ b/lib/plist/generator.rb @@ -94,7 +94,7 @@ module Plist::Emit output << tag('date', element.utc.strftime('%Y-%m-%dT%H:%M:%SZ')) when Date # also catches DateTime output << tag('date', element.strftime('%Y-%m-%dT%H:%M:%SZ')) - when String, Symbol, Fixnum, Bignum, Integer, Float + when String, Symbol, Integer, Float output << tag(element_type(element), CGI::escapeHTML(element.to_s)) when IO, StringIO element.rewind @@ -159,7 +159,7 @@ module Plist::Emit when String, Symbol 'string' - when Fixnum, Bignum, Integer + when Integer 'integer' when Float |