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 +4 -4
- data/app/controllers/ablab/base_controller.rb +4 -6
- data/lib/ablab.rb +6 -2
- data/lib/ablab/version.rb +1 -1
- data/spec/ablab_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3a8192557cb955a5a5ed9ac4cb1d5bdfa77d65
|
4
|
+
data.tar.gz: af157d385087acf9efb8fcac04304ac840520f5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
data/lib/ablab.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
121
|
+
Thread.new do
|
122
|
+
perform_callbacks!(:success)
|
123
|
+
end
|
120
124
|
end
|
121
125
|
|
122
126
|
def group
|
data/lib/ablab/version.rb
CHANGED
data/spec/ablab_spec.rb
CHANGED
@@ -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
|