Class: Sprockets::Js::Coverage::Processor
- Inherits:
-
Object
- Object
- Sprockets::Js::Coverage::Processor
- Defined in:
- lib/sprockets/js/coverage/processor.rb
Constant Summary collapse
- VERSION =
'1'
Class Method Summary collapse
Class Method Details
.cache_key ⇒ Object
18 19 20 |
# File 'lib/sprockets/js/coverage/processor.rb', line 18 def cache_key @cache_key ||= "#{name}:#{VERSION}".freeze end |
.call(input) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sprockets/js/coverage/processor.rb', line 22 def call(input) source = input[:data] uri = URI.parse(input[:uri]) if Sprockets::Js::Coverage::Processor.config.should_process return unless Sprockets::Js::Coverage::Processor.config.should_process.call(uri.path) end begin covered_source = $context.call("instrument", source, uri.path.to_s) rescue => e warn "Error instrumenting #{uri.path}: #{e}" return source end covered_source end |
.config ⇒ Object
14 15 16 |
# File 'lib/sprockets/js/coverage/processor.rb', line 14 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
10 11 12 |
# File 'lib/sprockets/js/coverage/processor.rb', line 10 def configure yield config end |