ablab 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c219d83840f4a52ae52811bc0c803f2cb95d8faf
4
- data.tar.gz: 24add236be0845a00b3e6bf7c612d4b7c4c1eee1
3
+ metadata.gz: 5a3a8192557cb955a5a5ed9ac4cb1d5bdfa77d65
4
+ data.tar.gz: af157d385087acf9efb8fcac04304ac840520f5d
5
5
  SHA512:
6
- metadata.gz: 71a6c8a7b1435b14d2c26c84a33bc4a30abc191cf6962e54933e1d828509701034af2c211925caf3ccc5477e3a9ef43e2c0680219eed85449b005562c479e05a
7
- data.tar.gz: 070f411383393068498bef039dd214d2e9426c1b3b1f45cd1e665916bacdf8155b90b34d3db72364026d8a9af79f40bbdbe94c5843f331e41214e53ee025fdf8
6
+ metadata.gz: 3bb8eba0ef626352fe9a816b8d8f8eacd97b51c7fee39671642af756d4168b4520c23e3198671b41e9d001780231003b1a7f27bbd5f1330c33c1afa009af1a66
7
+ data.tar.gz: 9bc780a0e4652f793797070304ba65a5f3a1796fcd9a894da569976ed3694e5ecfe9343df92e91fa266b80f6deec0cb27b821ad2108c3978ae2cdbd67274aa57
@@ -8,12 +8,10 @@ module Ablab
8
8
 
9
9
  def track
10
10
  exp = experiment(params[:experiment].to_sym)
11
- Thread.new do
12
- if params[:event] == 'success'
13
- exp.track_success!
14
- else
15
- exp.track_view!
16
- end
11
+ if params[:event] == 'success'
12
+ exp.track_success!
13
+ else
14
+ exp.track_view!
17
15
  end
18
16
  respond_to do |format|
19
17
  format.js
@@ -111,12 +111,16 @@ module Ablab
111
111
 
112
112
  def track_view!
113
113
  Ablab.tracker.track_view!(experiment.name, group, session_id)
114
- perform_callbacks!(:view)
114
+ Thread.new do
115
+ perform_callbacks!(:view)
116
+ end
115
117
  end
116
118
 
117
119
  def track_success!
118
120
  Ablab.tracker.track_success!(experiment.name, group, session_id)
119
- perform_callbacks!(:success)
121
+ Thread.new do
122
+ perform_callbacks!(:success)
123
+ end
120
124
  end
121
125
 
122
126
  def group
@@ -1,3 +1,3 @@
1
1
  module Ablab
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
@@ -242,7 +242,7 @@ describe Ablab do
242
242
  experiment.on_track do |event, experiment, group, session, request|
243
243
  x = [event, experiment, group, session, request]
244
244
  end
245
- run.track_view!
245
+ run.track_view!.join
246
246
  expect(x).to eq([:view, :foo, run.group, run.session_id, request])
247
247
  expect(y).to eq([:view, :foo, run.group, run.session_id, request])
248
248
  end
@@ -264,7 +264,7 @@ describe Ablab do
264
264
  experiment.on_track do |event, experiment, group, session, request|
265
265
  x = [event, experiment, group, session, request]
266
266
  end
267
- run.track_success!
267
+ run.track_success!.join
268
268
  expect(x).to eq([:success, :foo, run.group, run.session_id, request])
269
269
  expect(y).to eq([:success, :foo, run.group, run.session_id, request])
270
270
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ablab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Ongaro