Class: Propshaft::Compilers::CssAssetUrls
- Inherits:
-
Object
- Object
- Propshaft::Compilers::CssAssetUrls
- Defined in:
- lib/propshaft/compilers/css_asset_urls.rb
Instance Attribute Summary collapse
-
#assembly ⇒ Object
readonly
Returns the value of attribute assembly.
Instance Method Summary collapse
- #compile(input) ⇒ Object
-
#initialize(assembly) ⇒ CssAssetUrls
constructor
A new instance of CssAssetUrls.
Constructor Details
#initialize(assembly) ⇒ CssAssetUrls
Returns a new instance of CssAssetUrls.
4 5 6 |
# File 'lib/propshaft/compilers/css_asset_urls.rb', line 4 def initialize(assembly) @assembly = assembly end |
Instance Attribute Details
#assembly ⇒ Object (readonly)
Returns the value of attribute assembly.
2 3 4 |
# File 'lib/propshaft/compilers/css_asset_urls.rb', line 2 def assembly @assembly end |
Instance Method Details
#compile(input) ⇒ Object
8 9 10 11 12 |
# File 'lib/propshaft/compilers/css_asset_urls.rb', line 8 def compile(input) input.gsub(/asset-path\(["']([^"')]+)["']\)/) do |match| %[url("#{assembly.config.prefix}/#{assembly.load_path.find($1).digested_path}")] end end |