jsinstrument 0.1.1 → 0.1.2
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/inserting.js +12 -7
- data/lib/jsinstrument/version.rb +1 -1
- metadata +2 -2
@@ -21,6 +21,11 @@
|
|
21
21
|
* }
|
22
22
|
*/
|
23
23
|
data: {},
|
24
|
+
/**
|
25
|
+
* data compress method for uploading
|
26
|
+
* false or undefined to disable data compress
|
27
|
+
*/
|
28
|
+
data_compress_method = %{data_compress_method},
|
24
29
|
/**
|
25
30
|
* register instrumented lines for the file
|
26
31
|
*/
|
@@ -77,7 +82,7 @@
|
|
77
82
|
/**
|
78
83
|
* Upload coverage data to server
|
79
84
|
*/
|
80
|
-
upload: function(mark, force) {
|
85
|
+
upload: function(mark, case_name, case_action, force) {
|
81
86
|
// if uploading
|
82
87
|
if(!force && this._uploading) return;
|
83
88
|
|
@@ -85,7 +90,7 @@
|
|
85
90
|
this._uploading = true;
|
86
91
|
|
87
92
|
try {
|
88
|
-
$.post('%{upload_url}', this.
|
93
|
+
$.post('%{upload_url}', this.serialize(mark, case_name, case_action)).done(function() {
|
89
94
|
console.log('Coverage data uploaded!');
|
90
95
|
}).always(function() {
|
91
96
|
self._uploading = false;
|
@@ -97,7 +102,7 @@
|
|
97
102
|
/**
|
98
103
|
* serialize data for data uploading
|
99
104
|
*/
|
100
|
-
|
105
|
+
serialize: function(mark, case_name, case_action) {
|
101
106
|
var data = this.data;
|
102
107
|
var json = [];
|
103
108
|
|
@@ -130,13 +135,13 @@
|
|
130
135
|
commit: '%{commit_hash}',
|
131
136
|
batch: '%{batch_text}',
|
132
137
|
mark: mark,
|
138
|
+
case_name: case_name,
|
139
|
+
case_action: case_action,
|
133
140
|
data: result
|
134
141
|
}
|
135
142
|
|
136
|
-
|
137
|
-
|
138
|
-
if (data_compress_method) {
|
139
|
-
var result_deflated = data_compress_method(result);
|
143
|
+
if (this.data_compress_method) {
|
144
|
+
var result_deflated = this.data_compress_method(result);
|
140
145
|
var result_encoded = btoa(result_deflated);
|
141
146
|
r.data_compressed = true;
|
142
147
|
r.data = result_encoded;
|
data/lib/jsinstrument/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsinstrument
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rkelly
|