ab_panel 0.1.2 → 0.1.3
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/lib/ab_panel/javascript.rb +2 -3
- data/lib/ab_panel/version.rb +1 -1
- data/lib/ab_panel.rb +4 -0
- data/spec/ab_panel/javascript_spec.rb +16 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 924ceb568a75e5837182e2d0a652024ba9243fc4
|
4
|
+
data.tar.gz: a4ef4f87b24c8d56b425a118597b9249c80530ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d15f75f741ebb6cac638d00b82ce68d469f73735eda4d5c337cee6079190e8fc0a710399c7b8b80e78d01b9cc1ee45e8f959f48fc50814a4d38da5a2d7052c9
|
7
|
+
data.tar.gz: b45511ac1fdee19f0304e114a514297b9221a07f6de404d7459299e3c7e471de7297ae7b80d8cbf0a2bb41b85abe9b0b5ebc606cce2521a175271aa8b0906433
|
data/lib/ab_panel/javascript.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
module AbPanel
|
2
2
|
class Javascript
|
3
3
|
def self.environment
|
4
|
-
props = {
|
5
|
-
|
6
|
-
}.merge(AbPanel.env[:properties])
|
4
|
+
props = { distinct_id: AbPanel.env["distinct_id"] }
|
5
|
+
props.merge!(AbPanel.properties) if AbPanel.properties
|
7
6
|
|
8
7
|
AbPanel.funnels.each { |f| props["funnel_#{f}"] = true }
|
9
8
|
|
data/lib/ab_panel/version.rb
CHANGED
data/lib/ab_panel.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AbPanel::Javascript do
|
4
|
+
it 'returns json of all relevant properties, funnels and experiments' do
|
5
|
+
AbPanel.set_env('distinct_id', 'distinct_id')
|
6
|
+
AbPanel.set_env(:properties, { post_name: 'test' })
|
7
|
+
result = JSON.parse(AbPanel::Javascript.environment)
|
8
|
+
result['distinct_id'].should == 'distinct_id'
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'works without extra properties' do
|
12
|
+
AbPanel.set_env(:properties, nil)
|
13
|
+
result = JSON.parse(AbPanel::Javascript.environment)
|
14
|
+
result['distinct_id'].should == 'distinct_id'
|
15
|
+
end
|
16
|
+
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wouter de Vos
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- lib/ab_panel/mixpanel.rb
|
198
198
|
- lib/ab_panel/version.rb
|
199
199
|
- spec/ab_panel/controller_additions_spec.rb
|
200
|
+
- spec/ab_panel/javascript_spec.rb
|
200
201
|
- spec/ab_panel_spec.rb
|
201
202
|
- spec/spec_helper.rb
|
202
203
|
- spec/support/fakeweb.rb
|
@@ -294,6 +295,7 @@ test_files:
|
|
294
295
|
- example/vendor/assets/stylesheets/.gitkeep
|
295
296
|
- example/vendor/plugins/.gitkeep
|
296
297
|
- spec/ab_panel/controller_additions_spec.rb
|
298
|
+
- spec/ab_panel/javascript_spec.rb
|
297
299
|
- spec/ab_panel_spec.rb
|
298
300
|
- spec/spec_helper.rb
|
299
301
|
- spec/support/fakeweb.rb
|