ab_panel 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/config/ab_panel.yml +5 -5
- data/lib/ab_panel/config.rb +4 -3
- data/lib/ab_panel/version.rb +1 -1
- data/spec/ab_panel/config_spec.rb +26 -10
- metadata +21 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9b7d7fb5d5ab3835d06ffbe6d30c994c55b329d
|
4
|
+
data.tar.gz: 3b11bb8f4e3ffcc50c35a1c989821643d1cc8d42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 771553f411e57c0ac8032dd8526b50045d4e62cbd1e3103567e965121c80c00932c08b574515a3ece951174250e56a71ea254705ae81fac193e5890ac9bdd3b9
|
7
|
+
data.tar.gz: 0237e1a52e4636a920564469cb2c92a8564f41553f99deded950fef1fa2ce99171ed1573beb34c9b2a86967419fe3da812989b5ccc7487b762b5514be05fc483
|
data/example/config/ab_panel.yml
CHANGED
data/lib/ab_panel/config.rb
CHANGED
@@ -7,6 +7,7 @@ module AbPanel
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def experiments
|
10
|
+
return {} if !settings
|
10
11
|
settings.keys.map(&:to_sym)
|
11
12
|
end
|
12
13
|
|
@@ -21,9 +22,9 @@ module AbPanel
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def settings
|
24
|
-
@settings
|
25
|
-
|
26
|
-
|
25
|
+
return @settings if defined?(@settings)
|
26
|
+
results = YAML.load(ERB.new(File.read(File.join(Rails.root, 'config', 'ab_panel.yml'))).result)
|
27
|
+
@settings = results ? results.symbolize_keys : nil
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
data/lib/ab_panel/version.rb
CHANGED
@@ -2,18 +2,34 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe AbPanel::Config do
|
4
4
|
let(:config) { AbPanel::Config.new }
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
context "config" do
|
6
|
+
before do
|
7
|
+
AbPanel::Config.any_instance.stub(:settings) { { exp1: { scenario1: 25, scenario2: 75 } } }
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
describe '.experiments' do
|
11
|
+
subject { config.experiments }
|
12
|
+
it { should =~ [:exp1] }
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
describe '.weights' do
|
16
|
+
subject { config.weights('exp1') }
|
17
|
+
|
18
|
+
it { should =~ [75.0, 25.0] }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
context "empty config" do
|
22
|
+
before do
|
23
|
+
YAML.stub(:load) { false }
|
24
|
+
end
|
25
|
+
describe ".settings" do
|
26
|
+
subject { config.settings }
|
27
|
+
it { should eq nil }
|
28
|
+
end
|
16
29
|
|
17
|
-
|
30
|
+
describe ".experiments" do
|
31
|
+
subject { config.experiments }
|
32
|
+
it { should == {} }
|
33
|
+
end
|
18
34
|
end
|
19
35
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wouter de Vos
|
@@ -10,104 +10,104 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.3'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.3'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '3.2'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ~>
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '3.2'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rake
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: fakeweb
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - '>='
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - '>='
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rspec
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - '>='
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: debugger
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - '>='
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: mixpanel
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - '>='
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
description: Run A/B test experiments on your Rails 3+ site using Mixpanel as a backend.
|
@@ -119,8 +119,8 @@ executables: []
|
|
119
119
|
extensions: []
|
120
120
|
extra_rdoc_files: []
|
121
121
|
files:
|
122
|
-
-
|
123
|
-
-
|
122
|
+
- .gitignore
|
123
|
+
- .travis.yml
|
124
124
|
- Gemfile
|
125
125
|
- LICENSE.txt
|
126
126
|
- README.md
|
@@ -218,17 +218,17 @@ require_paths:
|
|
218
218
|
- lib
|
219
219
|
required_ruby_version: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
|
-
- -
|
221
|
+
- - '>='
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
|
-
- -
|
226
|
+
- - '>='
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.0.14
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: Run A/B test experiments on your Rails 3+ site using Mixpanel as a backend.
|