lib/munge/routers/fingerprint.rb in munge-0.17.0 vs lib/munge/routers/fingerprint.rb in munge-0.18.0
- old
+ new
@@ -2,11 +2,11 @@
module Routers
class Fingerprint
def initialize(extensions:,
separator:)
@extensions = extensions
- @separator = separator
+ @separator = separator
end
def type
:route
end
@@ -27,11 +27,11 @@
private
def generate_link(initial_route, content)
pre, extension = disassemble(initial_route)
- asset_hash = hash(content)
+ asset_hash = hash(content)
if extension == ""
"#{pre}#{@separator}#{asset_hash}"
else
"#{pre}#{@separator}#{asset_hash}.#{extension}"
@@ -41,10 +41,10 @@
def hash(content)
Digest::SHA256.hexdigest(content)
end
def disassemble(path)
- extension = Util::Path.extname(path)
+ extension = Util::Path.extname(path)
path_without_extension = Util::Path.path_no_extension(path)
[
path_without_extension,
extension