Class: Propshaft::Compilers::SourceMappingUrls
- Inherits:
-
Object
- Object
- Propshaft::Compilers::SourceMappingUrls
- Defined in:
- lib/propshaft/compilers/source_mapping_urls.rb
Constant Summary collapse
- SOURCE_MAPPING_PATTERN =
%r{^(//|/\*)# sourceMappingURL=(.+\.map)}
Instance Attribute Summary collapse
-
#assembly ⇒ Object
readonly
Returns the value of attribute assembly.
Instance Method Summary collapse
- #compile(logical_path, input) ⇒ Object
-
#initialize(assembly) ⇒ SourceMappingUrls
constructor
A new instance of SourceMappingUrls.
Constructor Details
#initialize(assembly) ⇒ SourceMappingUrls
Returns a new instance of SourceMappingUrls.
8 9 10 |
# File 'lib/propshaft/compilers/source_mapping_urls.rb', line 8 def initialize(assembly) @assembly = assembly end |
Instance Attribute Details
#assembly ⇒ Object (readonly)
Returns the value of attribute assembly.
4 5 6 |
# File 'lib/propshaft/compilers/source_mapping_urls.rb', line 4 def assembly @assembly end |
Instance Method Details
#compile(logical_path, input) ⇒ Object
12 13 14 |
# File 'lib/propshaft/compilers/source_mapping_urls.rb', line 12 def compile(logical_path, input) input.gsub(SOURCE_MAPPING_PATTERN) { source_mapping_url(asset_path($2, logical_path), $1) } end |