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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17de85b0bf79398d4c004cb2a7de53b13347843e
4
- data.tar.gz: ec7bbc8ade945df459db9f83b754c2cefab9f9c9
3
+ metadata.gz: e9b7d7fb5d5ab3835d06ffbe6d30c994c55b329d
4
+ data.tar.gz: 3b11bb8f4e3ffcc50c35a1c989821643d1cc8d42
5
5
  SHA512:
6
- metadata.gz: 556d32d1a6b2965db653703aea0a2e02914fc526f80e3a392ceb3bef66374912961b6ab82f7275903e4272fe2aab774d38e123c4b5dbfdc68370fdd69961f474
7
- data.tar.gz: 9abeeb2287f2ec6626068d4ec89dc185d21cc8bf1d83c66ef29d7ec067439836a3b3c2e6226928fe8746a44369b348a9418cc9d9f9d43cc5b24f9910a5ce3c0a
6
+ metadata.gz: 771553f411e57c0ac8032dd8526b50045d4e62cbd1e3103567e965121c80c00932c08b574515a3ece951174250e56a71ea254705ae81fac193e5890ac9bdd3b9
7
+ data.tar.gz: 0237e1a52e4636a920564469cb2c92a8564f41553f99deded950fef1fa2ce99171ed1573beb34c9b2a86967419fe3da812989b5ccc7487b762b5514be05fc483
@@ -1,10 +1,10 @@
1
1
  my_experiment:
2
- - condition_b
3
- - condition_c
2
+ condition_b: 1
3
+ condition_c: 1
4
4
 
5
5
  another_experiment:
6
- - foo
7
- - bar
6
+ foo: 1
7
+ bar: 1
8
8
 
9
9
  third_experiment:
10
- - boo
10
+ boo: 1
@@ -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 ||= YAML.load(
25
- ERB.new(File.read(File.join(Rails.root, 'config', 'ab_panel.yml'))).result)
26
- .symbolize_keys
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
@@ -1,3 +1,3 @@
1
1
  module AbPanel
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -2,18 +2,34 @@ require 'spec_helper'
2
2
 
3
3
  describe AbPanel::Config do
4
4
  let(:config) { AbPanel::Config.new }
5
- before do
6
- AbPanel::Config.any_instance.stub(:settings) { { exp1: { scenario1: 25, scenario2: 75 } } }
7
- end
5
+ context "config" do
6
+ before do
7
+ AbPanel::Config.any_instance.stub(:settings) { { exp1: { scenario1: 25, scenario2: 75 } } }
8
+ end
8
9
 
9
- describe '.experiments' do
10
- subject { config.experiments }
11
- it { should =~ [:exp1] }
12
- end
10
+ describe '.experiments' do
11
+ subject { config.experiments }
12
+ it { should =~ [:exp1] }
13
+ end
13
14
 
14
- describe '.weights' do
15
- subject { config.weights('exp1') }
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
- it { should =~ [75.0, 25.0] }
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.0
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-03-18 00:00:00.000000000 Z
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
- - ".gitignore"
123
- - ".travis.yml"
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.2.0
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.