split 3.0.0 → 4.0.1

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 (82) hide show
  1. checksums.yaml +5 -5
  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 +71 -0
  7. data/.rspec +1 -0
  8. data/.rubocop.yml +71 -1044
  9. data/.rubocop_todo.yml +226 -0
  10. data/Appraisals +12 -1
  11. data/CHANGELOG.md +157 -0
  12. data/CODE_OF_CONDUCT.md +3 -3
  13. data/CONTRIBUTING.md +54 -5
  14. data/Gemfile +2 -0
  15. data/LICENSE +1 -1
  16. data/README.md +232 -121
  17. data/Rakefile +2 -0
  18. data/gemfiles/5.0.gemfile +1 -2
  19. data/gemfiles/{4.2.gemfile → 5.1.gemfile} +2 -2
  20. data/gemfiles/5.2.gemfile +9 -0
  21. data/gemfiles/6.0.gemfile +9 -0
  22. data/gemfiles/6.1.gemfile +9 -0
  23. data/gemfiles/7.0.gemfile +9 -0
  24. data/lib/split/algorithms/block_randomization.rb +2 -0
  25. data/lib/split/algorithms/weighted_sample.rb +2 -1
  26. data/lib/split/algorithms/whiplash.rb +3 -2
  27. data/lib/split/alternative.rb +7 -3
  28. data/lib/split/cache.rb +28 -0
  29. data/lib/split/combined_experiments_helper.rb +38 -0
  30. data/lib/split/configuration.rb +24 -13
  31. data/lib/split/dashboard/helpers.rb +3 -2
  32. data/lib/split/dashboard/pagination_helpers.rb +87 -0
  33. data/lib/split/dashboard/paginator.rb +17 -0
  34. data/lib/split/dashboard/public/dashboard.js +10 -0
  35. data/lib/split/dashboard/public/style.css +14 -0
  36. data/lib/split/dashboard/views/_controls.erb +13 -0
  37. data/lib/split/dashboard/views/index.erb +5 -1
  38. data/lib/split/dashboard/views/layout.erb +1 -1
  39. data/lib/split/dashboard.rb +21 -1
  40. data/lib/split/encapsulated_helper.rb +3 -2
  41. data/lib/split/engine.rb +7 -2
  42. data/lib/split/exceptions.rb +1 -0
  43. data/lib/split/experiment.rb +103 -69
  44. data/lib/split/experiment_catalog.rb +1 -3
  45. data/lib/split/extensions/string.rb +1 -0
  46. data/lib/split/goals_collection.rb +2 -0
  47. data/lib/split/helper.rb +42 -9
  48. data/lib/split/metric.rb +2 -1
  49. data/lib/split/persistence/cookie_adapter.rb +58 -15
  50. data/lib/split/persistence/dual_adapter.rb +54 -12
  51. data/lib/split/persistence/redis_adapter.rb +5 -0
  52. data/lib/split/persistence/session_adapter.rb +1 -0
  53. data/lib/split/persistence.rb +4 -2
  54. data/lib/split/redis_interface.rb +9 -30
  55. data/lib/split/trial.rb +25 -17
  56. data/lib/split/user.rb +20 -4
  57. data/lib/split/version.rb +2 -4
  58. data/lib/split/zscore.rb +1 -0
  59. data/lib/split.rb +17 -3
  60. data/spec/alternative_spec.rb +13 -1
  61. data/spec/cache_spec.rb +88 -0
  62. data/spec/combined_experiments_helper_spec.rb +57 -0
  63. data/spec/configuration_spec.rb +17 -15
  64. data/spec/dashboard/pagination_helpers_spec.rb +200 -0
  65. data/spec/dashboard/paginator_spec.rb +37 -0
  66. data/spec/dashboard_helpers_spec.rb +2 -2
  67. data/spec/dashboard_spec.rb +78 -17
  68. data/spec/encapsulated_helper_spec.rb +2 -2
  69. data/spec/experiment_spec.rb +117 -13
  70. data/spec/goals_collection_spec.rb +1 -1
  71. data/spec/helper_spec.rb +211 -112
  72. data/spec/persistence/cookie_adapter_spec.rb +90 -23
  73. data/spec/persistence/dual_adapter_spec.rb +160 -68
  74. data/spec/persistence/redis_adapter_spec.rb +9 -0
  75. data/spec/redis_interface_spec.rb +0 -69
  76. data/spec/spec_helper.rb +5 -6
  77. data/spec/split_spec.rb +7 -7
  78. data/spec/trial_spec.rb +65 -19
  79. data/spec/user_spec.rb +45 -3
  80. data/split.gemspec +20 -10
  81. metadata +61 -35
  82. data/.travis.yml +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b0a3a695f8950186c2af7c9fd33b4201f785656a
4
- data.tar.gz: f24adb5a893e0cac0cbf29c06ec86d9ae692c1a2
2
+ SHA256:
3
+ metadata.gz: c6b66f4b21c4201228d9622d5e00ff2a2e957714edfce11316316a2ca3e405ce
4
+ data.tar.gz: 6a441cf39a14ef9e36b805e7728f34029db7f7d1e1e90f3389168942b7b77f60
5
5
  SHA512:
6
- metadata.gz: 41138ef7911a9843cbc3fa81f78b28184087dacfff4d291d820ae32faf343fce0a9552f4d0123d647751ceadf8c1f242d44bd7e476e50a69165a49b13e422e27
7
- data.tar.gz: c8cfabeb28e143872e7c81f5d3e4dd28f2cb9c8d274f21a31481eaa52725eed06876ef6959ad44aacb84c47f064c84953d2edffd4767951774011037aff28e96
6
+ metadata.gz: bc46df4b6f301b8bdaf99ba4648f7363ad2c1234b3be7586e078b9772fec9a2bae3c9e15335c0c207e88c45113a1348a0dcd608a9dcfee654846753ba59c6696
7
+ data.tar.gz: 53dffc60d0f0617f1a1e943170f7702eff6ec5d00381b9d3b19380ef50aaef4c76956974a94a645bfb288eddd75486f24c2c2d3c56e7465f85f68791f1aeda31
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,71 @@
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
+ - gemfile: 6.1.gemfile
32
+ ruby: '3.0'
33
+
34
+ - gemfile: 7.0.gemfile
35
+ ruby: '3.0'
36
+
37
+ # - gemfile: 7.0.gemfile
38
+ # ruby: '3.1'
39
+
40
+
41
+ runs-on: ubuntu-latest
42
+
43
+ services:
44
+ redis:
45
+ image: redis
46
+ ports: ['6379:6379']
47
+ options: >-
48
+ --health-cmd "redis-cli ping"
49
+ --health-interval 10s
50
+ --health-timeout 5s
51
+ --health-retries 5
52
+
53
+ steps:
54
+ - uses: actions/checkout@v2
55
+
56
+ - uses: ruby/setup-ruby@v1
57
+ with:
58
+ ruby-version: ${{ matrix.ruby }}
59
+
60
+ - name: Install dependencies
61
+ run: |
62
+ bundle config set gemfile "${GITHUB_WORKSPACE}/gemfiles/${{ matrix.gemfile }}"
63
+ bundle install --jobs 4 --retry 3
64
+
65
+ - name: Display Ruby version
66
+ run: ruby -v
67
+
68
+ - name: Test
69
+ run: bundle exec rspec
70
+ env:
71
+ REDIS_URL: redis:6379
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --profile