Class: SourceMapsFixer::Executor
- Inherits:
-
Object
- Object
- SourceMapsFixer::Executor
- Defined in:
- lib/source_maps_fixer.rb
Class Method Summary collapse
Class Method Details
.call ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/source_maps_fixer.rb', line 29 def self.call Path.files_with_source_maps.each do |file_name, sm_name| new_content = File.read(file_name).sub( Path.source_mapping_url(File.basename(sm_name)), Path.source_mapping_url(Path.digest_path(sm_name)) ) File.open(file_name, 'w') { |file| file.write new_content } end end |
.undo ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/source_maps_fixer.rb', line 39 def self.undo Path.files_with_source_maps.each do |file_name, sm_name| new_content = File.read(file_name).sub( Path.source_mapping_url(Path.digest_path(sm_name)), Path.source_mapping_url(File.basename(sm_name)) ) File.open(file_name, 'w') { |file| file.write new_content } end end |