Skip to content

Make SquareSquash-ruby compatible with Ruby 2.4 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/squash/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ module Ruby
}
# Types that are serialized directly to JSON, rather than to a hash of
# object information. Subclasses are not considered members of this array.
JSON_NATIVE_TYPES = [String, NilClass, TrueClass, FalseClass, Integer,
Fixnum, Float]
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.4.0')
JSON_NATIVE_TYPES = [
String, NilClass, TrueClass, FalseClass, Fixnum, Float
].freeze
else
JSON_NATIVE_TYPES = [
String, NilClass, TrueClass, FalseClass, Integer, Fixnum, Float
].freeze
end
# Array of user-data fields that should be moved out of the user data to
# become top-level attributes. A Rails client library would expand this
# constant to include Rails-specific fields, for example.
Expand Down
2 changes: 1 addition & 1 deletion squash_ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Gem::Specification.new do |s|
s.name = "squash_ruby".freeze
s.version = "2.0.1"
s.version = "2.0.2"

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
Expand Down