vanity 2.2.10 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +55 -0
- data/Appraisals +24 -20
- data/CHANGELOG +19 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +23 -15
- data/README.md +14 -16
- data/gemfiles/rails42.gemfile +6 -6
- data/gemfiles/rails42.gemfile.lock +95 -86
- data/gemfiles/rails42_protected_attributes.gemfile +6 -6
- data/gemfiles/rails42_protected_attributes.gemfile.lock +90 -81
- data/gemfiles/{rails5.gemfile → rails51.gemfile} +6 -6
- data/gemfiles/rails51.gemfile.lock +285 -0
- data/gemfiles/{rails41.gemfile → rails52.gemfile} +6 -6
- data/gemfiles/rails52.gemfile.lock +295 -0
- data/gemfiles/{rails32.gemfile → rails60.gemfile} +6 -9
- data/gemfiles/rails60.gemfile.lock +293 -0
- data/gemfiles/rails61.gemfile +33 -0
- data/gemfiles/rails61.gemfile.lock +293 -0
- data/lib/generators/templates/{add_participants_unique_index_migration.rb → add_participants_unique_index_migration.rb.erb} +1 -1
- data/lib/generators/templates/{add_unique_indexes_migration.rb → add_unique_indexes_migration.rb.erb} +1 -1
- data/lib/generators/templates/{vanity_migration.rb → vanity_migration.rb.erb} +1 -1
- data/lib/generators/vanity/migration_generator.rb +34 -0
- data/lib/vanity/adapters/active_record_adapter.rb +1 -1
- data/lib/vanity/adapters/redis_adapter.rb +20 -20
- data/lib/vanity/commands/report.rb +4 -3
- data/lib/vanity/configuration.rb +4 -0
- data/lib/vanity/experiment/ab_test.rb +16 -11
- data/lib/vanity/frameworks/rails.rb +20 -9
- data/lib/vanity/locales/vanity.ru.yml +50 -0
- data/lib/vanity/templates/_experiment.erb +3 -3
- data/lib/vanity/templates/_experiments.erb +1 -1
- data/lib/vanity/templates/_metrics.erb +1 -1
- data/lib/vanity/templates/_report.erb +2 -2
- data/lib/vanity/version.rb +1 -1
- data/test/adapters/redis_adapter_test.rb +8 -12
- data/test/adapters/shared_tests.rb +7 -6
- data/test/commands/report_test.rb +13 -1
- data/test/configuration_test.rb +15 -2
- data/test/dummy/app/mailers/vanity_mailer.rb +3 -1
- data/test/dummy/config/initializers/secret_token.rb +5 -2
- data/test/dummy/config/routes.rb +17 -3
- data/test/experiment/ab_test.rb +43 -3
- data/test/frameworks/rails/action_controller_test.rb +12 -6
- data/test/frameworks/rails/action_mailer_test.rb +0 -1
- data/test/metric/active_record_test.rb +8 -2
- data/test/playground_test.rb +0 -1
- data/test/test_helper.rb +57 -10
- data/test/web/rails/dashboard_test.rb +19 -10
- data/vanity.gemspec +1 -1
- metadata +20 -21
- data/.travis.yml +0 -33
- data/gemfiles/rails32.gemfile.lock +0 -242
- data/gemfiles/rails41.gemfile.lock +0 -230
- data/gemfiles/rails5.gemfile.lock +0 -256
- data/lib/generators/vanity/add_participants_unique_index_generator.rb +0 -15
- data/lib/generators/vanity/add_unique_indexes_generator.rb +0 -15
- data/lib/generators/vanity_generator.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c54611b7ef436ec37192b30fa8451ab592b7117df14f3d3937747484b8b9a299
|
4
|
+
data.tar.gz: 7601b961767d868205a68bf02f5a44447c01f01083f5d53d4a8d7ab242c0f0fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60f112ca86a32c938d762699cfc40e24ccb662294ac4059ff12035af6785a3ed294f56ffb2c99c1519bb254fab438062f39cd7b62b87f6df452180066c3d515a
|
7
|
+
data.tar.gz: 382f2fc0afcc52d375594d2586bb41a46f7bc6f3812d242de725cf9828bbb4c82938daf1e8a29e61ddcdfa82844433f8d5d9dec05d5c960d4a01c4eccf8de203
|
@@ -0,0 +1,55 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- master
|
6
|
+
pull_request:
|
7
|
+
branches: '*'
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
name: Test
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
timeout-minutes: 15
|
14
|
+
services:
|
15
|
+
redis:
|
16
|
+
image: redis
|
17
|
+
ports:
|
18
|
+
- 6379:6379
|
19
|
+
mongo:
|
20
|
+
image: mongo
|
21
|
+
ports:
|
22
|
+
- 27017:27017
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby:
|
26
|
+
- 2.5
|
27
|
+
# - jruby-9.2.20.1
|
28
|
+
db:
|
29
|
+
- mongodb
|
30
|
+
- redis
|
31
|
+
- active_record
|
32
|
+
gemfile:
|
33
|
+
- gemfiles/rails42.gemfile
|
34
|
+
- gemfiles/rails42_protected_attributes.gemfile
|
35
|
+
- gemfiles/rails51.gemfile
|
36
|
+
- gemfiles/rails52.gemfile
|
37
|
+
- gemfiles/rails60.gemfile
|
38
|
+
- gemfiles/rails61.gemfile
|
39
|
+
exclude:
|
40
|
+
- ruby: jruby-9.1.13.0
|
41
|
+
gemfile: gemfiles/rails5.gemfile
|
42
|
+
env:
|
43
|
+
DB: ${{ matrix.db }}
|
44
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
45
|
+
steps:
|
46
|
+
- name: Checkout code
|
47
|
+
uses: actions/checkout@v2
|
48
|
+
|
49
|
+
- name: Set up Ruby
|
50
|
+
uses: ruby/setup-ruby@v1
|
51
|
+
with:
|
52
|
+
ruby-version: ${{ matrix.ruby }}
|
53
|
+
bundler-cache: true
|
54
|
+
- name: Run Tests
|
55
|
+
run: bundle exec rake test
|
data/Appraisals
CHANGED
@@ -1,38 +1,42 @@
|
|
1
|
-
appraise "
|
1
|
+
appraise "rails42" do
|
2
2
|
gem "mocha", "~> 1.0", :require=>false
|
3
|
-
gem "
|
4
|
-
gem "
|
5
|
-
gem "minitest_tu_shim", "~> 1.3.3", :platforms => :mri_22
|
6
|
-
gem "fastthread", :git => "git://github.com/zoltankiss/fastthread.git", :platforms => :mri_20
|
3
|
+
gem "rails", "4.2.9"
|
4
|
+
gem "fastthread", :github => "zoltankiss/fastthread", :platforms => :mri_20
|
7
5
|
gem "passenger", "~>3.0"
|
8
|
-
gem "test-unit", "~> 3.0"
|
9
6
|
end
|
10
7
|
|
11
|
-
appraise "
|
8
|
+
appraise "rails42-protected_attributes" do
|
9
|
+
gem "protected_attributes", "1.1.0"
|
12
10
|
gem "mocha", "~> 1.0", :require=>false
|
13
|
-
gem "rails", "4.
|
14
|
-
gem "fastthread", :
|
11
|
+
gem "rails", "4.2.9"
|
12
|
+
gem "fastthread", :github => "zoltankiss/fastthread", :platforms => :mri_20
|
15
13
|
gem "passenger", "~>3.0"
|
16
14
|
end
|
17
15
|
|
18
|
-
appraise "
|
16
|
+
appraise "rails51" do
|
19
17
|
gem "mocha", "~> 1.0", :require=>false
|
20
|
-
gem "rails", "
|
21
|
-
gem "fastthread", :
|
18
|
+
gem "rails", "~>5.1.0"
|
19
|
+
gem "fastthread", :github => "zoltankiss/fastthread", :platforms => :mri_20
|
22
20
|
gem "passenger", "~>3.0"
|
23
21
|
end
|
24
22
|
|
25
|
-
appraise "
|
26
|
-
gem "protected_attributes", "1.1.0"
|
23
|
+
appraise "rails52" do
|
27
24
|
gem "mocha", "~> 1.0", :require=>false
|
28
|
-
gem "rails", "
|
29
|
-
gem "fastthread", :
|
25
|
+
gem "rails", "~>5.2.0"
|
26
|
+
gem "fastthread", :github => "zoltankiss/fastthread", :platforms => :mri_20
|
30
27
|
gem "passenger", "~>3.0"
|
31
28
|
end
|
32
29
|
|
33
|
-
appraise "
|
30
|
+
appraise "rails60" do
|
34
31
|
gem "mocha", "~> 1.0", :require=>false
|
35
|
-
gem "rails", "5.
|
36
|
-
gem "fastthread", :
|
32
|
+
gem "rails", "~>5.2.0"
|
33
|
+
gem "fastthread", :github => "zoltankiss/fastthread", :platforms => :mri_20
|
37
34
|
gem "passenger", "~>3.0"
|
38
|
-
end
|
35
|
+
end
|
36
|
+
|
37
|
+
appraise "rails61" do
|
38
|
+
gem "mocha", "~> 1.0", :require=>false
|
39
|
+
gem "rails", "~>5.2.0"
|
40
|
+
gem "fastthread", :github => "zoltankiss/fastthread", :platforms => :mri_20
|
41
|
+
gem "passenger", "~>3.0"
|
42
|
+
end
|
data/CHANGELOG
CHANGED
@@ -1,4 +1,22 @@
|
|
1
|
-
==
|
1
|
+
== 3.1.0 (2022-01-29)
|
2
|
+
|
3
|
+
* Invoke on_assignment callback after assignment is stored in database; add global on_assignment callback (@frostmark)
|
4
|
+
|
5
|
+
== 3.0.2 (2022-01-27)
|
6
|
+
|
7
|
+
* Fix AbTest#alternative_for to always prefer persisted participants (@tgrathwell)
|
8
|
+
|
9
|
+
== 3.0.1 (2022-01-26)
|
10
|
+
|
11
|
+
* Update template rendering and update_attributes for Rails 6.1 compatibility (@bensheldon)
|
12
|
+
|
13
|
+
== 3.0.0 (2018-11-02)
|
14
|
+
|
15
|
+
* Fully destroy experiments using the Redis adapter (@urbanautomaton)
|
16
|
+
* Fix support for rails 5.1, 5.2 migrations (@phillbaker)
|
17
|
+
* Support for redis 4 (#334) (@askehansen)
|
18
|
+
* Drop support for redis-rb <= 3.2.0 (@phillbaker)
|
19
|
+
* Drop support for rails 2, test recent rubies (@phillbaker)
|
2
20
|
|
3
21
|
== 2.2.10 (2018-03-18)
|
4
22
|
|
data/Gemfile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
2
3
|
|
3
4
|
# "development" gems in gemspec are required for testing, gems in the
|
4
5
|
# development group here are for documentation
|
@@ -8,7 +9,7 @@ gemspec development_group: :test
|
|
8
9
|
gem "rack"
|
9
10
|
|
10
11
|
# Persistence
|
11
|
-
gem "redis", ">= 2.1"
|
12
|
+
gem "redis", ">= 3.2.1"
|
12
13
|
gem "redis-namespace", ">= 1.1.0"
|
13
14
|
gem "mongo", "~> 2.1"
|
14
15
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vanity (
|
4
|
+
vanity (3.1.0)
|
5
5
|
i18n
|
6
6
|
|
7
7
|
GEM
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
activerecord (>= 2.2)
|
16
16
|
activesupport (2.3.14)
|
17
17
|
addressable (2.2.7)
|
18
|
-
appraisal (
|
18
|
+
appraisal (2.4.1)
|
19
19
|
bundler
|
20
20
|
rake
|
21
21
|
thor (>= 0.14.0)
|
@@ -32,17 +32,18 @@ GEM
|
|
32
32
|
execjs
|
33
33
|
coffee-script-source (1.9.1)
|
34
34
|
colorator (0.1)
|
35
|
-
concurrent-ruby (1.
|
35
|
+
concurrent-ruby (1.1.9)
|
36
36
|
crack (0.3.1)
|
37
37
|
execjs (2.5.2)
|
38
38
|
fakefs (0.6.7)
|
39
39
|
fast-stemmer (1.0.2)
|
40
|
-
ffi (1.
|
40
|
+
ffi (1.15.5)
|
41
|
+
ffi (1.15.5-java)
|
41
42
|
garb (0.9.1)
|
42
43
|
activesupport (>= 2.2.0)
|
43
44
|
crack (>= 0.1.6)
|
44
45
|
hitimes (1.2.2)
|
45
|
-
i18n (
|
46
|
+
i18n (1.9.1)
|
46
47
|
concurrent-ruby (~> 1.0)
|
47
48
|
integration (0.1.0)
|
48
49
|
jdbc-sqlite3 (3.8.7)
|
@@ -87,24 +88,31 @@ GEM
|
|
87
88
|
coderay (~> 1.1.0)
|
88
89
|
method_source (~> 0.8.1)
|
89
90
|
slop (~> 3.4)
|
91
|
+
pry (0.10.3-java)
|
92
|
+
coderay (~> 1.1.0)
|
93
|
+
method_source (~> 0.8.1)
|
94
|
+
slop (~> 3.4)
|
95
|
+
spoon (~> 0.0)
|
90
96
|
pygments.rb (0.6.3)
|
91
97
|
posix-spawn (~> 0.3.6)
|
92
98
|
yajl-ruby (~> 1.2.0)
|
93
99
|
rack (1.1.3)
|
94
|
-
rake (
|
100
|
+
rake (13.0.6)
|
95
101
|
rb-fsevent (0.9.4)
|
96
102
|
rb-inotify (0.9.5)
|
97
103
|
ffi (>= 0.5.0)
|
98
104
|
redcarpet (3.2.3)
|
99
|
-
redis (
|
100
|
-
redis-namespace (1.
|
101
|
-
redis (
|
105
|
+
redis (4.0.3)
|
106
|
+
redis-namespace (1.6.0)
|
107
|
+
redis (>= 3.0.4)
|
102
108
|
rubystats (0.2.5)
|
103
109
|
safe_yaml (1.0.4)
|
104
110
|
sass (3.4.13)
|
105
111
|
slop (3.6.0)
|
112
|
+
spoon (0.0.6)
|
113
|
+
ffi
|
106
114
|
sqlite3 (1.3.10)
|
107
|
-
thor (
|
115
|
+
thor (1.2.1)
|
108
116
|
timecop (0.3.5)
|
109
117
|
timers (4.0.1)
|
110
118
|
hitimes
|
@@ -113,8 +121,8 @@ GEM
|
|
113
121
|
webmock (1.8.0)
|
114
122
|
addressable (>= 2.2.7)
|
115
123
|
crack (>= 0.1.7)
|
116
|
-
yajl-ruby (1.2.
|
117
|
-
yard (0.
|
124
|
+
yajl-ruby (1.2.3)
|
125
|
+
yard (0.9.16)
|
118
126
|
|
119
127
|
PLATFORMS
|
120
128
|
java
|
@@ -123,7 +131,7 @@ PLATFORMS
|
|
123
131
|
DEPENDENCIES
|
124
132
|
RedCloth
|
125
133
|
activerecord-jdbc-adapter
|
126
|
-
appraisal (~>
|
134
|
+
appraisal (~> 2.0)
|
127
135
|
bundler (>= 1.8.0)
|
128
136
|
fakefs
|
129
137
|
garb (< 0.9.2)
|
@@ -135,7 +143,7 @@ DEPENDENCIES
|
|
135
143
|
pry
|
136
144
|
rack
|
137
145
|
rake
|
138
|
-
redis (>= 2.1)
|
146
|
+
redis (>= 3.2.1)
|
139
147
|
redis-namespace (>= 1.1.0)
|
140
148
|
rubystats (>= 0.2.5)
|
141
149
|
sqlite3 (~> 1.3.10)
|
@@ -145,4 +153,4 @@ DEPENDENCIES
|
|
145
153
|
yard
|
146
154
|
|
147
155
|
BUNDLED WITH
|
148
|
-
1.
|
156
|
+
1.17.1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Vanity
|
2
|
-
[![
|
3
|
-
|
2
|
+
[![Test Status](https://github.com/assaf/vanity/workflows/Test/badge.svg)](https://github.com/assaf/vanity/actions)
|
3
|
+
|
4
4
|
|
5
5
|
Vanity is an A/B testing framework for Rails that is datastore agnostic.
|
6
6
|
|
@@ -61,7 +61,7 @@ Datastores should be configured using a `config/vanity.yml`.
|
|
61
61
|
Add to your Gemfile:
|
62
62
|
|
63
63
|
```ruby
|
64
|
-
gem "redis", ">= 2
|
64
|
+
gem "redis", ">= 3.2"
|
65
65
|
gem "redis-namespace", ">= 1.1.0"
|
66
66
|
```
|
67
67
|
|
@@ -139,10 +139,11 @@ test:
|
|
139
139
|
active_record_adapter: default
|
140
140
|
collecting: false
|
141
141
|
production:
|
142
|
+
adapter: active_record
|
142
143
|
active_record_adapter: postgresql
|
143
144
|
<% uri = URI.parse(ENV['DATABASE_URL']) %>
|
144
145
|
host: <%= uri.host %>
|
145
|
-
username: <%= uri.
|
146
|
+
username: <%= uri.user%>
|
146
147
|
password: <%= uri.password %>
|
147
148
|
port: <%= uri.port %>
|
148
149
|
database: <%= uri.path.sub('/', '') %>
|
@@ -379,18 +380,15 @@ your view no participants will be recorded.
|
|
379
380
|
|
380
381
|
Here's what's tested and known to work:
|
381
382
|
|
382
|
-
Ruby 2.1
|
383
|
-
Persistence: Redis, Mongo, ActiveRecord
|
384
|
-
Rails: 3.2, 4.1, 4.2
|
385
|
-
Ruby 2.2
|
386
|
-
Persistence: Redis, Mongo, ActiveRecord
|
387
|
-
Rails: 3.2, 4.1, 4.2, 5
|
388
383
|
Ruby 2.3
|
389
|
-
Persistence: Redis, Mongo, ActiveRecord
|
390
|
-
Rails:
|
391
|
-
|
392
|
-
Persistence: Redis, Mongo, ActiveRecord
|
393
|
-
Rails:
|
384
|
+
Persistence: Redis (redis-rb >= 3.2.1), Mongo, ActiveRecord
|
385
|
+
Rails: 4.1, 4.2, 5
|
386
|
+
Ruby 2.4
|
387
|
+
Persistence: Redis (redis-rb >= 3.2.1), Mongo, ActiveRecord
|
388
|
+
Rails: 4.1, 4.2, 5
|
389
|
+
JRuby 9.1
|
390
|
+
Persistence: Redis (redis-rb >= 3.2.1), Mongo, ActiveRecord
|
391
|
+
Rails: 4.1, 4.2
|
394
392
|
|
395
393
|
## Testing
|
396
394
|
|
@@ -427,7 +425,7 @@ Go ahead and target a pull request against the `gh-pages` branch.
|
|
427
425
|
prepare the test suite to run against multiple versions of Rails
|
428
426
|
* Fix, patch, enhance, document, improve, sprinkle pixie dust
|
429
427
|
* Tests. Please. Run `appraisal rake test`, of if you can, `rake test:all`.
|
430
|
-
(This project uses
|
428
|
+
(This project uses Github Actions where the test suite is run against multiple
|
431
429
|
versions of ruby, rails and backends.)
|
432
430
|
* Send a pull request on GitHub
|
433
431
|
|
data/gemfiles/rails42.gemfile
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "rack"
|
6
|
-
gem "redis", ">= 2.1"
|
6
|
+
gem "redis", ">= 3.2.1"
|
7
7
|
gem "redis-namespace", ">= 1.1.0"
|
8
8
|
gem "mongo", "~> 2.1"
|
9
9
|
gem "integration", "<= 0.1.0"
|
10
10
|
gem "rubystats", ">= 0.2.5"
|
11
|
-
gem "garb", "< 0.9.2", :
|
12
|
-
gem "mocha", "~> 1.0", :
|
13
|
-
gem "rails", "4.2.
|
14
|
-
gem "fastthread", :git
|
11
|
+
gem "garb", "< 0.9.2", require: false
|
12
|
+
gem "mocha", "~> 1.0", require: false
|
13
|
+
gem "rails", "4.2.9"
|
14
|
+
gem "fastthread", platforms: :mri_20, git: "https://github.com/zoltankiss/fastthread.git"
|
15
15
|
gem "passenger", "~>3.0"
|
16
16
|
|
17
17
|
group :development do
|
@@ -30,4 +30,4 @@ platforms :jruby do
|
|
30
30
|
gem "jdbc-sqlite3"
|
31
31
|
end
|
32
32
|
|
33
|
-
gemspec :
|
33
|
+
gemspec development_group: :test, path: "../"
|