Skip to content

Commit

Permalink
Replace Fixnum and Bignum with Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
007lva committed May 3, 2020
1 parent 9909da6 commit ba66dc4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
12 changes: 1 addition & 11 deletions lib/sprockets/digest_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,8 @@ def detect_digest_class(bytes)
Encoding => ->(val, digest) {
digest << 'Encoding'.freeze
digest << val.name
},
}
if 0.class != Integer # Ruby < 2.4
ADD_VALUE_TO_DIGEST[Fixnum] = ->(val, digest) {
digest << 'Integer'.freeze
digest << val.to_s
}
ADD_VALUE_TO_DIGEST[Bignum] = ->(val, digest) {
digest << 'Integer'.freeze
digest << val.to_s
}
end
}

ADD_VALUE_TO_DIGEST.compare_by_identity.rehash

Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def resolve_dependencies(uris)
# Internal: Retrieves an asset based on its digest
#
# unloaded - An UnloadedAsset
# limit - A Fixnum which sets the maximum number of versions of "histories"
# limit - A Integer which sets the maximum number of versions of "histories"
# stored in the cache
#
# This method attempts to retrieve the last `limit` number of histories of an asset
Expand Down
5 changes: 3 additions & 2 deletions lib/sprockets/processor_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def processors_cache_keys(processors)
Symbol,
TrueClass,
FalseClass,
NilClass
] + (0.class == Integer ? [Integer] : [Bignum, Fixnum])).freeze
NilClass,
Integer
]).freeze

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

0 comments on commit ba66dc4

Please sign in to comment.