jsinstrument 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/jsinstrument/instrumenter.rb +3 -2
- data/lib/jsinstrument/version.rb +1 -1
- metadata +1 -1
@@ -7,7 +7,7 @@ include RKelly::Nodes
|
|
7
7
|
module JSInstrument
|
8
8
|
class Instrumenter
|
9
9
|
|
10
|
-
attr_accessor :js_object_name, :upload_url, :project_name, :commit_hash, :batch_text, :data_compress_method
|
10
|
+
attr_accessor :js_object_name, :upload_url, :project_name, :commit_hash, :batch_text, :data_compress_method, :src_filename
|
11
11
|
|
12
12
|
def js_object_name
|
13
13
|
@js_object_name || '__coverage__'
|
@@ -19,6 +19,7 @@ module JSInstrument
|
|
19
19
|
|
20
20
|
def instrument src, filename
|
21
21
|
raise 'Filename not set' unless filename
|
22
|
+
self.src_filename = filename
|
22
23
|
ast = RKelly::Parser.new.parse src
|
23
24
|
raise 'Parse source failed.' unless ast
|
24
25
|
ast, instrumented_lines = instrument_ast ast
|
@@ -29,7 +30,7 @@ module JSInstrument
|
|
29
30
|
bindings = {
|
30
31
|
js_object_name: self.js_object_name,
|
31
32
|
upload_url: self.upload_url,
|
32
|
-
src_filename:
|
33
|
+
src_filename: self.src_filename,
|
33
34
|
project_name: self.project_name,
|
34
35
|
commit_hash: self.commit_hash,
|
35
36
|
batch_text: self.batch_text,
|
data/lib/jsinstrument/version.rb
CHANGED