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: 924ceb568a75e5837182e2d0a652024ba9243fc4
4
- data.tar.gz: a4ef4f87b24c8d56b425a118597b9249c80530ed
3
+ metadata.gz: eddcde97ae111db6ebc623a046cb420165781b04
4
+ data.tar.gz: 2eef6a7d7788394cc81c4d508cca4ce598c2aaf0
5
5
  SHA512:
6
- metadata.gz: 1d15f75f741ebb6cac638d00b82ce68d469f73735eda4d5c337cee6079190e8fc0a710399c7b8b80e78d01b9cc1ee45e8f959f48fc50814a4d38da5a2d7052c9
7
- data.tar.gz: b45511ac1fdee19f0304e114a514297b9221a07f6de404d7459299e3c7e471de7297ae7b80d8cbf0a2bb41b85abe9b0b5ebc606cce2521a175271aa8b0906433
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
- session['distinct_id'] ||=
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 = session['ab_panel_conditions']
52
- session['ab_panel_conditions'] = AbPanel.conditions
53
- AbPanel.funnels = session['ab_panel_funnels']
54
- session['ab_panel_funnels'] = AbPanel.funnels
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,
@@ -1,3 +1,3 @@
1
1
  module AbPanel
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.1.3
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-15 00:00:00.000000000 Z
12
+ date: 2013-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler