ab_panel 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/ab_panel/controller_additions.rb +3 -2
- data/lib/ab_panel/version.rb +1 -1
- data/lib/ab_panel.rb +10 -1
- data/spec/ab_panel/controller_additions_spec.rb +2 -2
- data/spec/ab_panel_spec.rb +28 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67ea749f4f2e80710669492d90f163ace7311dd0
|
4
|
+
data.tar.gz: e6f8ffea1418b0c80754c011160a09accaeb8a3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec2cffaf2212c588187af99829e85450cb82396229fa9cdeaa40d8c0b467b8f98068206b1720ed927ae48d7950a328c351161f2cce61f320e22dd63478a1fb2a
|
7
|
+
data.tar.gz: 351f325f654bd72fd5993cff00ea767873f7ba211091a4e718243a1fc7c7a66942477c5cc5b5b66bfa193b9133d8647dbad73a5ebfb4b5b1bbf0b1b8bc5701f1
|
data/.travis.yml
CHANGED
@@ -50,6 +50,8 @@ module AbPanel
|
|
50
50
|
AbPanel.reset!
|
51
51
|
AbPanel.conditions = session['ab_panel_conditions']
|
52
52
|
session['ab_panel_conditions'] = AbPanel.conditions
|
53
|
+
AbPanel.funnels = session['ab_panel_funnels']
|
54
|
+
session['ab_panel_funnels'] = AbPanel.funnels
|
53
55
|
|
54
56
|
{
|
55
57
|
'distinct_id' => distinct_id,
|
@@ -76,8 +78,7 @@ module AbPanel
|
|
76
78
|
#
|
77
79
|
# { 'course_id' => @course.id }
|
78
80
|
def track_action(name, properties = {})
|
79
|
-
|
80
|
-
AbPanel.funnels << funnel if funnel.present?
|
81
|
+
AbPanel.add_funnel(properties.delete(:funnel))
|
81
82
|
|
82
83
|
options = {
|
83
84
|
distinct_id: distinct_id,
|
data/lib/ab_panel/version.rb
CHANGED
data/lib/ab_panel.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'set'
|
1
2
|
Dir[File.expand_path(File.join(
|
2
3
|
File.dirname(__FILE__),'ab_panel','**','*.rb'))]
|
3
4
|
.each {|f| require f}
|
@@ -52,7 +53,15 @@ module AbPanel
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def funnels
|
55
|
-
env['funnels'] ||=
|
56
|
+
env['funnels'] ||= Set.new
|
57
|
+
end
|
58
|
+
|
59
|
+
def funnels=(funnels)
|
60
|
+
env['funnels'] = funnels
|
61
|
+
end
|
62
|
+
|
63
|
+
def add_funnel(funnel)
|
64
|
+
funnels.add(funnel) if funnel.present?
|
56
65
|
end
|
57
66
|
|
58
67
|
private # ----------------------------------------------------------------------------
|
@@ -11,8 +11,8 @@ end
|
|
11
11
|
describe AbPanel::ControllerAdditions do
|
12
12
|
let(:controller) { Controller.new }
|
13
13
|
|
14
|
-
describe "#
|
15
|
-
subject { controller.
|
14
|
+
describe "#distinct_id" do
|
15
|
+
subject { controller.distinct_id }
|
16
16
|
|
17
17
|
it { should match /^([A-Z]|[0-9])([A-Z]|[0-9])([A-Z]|[0-9])([A-Z]|[0-9])([A-Z]|[0-9])$/ }
|
18
18
|
end
|
data/spec/ab_panel_spec.rb
CHANGED
@@ -45,4 +45,32 @@ describe AbPanel do
|
|
45
45
|
it { conditions.reject{|c| c}.size.should be 3 }
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
describe ".funnels" do
|
50
|
+
after do
|
51
|
+
AbPanel.funnels = nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'adds a funnel' do
|
55
|
+
AbPanel.add_funnel('search')
|
56
|
+
AbPanel.funnels.to_a.should == ['search']
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'only adds a funnel when present' do
|
60
|
+
AbPanel.add_funnel(nil)
|
61
|
+
AbPanel.funnels.to_a.should == []
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'does not add a funnel twice' do
|
65
|
+
AbPanel.add_funnel('search')
|
66
|
+
AbPanel.add_funnel('search')
|
67
|
+
AbPanel.funnels.to_a.should == ['search']
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'sets funnels' do
|
71
|
+
funnels = Set.new ['search', 'cta']
|
72
|
+
AbPanel.funnels = funnels
|
73
|
+
AbPanel.funnels.to_a.should == funnels.to_a
|
74
|
+
end
|
75
|
+
end
|
48
76
|
end
|
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.
|
4
|
+
version: 0.1.1
|
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-10-
|
12
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|