class Sprockets::AssetAttributes
def logical_path
shaddowed in the path, but is required relatively, its logical
This has some known issues. For an example if a file is
Reverse guess logical path for fully expanded path.
def logical_path raise ArgumentError unless pathname.absolute? if root_path = environment.paths.detect { |path| pathname.to_s[path] } path = pathname.relative_path_from(Pathname.new(root_path)).to_s path = engine_extensions.inject(path) { |p, ext| p.sub(ext, '') } path = "#{path}#{engine_format_extension}" unless format_extension path else raise FileOutsidePaths, "#{pathname} isn't in paths: #{environment.paths.join(', ')}" end end