Skip to content

Commit dba2802

Browse files
authored
Merge pull request #672 from 007lva/chore/replace-Fixnum-and-Bignum-with-Integer
Drop support for Ruby 2.3
2 parents 8fc492a + a03af72 commit dba2802

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprockets/blob/master/UPGRADING.md
44

5+
## Master
6+
7+
- Remove remaining support for Ruby < 2.4.[#672](https://github.com/rails/sprockets/pull/672)
8+
59
## 4.0.2
610

711
- Fix `etag` and digest path compilation that were generating string with invalid digest since 4.0.1.

lib/sprockets/digest_utils.rb

+1-11
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,8 @@ def detect_digest_class(bytes)
6868
Encoding => ->(val, digest) {
6969
digest << 'Encoding'.freeze
7070
digest << val.name
71-
},
72-
}
73-
if 0.class != Integer # Ruby < 2.4
74-
ADD_VALUE_TO_DIGEST[Fixnum] = ->(val, digest) {
75-
digest << 'Integer'.freeze
76-
digest << val.to_s
7771
}
78-
ADD_VALUE_TO_DIGEST[Bignum] = ->(val, digest) {
79-
digest << 'Integer'.freeze
80-
digest << val.to_s
81-
}
82-
end
72+
}
8373

8474
ADD_VALUE_TO_DIGEST.compare_by_identity.rehash
8575

lib/sprockets/loader.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def resolve_dependencies(uris)
291291
# Internal: Retrieves an asset based on its digest
292292
#
293293
# unloaded - An UnloadedAsset
294-
# limit - A Fixnum which sets the maximum number of versions of "histories"
294+
# limit - An Integer which sets the maximum number of versions of "histories"
295295
# stored in the cache
296296
#
297297
# This method attempts to retrieve the last `limit` number of histories of an asset

lib/sprockets/processor_utils.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ def processors_cache_keys(processors)
118118
Symbol,
119119
TrueClass,
120120
FalseClass,
121-
NilClass
122-
] + (0.class == Integer ? [Integer] : [Bignum, Fixnum])).freeze
121+
NilClass,
122+
Integer
123+
]).freeze
123124

124125
# Internal: Set of all nested compound metadata types that can nest values.
125126
VALID_METADATA_COMPOUND_TYPES = Set.new([

0 commit comments

Comments
 (0)