ab_panel 0.1.3 → 0.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eddcde97ae111db6ebc623a046cb420165781b04
|
4
|
+
data.tar.gz: 2eef6a7d7788394cc81c4d508cca4ce598c2aaf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 364bb674be3048779273917e7a35fa51927356bf67e9187a323c296b30a0d5d61101d1fae1c8eac20dc3f28a4a8c51e6f7e8d9cee199feca714cb5771851704c
|
7
|
+
data.tar.gz: 1c0dca5e98a83de0785a7654452ce68881eb6a471530d3758aaad0eb2f85761dfecb2d6b5c3d1626877380d70de84ca3f0ccf03444b18315e86c6735edbbbb69
|
@@ -27,7 +27,7 @@ module AbPanel
|
|
27
27
|
#
|
28
28
|
# `current_user.id` for logged in users.
|
29
29
|
def distinct_id
|
30
|
-
|
30
|
+
cookies.signed['distinct_id'] ||=
|
31
31
|
(0..4).map { |i| i.even? ? ('A'..'Z').to_a[rand(26)] : rand(10) }.join
|
32
32
|
end
|
33
33
|
|
@@ -48,10 +48,10 @@ module AbPanel
|
|
48
48
|
# in the user's session.
|
49
49
|
def initialize_ab_panel!(options = {})
|
50
50
|
AbPanel.reset!
|
51
|
-
AbPanel.conditions =
|
52
|
-
|
53
|
-
AbPanel.funnels =
|
54
|
-
|
51
|
+
AbPanel.conditions = cookies.signed['ab_panel_conditions']
|
52
|
+
cookies.signed['ab_panel_conditions'] = AbPanel.conditions
|
53
|
+
AbPanel.funnels = cookies.signed['ab_panel_funnels']
|
54
|
+
cookies.signed['ab_panel_funnels'] = AbPanel.funnels
|
55
55
|
|
56
56
|
{
|
57
57
|
'distinct_id' => distinct_id,
|
data/lib/ab_panel/version.rb
CHANGED
@@ -12,6 +12,8 @@ describe AbPanel::ControllerAdditions do
|
|
12
12
|
let(:controller) { Controller.new }
|
13
13
|
|
14
14
|
describe "#distinct_id" do
|
15
|
+
let(:cookies) { {} }
|
16
|
+
before { controller.stub_chain(:cookies, :signed).and_return(cookies) }
|
15
17
|
subject { controller.distinct_id }
|
16
18
|
|
17
19
|
it { should match /^([A-Z]|[0-9])([A-Z]|[0-9])([A-Z]|[0-9])([A-Z]|[0-9])([A-Z]|[0-9])$/ }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ab_panel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wouter de Vos
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|