Skip to content

Commit 5bef159

Browse files
authored
Merge pull request mbj#75 from toptal/suppress-ruby-2-4-fixnum-deprecation
Suppress Ruby 2.4 Fixnum deprecation
2 parents 36f707c + 7a11d01 commit 5bef159

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PATH
77
concord (~> 0.1.5)
88
diff-lcs (~> 1.3)
99
equalizer (~> 0.0.9)
10-
parser (~> 2.3.0)
10+
parser (>= 2.3.1.2, < 2.5)
1111
procto (~> 0.0.2)
1212

1313
GEM

lib/unparser/emitter/literal/primitive.rb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,21 @@ class Complex < self
3333

3434
RATIONAL_FORMAT = 'i'.freeze
3535

36-
MAP = IceNine.deep_freeze(
37-
Float => :float,
38-
Rational => :rational,
39-
Fixnum => :int,
40-
Bignum => :int
41-
)
36+
MAP =
37+
if 0.class.equal?(Integer)
38+
IceNine.deep_freeze(
39+
Float => :float,
40+
Rational => :rational,
41+
Integer => :int
42+
)
43+
else
44+
IceNine.deep_freeze(
45+
Float => :float,
46+
Rational => :rational,
47+
Fixnum => :int,
48+
Bignum => :int
49+
)
50+
end
4251

4352
private
4453

spec/integrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# Revision of rubyspec on the last CI build of unparser that passed
2121
repo_ref: 'origin/master'
2222
exclude:
23+
- command_line/fixtures/bad_syntax.rb
2324
- core/array/pack/shared/float.rb
2425
- core/array/pack/shared/integer.rb
2526
- core/array/pack/shared/string.rb
@@ -79,4 +80,3 @@
7980
- library/stringscanner/shared/get_byte.rb
8081
- library/zlib/inflate/set_dictionary_spec.rb
8182
- optional/capi/integer_spec.rb
82-

unparser.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
2323
gem.add_dependency('equalizer', '~> 0.0.9')
2424
gem.add_dependency('diff-lcs', '~> 1.3')
2525
gem.add_dependency('concord', '~> 0.1.5')
26-
gem.add_dependency('parser', '~> 2.3.0')
26+
gem.add_dependency('parser', '>= 2.3.1.2', '< 2.5')
2727
gem.add_dependency('procto', '~> 0.0.2')
2828

2929
gem.add_development_dependency('anima', '~> 0.3.0')

0 commit comments

Comments
 (0)