File: finds_asset_paths.rb

package info (click to toggle)
ruby-inline-svg 1.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: ruby: 1,711; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
module InlineSvg
  class FindsAssetPaths
    def self.by_filename(filename)
      asset = configured_asset_finder.find_asset(filename)
      asset.try(:pathname) || asset.try(:filename)
    end

    def self.configured_asset_finder
      Thread.current[:inline_svg_asset_finder] || InlineSvg.configuration.asset_finder
    end
  end
end