jsinstrument 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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._serialize(mark)).done(function() {
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
- _serialize: function(mark) {
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
- var data_compress_method = %{data_compress_method};
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;
@@ -1,3 +1,3 @@
1
1
  module JSInstrument
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-10-21 00:00:00.000000000 Z
12
+ date: 2013-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rkelly