experimental 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/experimental/railtie.rb +3 -1
- data/lib/experimental/rspec_helpers.rb +2 -4
- data/lib/experimental/test.rb +4 -0
- data/lib/experimental/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5971835dc6a436120c342849f251fd6833819f07
|
4
|
+
data.tar.gz: 1a0c5fe0f8465ebf62ad31bb1000e32952420488
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a6fd63702f780be58b0c3582d7b66985fcce57643fec71f95df4800396d6c41f485d73a76aa5dc7cd7dad2f0bff60006cf9857a247999ead024326c78215a24
|
7
|
+
data.tar.gz: e7b1b7467c78ccc8fb77ac50c3d2f8551e1fce7887ffa2c56993d378db3784f8031f8b323176ed5c8aa3d7f7ca4019fbdb3fba75b1cee66337a84b59d3bca291
|
data/lib/experimental/railtie.rb
CHANGED
@@ -3,7 +3,9 @@ module Experimental
|
|
3
3
|
initializer "experimental.initialize" do
|
4
4
|
config_path = "#{Rails.root}/config/experimental.yml"
|
5
5
|
if File.exist?(config_path)
|
6
|
-
|
6
|
+
erb = File.read(config_path)
|
7
|
+
yaml = ERB.new(erb).result(TOPLEVEL_BINDING)
|
8
|
+
full = YAML.load(yaml)
|
7
9
|
configuration = full[Rails.env] || {}
|
8
10
|
configuration.update(full.slice('experiments'))
|
9
11
|
Experimental.configure(configuration)
|
@@ -6,8 +6,7 @@ module Experimental
|
|
6
6
|
obj ||= user
|
7
7
|
name ||= experiment_name
|
8
8
|
|
9
|
-
obj.
|
10
|
-
with(name).and_return(val)
|
9
|
+
obj.stub(:in_experiment?).with(name).and_return(val)
|
11
10
|
end
|
12
11
|
|
13
12
|
def is_not_in_experiment(name = nil, obj = nil)
|
@@ -21,8 +20,7 @@ module Experimental
|
|
21
20
|
obj ||= user
|
22
21
|
name ||= experiment_name
|
23
22
|
|
24
|
-
obj.
|
25
|
-
with(name).and_return(bucket)
|
23
|
+
obj.stub(:experiment_bucket).with(name).and_return(bucket)
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
data/lib/experimental/test.rb
CHANGED
@@ -34,5 +34,9 @@ module Experimental
|
|
34
34
|
def set_experimental_bucket(subject, experiment_name, bucket)
|
35
35
|
Experimental.overrides[subject, experiment_name] = bucket
|
36
36
|
end
|
37
|
+
|
38
|
+
autoload :Cucumber, 'experimental/test/cucumber'
|
39
|
+
autoload :RSpec, 'experimental/test/rspec'
|
40
|
+
autoload :Unit, 'experimental/test/unit'
|
37
41
|
end
|
38
42
|
end
|
data/lib/experimental/version.rb
CHANGED
metadata
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: experimental
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HowAboutWe.com
|
8
8
|
- Rebecca Miller-Webster
|
9
9
|
- Bryan Woods
|
10
10
|
- Andrew Watkins
|
11
|
+
- George Ogata
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2014-
|
15
|
+
date: 2014-06-02 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: rails
|
18
19
|
requirement: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
20
|
-
- - "
|
21
|
+
- - "<"
|
21
22
|
- !ruby/object:Gem::Version
|
22
23
|
version: '5.0'
|
23
24
|
type: :runtime
|
24
25
|
prerelease: false
|
25
26
|
version_requirements: !ruby/object:Gem::Requirement
|
26
27
|
requirements:
|
27
|
-
- - "
|
28
|
+
- - "<"
|
28
29
|
- !ruby/object:Gem::Version
|
29
30
|
version: '5.0'
|
30
31
|
- !ruby/object:Gem::Dependency
|
@@ -109,3 +110,4 @@ signing_key:
|
|
109
110
|
specification_version: 4
|
110
111
|
summary: Adds support for database-backed AB tests in Rails apps
|
111
112
|
test_files: []
|
113
|
+
has_rdoc:
|