split 3.3.2 → 4.0.0.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc +1 -1
  3. data/.github/FUNDING.yml +1 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +24 -0
  5. data/.github/dependabot.yml +7 -0
  6. data/.github/workflows/ci.yml +61 -0
  7. data/.rspec +1 -0
  8. data/.rubocop.yml +71 -1044
  9. data/.rubocop_todo.yml +226 -0
  10. data/Appraisals +1 -1
  11. data/CHANGELOG.md +62 -0
  12. data/CODE_OF_CONDUCT.md +3 -3
  13. data/Gemfile +2 -0
  14. data/README.md +40 -18
  15. data/Rakefile +2 -0
  16. data/gemfiles/6.0.gemfile +1 -1
  17. data/lib/split/algorithms/block_randomization.rb +2 -0
  18. data/lib/split/algorithms/weighted_sample.rb +2 -1
  19. data/lib/split/algorithms/whiplash.rb +3 -2
  20. data/lib/split/alternative.rb +4 -3
  21. data/lib/split/cache.rb +28 -0
  22. data/lib/split/combined_experiments_helper.rb +2 -1
  23. data/lib/split/configuration.rb +13 -14
  24. data/lib/split/dashboard/helpers.rb +1 -0
  25. data/lib/split/dashboard/pagination_helpers.rb +3 -3
  26. data/lib/split/dashboard/paginator.rb +1 -0
  27. data/lib/split/dashboard/public/dashboard.js +10 -0
  28. data/lib/split/dashboard/public/style.css +5 -0
  29. data/lib/split/dashboard/views/_controls.erb +13 -0
  30. data/lib/split/dashboard/views/layout.erb +1 -1
  31. data/lib/split/dashboard.rb +19 -1
  32. data/lib/split/encapsulated_helper.rb +3 -2
  33. data/lib/split/engine.rb +7 -4
  34. data/lib/split/exceptions.rb +1 -0
  35. data/lib/split/experiment.rb +98 -65
  36. data/lib/split/experiment_catalog.rb +1 -3
  37. data/lib/split/extensions/string.rb +1 -0
  38. data/lib/split/goals_collection.rb +2 -0
  39. data/lib/split/helper.rb +28 -8
  40. data/lib/split/metric.rb +2 -1
  41. data/lib/split/persistence/cookie_adapter.rb +6 -1
  42. data/lib/split/persistence/dual_adapter.rb +54 -12
  43. data/lib/split/persistence/redis_adapter.rb +5 -0
  44. data/lib/split/persistence/session_adapter.rb +1 -0
  45. data/lib/split/persistence.rb +4 -2
  46. data/lib/split/redis_interface.rb +9 -28
  47. data/lib/split/trial.rb +21 -11
  48. data/lib/split/user.rb +20 -4
  49. data/lib/split/version.rb +2 -4
  50. data/lib/split/zscore.rb +1 -0
  51. data/lib/split.rb +9 -3
  52. data/spec/alternative_spec.rb +1 -1
  53. data/spec/cache_spec.rb +88 -0
  54. data/spec/configuration_spec.rb +17 -15
  55. data/spec/dashboard/pagination_helpers_spec.rb +3 -1
  56. data/spec/dashboard_helpers_spec.rb +2 -2
  57. data/spec/dashboard_spec.rb +78 -17
  58. data/spec/encapsulated_helper_spec.rb +2 -2
  59. data/spec/experiment_spec.rb +116 -12
  60. data/spec/goals_collection_spec.rb +1 -1
  61. data/spec/helper_spec.rb +186 -112
  62. data/spec/persistence/cookie_adapter_spec.rb +1 -1
  63. data/spec/persistence/dual_adapter_spec.rb +160 -68
  64. data/spec/persistence/redis_adapter_spec.rb +9 -0
  65. data/spec/redis_interface_spec.rb +0 -69
  66. data/spec/spec_helper.rb +5 -6
  67. data/spec/trial_spec.rb +45 -19
  68. data/spec/user_spec.rb +45 -3
  69. data/split.gemspec +8 -9
  70. metadata +28 -36
  71. data/.travis.yml +0 -66
  72. data/gemfiles/4.2.gemfile +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d316599c60ca79cff957c25c44d5901c0c2a86c3631e516b07aeac5afc720d3
4
- data.tar.gz: 004f09975e36482ab4a56b7bd63fd9d703f067a26d9e9fd99e0a80b6cc2853b5
3
+ metadata.gz: 8bc6c9cfc3470eb28463fe0d286124b8ad89132e458963cfea9035f82d2dc484
4
+ data.tar.gz: 5cacccff1115b056ecafcea231ea27fff5d564ee9630b4279d8ce1fa5d8282ca
5
5
  SHA512:
6
- metadata.gz: 9001316e86f2e91289523c51097b67dac319ee1cd9a6b27e6f323496258824afe8921fcc306a7ecdc8787406b64f6c8eaa49febf06069afe9532f42218baf8f9
7
- data.tar.gz: 51b13b3950580e2b446cf688f651632ed2135dec37168e9681e9cf46623ce9707ab8db2b947ca0d1711d0a49d64e1721d4d58ba09b9f5c3fab62ef6f747f5c8f
6
+ metadata.gz: bca228077d8dbecf7e06f21f411070effcc520c64d09b055c41fea4da7d786bedb81dbdd4f389a20f9166e08d9abf26ff75ea60bd1daf43c2555f5621adbb1e0
7
+ data.tar.gz: ad2aca522d8d7f7bad54ee256c8626dd7747ae6c65aaf6da40d0de4c56d78f2bddd34af4c22be9d9fc943538446e523bf1f6ae7bf43e59505eddd350507b168d
data/.eslintrc CHANGED
@@ -9,7 +9,7 @@ env:
9
9
  jquery: true
10
10
  node: true
11
11
 
12
- # http://eslint.org/docs/rules/
12
+ # https://eslint.org/docs/rules/
13
13
  rules:
14
14
  # Possible Errors
15
15
  comma-dangle: [2, never]
@@ -0,0 +1 @@
1
+ open_collective: split
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: andrehjr
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Additional context**
24
+ Add any other context about the problem here.
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
@@ -0,0 +1,61 @@
1
+ name: split
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ test:
7
+ strategy:
8
+ matrix:
9
+ include:
10
+ - gemfile: 5.2.gemfile
11
+ ruby: 2.5
12
+
13
+ - gemfile: 5.2.gemfile
14
+ ruby: 2.6
15
+
16
+ - gemfile: 5.2.gemfile
17
+ ruby: 2.7
18
+
19
+ - gemfile: 6.0.gemfile
20
+ ruby: 2.5
21
+
22
+ - gemfile: 6.0.gemfile
23
+ ruby: 2.6
24
+
25
+ - gemfile: 6.0.gemfile
26
+ ruby: 2.7
27
+
28
+ - gemfile: 6.0.gemfile
29
+ ruby: '3.0'
30
+
31
+ runs-on: ubuntu-latest
32
+
33
+ services:
34
+ redis:
35
+ image: redis
36
+ ports: ['6379:6379']
37
+ options: >-
38
+ --health-cmd "redis-cli ping"
39
+ --health-interval 10s
40
+ --health-timeout 5s
41
+ --health-retries 5
42
+
43
+ steps:
44
+ - uses: actions/checkout@v2
45
+
46
+ - uses: ruby/setup-ruby@v1
47
+ with:
48
+ ruby-version: ${{ matrix.ruby }}
49
+
50
+ - name: Install dependencies
51
+ run: |
52
+ bundle config set gemfile "${GITHUB_WORKSPACE}/gemfiles/${{ matrix.gemfile }}"
53
+ bundle install --jobs 4 --retry 3
54
+
55
+ - name: Display Ruby version
56
+ run: ruby -v
57
+
58
+ - name: Test
59
+ run: bundle exec rspec
60
+ env:
61
+ REDIS_URL: redis:6379
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --profile