vinted-ab 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/ab.gemspec +1 -0
- data/lib/ab/assigned_test.rb +5 -1
- data/lib/ab/tests.rb +0 -1
- data/lib/ab/version.rb +1 -1
- data/spec/examples/already_finished/input.json +2 -2
- data/spec/examples/explicit_times/input.json +2 -2
- data/spec/examples/has_not_started/input.json +1 -1
- data/spec/integration_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -1
- data/spec/tests_spec.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6e46f66084e779a1eeca15edf6b3eba928b747b
|
4
|
+
data.tar.gz: 5e47066cb8520292d863b97be976f42c7d93e0fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed4970561d2c2ec748f29ea3d5c378d8b181a1dea026a12d6d7eea4fcaa0d930c5c55283bead185d8d81bb9f35e5a13675d56e4f455397ec58456e431c46310b
|
7
|
+
data.tar.gz: b56781fed1989fe0f536afafbb7dcce815feb0a7bc99c2056bef91a5b15e4af1c5c5000eb6c02ec19277207da6a6493cc42fbf93994fcb48c791362ef106dd39
|
data/README.md
CHANGED
@@ -54,8 +54,8 @@ An example config:
|
|
54
54
|
{
|
55
55
|
"id": 42,
|
56
56
|
"name": "experiment",
|
57
|
-
"start_at": "2014-05-21T11:06:30+
|
58
|
-
"end_at": "2014-05-28T11:06:30+
|
57
|
+
"start_at": "2014-05-21T11:06:30+0300",
|
58
|
+
"end_at": "2014-05-28T11:06:30+0300",
|
59
59
|
"seed": "aaaa1111",
|
60
60
|
"buckets": [1, 2, 3, 4, 5],
|
61
61
|
"variants": [
|
data/ab.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.1', '>= 10.1.0'
|
24
24
|
spec.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.0'
|
25
|
+
spec.add_development_dependency 'rspec-its', '~> 1.0.1'
|
25
26
|
spec.add_development_dependency 'json-schema', '~> 2.2.2', '>= 2.2.2'
|
26
27
|
spec.add_development_dependency 'ruby-prof', '~> 0.15.0', '>= 0.15.0'
|
27
28
|
spec.add_development_dependency 'pry', '~> 0.10.0', '>= 0.10.0'
|
data/lib/ab/assigned_test.rb
CHANGED
@@ -2,7 +2,7 @@ module Ab
|
|
2
2
|
class AssignedTest
|
3
3
|
def initialize(test, id)
|
4
4
|
@test, @id = test, id
|
5
|
-
|
5
|
+
variants.each do |name|
|
6
6
|
define_singleton_method("#{name}?") { name == variant }
|
7
7
|
end
|
8
8
|
end
|
@@ -40,6 +40,10 @@ module Ab
|
|
40
40
|
@test.end_at
|
41
41
|
end
|
42
42
|
|
43
|
+
def variants
|
44
|
+
@test.variants.map(&:name)
|
45
|
+
end
|
46
|
+
|
43
47
|
private
|
44
48
|
|
45
49
|
def part_of_test?
|
data/lib/ab/tests.rb
CHANGED
data/lib/ab/version.rb
CHANGED
@@ -6,8 +6,8 @@
|
|
6
6
|
"id": 2,
|
7
7
|
"name": "already_finished",
|
8
8
|
"seed": "792e3b32a6dd59d3f300b2ac8b4caa09",
|
9
|
-
"start_at": "1605-11-05T00:00:00+
|
10
|
-
"end_at": "2014-02-01T02:15:00+
|
9
|
+
"start_at": "1605-11-05T00:00:00+0100",
|
10
|
+
"end_at": "2014-02-01T02:15:00+0300",
|
11
11
|
"all_buckets": true,
|
12
12
|
"variants": [
|
13
13
|
{
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"id": 5,
|
7
7
|
"name": "explicit_times",
|
8
8
|
"seed": "2a14d8c5a30618799547e428dfa4a807",
|
9
|
-
"start_at": "2013-01-01T00:00:00+
|
10
|
-
"end_at": "2222-02-02T02:02:02+
|
9
|
+
"start_at": "2013-01-01T00:00:00+0000",
|
10
|
+
"end_at": "2222-02-02T02:02:02+0200",
|
11
11
|
"all_buckets": true,
|
12
12
|
"variants": [
|
13
13
|
{
|
data/spec/integration_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe 'ab' do
|
|
11
11
|
|
12
12
|
specify 'validates against schema' do
|
13
13
|
result = JSON::Validator.validate(path_to_schema, input, version: :draft3)
|
14
|
-
result.should
|
14
|
+
result.should be true
|
15
15
|
end
|
16
16
|
|
17
17
|
specify 'correctly assigns variants' do
|
@@ -21,7 +21,7 @@ describe 'ab' do
|
|
21
21
|
cases.each do |id, variant|
|
22
22
|
tests = Ab::Tests.new(input, id)
|
23
23
|
tests.send(output['test']).variant.to_s.should == variant
|
24
|
-
tests.send(output['test']).send("#{variant}?").should
|
24
|
+
tests.send(output['test']).send("#{variant}?").should be true unless variant.empty?
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/tests_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vinted-ab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -65,6 +65,20 @@ dependencies:
|
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: 2.14.0
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rspec-its
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.0.1
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.0.1
|
68
82
|
- !ruby/object:Gem::Dependency
|
69
83
|
name: json-schema
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|