Class: Workarea::SvgAssetFinder

Inherits:
InlineSvg::StaticAssetFinder
  • Object
show all
Defined in:
lib/workarea/svg_asset_finder.rb

Overview

Find SVG assets for InlineSvg in any asset path. Represents a single asset file.

Instance Method Summary collapse

Instance Method Details

#pathnamePathname

Fully-qualified path to the asset. This is what’s read out in InlineSvg to actually read the SVG file from disk. It attempts to find a static asset through the Sprockets manifest, but falls back to iterating through all gem folders for the correct path.

cannot be found.

Returns:

  • (Pathname)

    Path to the asset on disk, or nil if it



12
13
14
15
16
17
18
# File 'lib/workarea/svg_asset_finder.rb', line 12

def pathname
  path = asset_pathname
  return path if path.present?
  return unless engine_root.present?

  engine_root.join(@filename)
end