class Propshaft::Resolver::Static
Attributes
Public Class Methods
Source
# File lib/propshaft/resolver/static.rb, line 5 def initialize(manifest_path:, prefix:) @manifest_path, @prefix = manifest_path, prefix end
Public Instance Methods
Source
# File lib/propshaft/resolver/static.rb, line 15 def integrity(logical_path) entry = manifest[logical_path] entry&.integrity end
Source
# File lib/propshaft/resolver/static.rb, line 21 def read(logical_path, encoding: "ASCII-8BIT") if asset_path = digested_path(logical_path) File.read(manifest_path.dirname.join(asset_path), encoding: encoding) end end
Source
# File lib/propshaft/resolver/static.rb, line 9 def resolve(logical_path) if asset_path = digested_path(logical_path) File.join prefix, asset_path end end
Private Instance Methods
Source
# File lib/propshaft/resolver/static.rb, line 32 def digested_path(logical_path) entry = manifest[logical_path] entry&.digested_path end
Source
# File lib/propshaft/resolver/static.rb, line 28 def manifest @manifest ||= Propshaft::Manifest.from_path(manifest_path) end