Skip to content

Commit d5d333e

Browse files
authored
Merge pull request #106 from subdigital/sprockets_pathname
Fix bad reference to Sprockets::Asset.pathname
2 parents f64cf53 + 0bf0420 commit d5d333e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/inline_svg/static_asset_finder.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
require "pathname"
2+
13
# Naive fallback asset finder for when sprockets >= 3.0 &&
24
# config.assets.precompile = false
35
# Thanks to @ryanswood for the original code:
4-
# https://github.com/AbleHealth/inline_svg/commit/661bbb3bef7d1b4bd6ccd63f5f018305797b9509
6+
# https://github.com/jamesmartin/inline_svg/commit/661bbb3bef7d1b4bd6ccd63f5f018305797b9509
57
module InlineSvg
68
class StaticAssetFinder
79
def self.find_asset(filename)
@@ -14,7 +16,7 @@ def initialize(filename)
1416

1517
def pathname
1618
if ::Rails.application.config.assets.compile
17-
::Rails.application.assets[@filename].pathname
19+
Pathname.new(::Rails.application.assets[@filename].filename)
1820
else
1921
manifest = ::Rails.application.assets_manifest
2022
asset_path = manifest.assets[@filename]

0 commit comments

Comments
 (0)