split 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b5af227a83e5e86e548a867ee1fd5b0f99a8f735
4
- data.tar.gz: 187fa1e271f499f25d12fd2b212194f51443e53c
2
+ SHA256:
3
+ metadata.gz: 1d316599c60ca79cff957c25c44d5901c0c2a86c3631e516b07aeac5afc720d3
4
+ data.tar.gz: 004f09975e36482ab4a56b7bd63fd9d703f067a26d9e9fd99e0a80b6cc2853b5
5
5
  SHA512:
6
- metadata.gz: 808297b3e08a2fe1bd1bb0fabd81544f8c82d8e3c22f514f4966d2b8b4cf8c3d06f3a972d3e70461da3ee04c03f6e693a4d79a7710d884519ee45da524f43ca0
7
- data.tar.gz: 3e5ecc4dfd26bd80750ee3ca268428d0e11a6497c3195d62ae4d067b3d227a9624e5d1d31b0c8b06305265f3b583b30c6221c65c692fe9d609b33eefe2f0859a
6
+ metadata.gz: 9001316e86f2e91289523c51097b67dac319ee1cd9a6b27e6f323496258824afe8921fcc306a7ecdc8787406b64f6c8eaa49febf06069afe9532f42218baf8f9
7
+ data.tar.gz: 51b13b3950580e2b446cf688f651632ed2135dec37168e9681e9cf46623ce9707ab8db2b947ca0d1711d0a49d64e1721d4d58ba09b9f5c3fab62ef6f747f5c8f
@@ -14,6 +14,7 @@ gemfile:
14
14
  - gemfiles/5.0.gemfile
15
15
  - gemfiles/5.1.gemfile
16
16
  - gemfiles/5.2.gemfile
17
+ - gemfiles/6.0.gemfile
17
18
 
18
19
 
19
20
  matrix:
@@ -24,25 +25,36 @@ matrix:
24
25
  gemfile: gemfiles/5.1.gemfile
25
26
  - rvm: 1.9.3
26
27
  gemfile: gemfiles/5.2.gemfile
28
+ - rvm: 1.9.3
29
+ gemfile: gemfiles/6.0.gemfile
27
30
  - rvm: 2.0
28
31
  gemfile: gemfiles/5.0.gemfile
29
32
  - rvm: 2.0
30
33
  gemfile: gemfiles/5.1.gemfile
31
34
  - rvm: 2.0
32
35
  gemfile: gemfiles/5.2.gemfile
36
+ - rvm: 2.0
37
+ gemfile: gemfiles/6.0.gemfile
33
38
  - rvm: 2.1.10
34
39
  gemfile: gemfiles/5.0.gemfile
35
40
  - rvm: 2.1.10
36
41
  gemfile: gemfiles/5.1.gemfile
37
42
  - rvm: 2.1.10
38
43
  gemfile: gemfiles/5.2.gemfile
44
+ - rvm: 2.1.10
45
+ gemfile: gemfiles/6.0.gemfile
39
46
  - rvm: 2.2.0
40
47
  gemfile: gemfiles/5.0.gemfile
41
48
  - rvm: 2.2.0
42
49
  gemfile: gemfiles/5.1.gemfile
43
50
  - rvm: 2.2.0
44
51
  gemfile: gemfiles/5.2.gemfile
45
-
52
+ - rvm: 2.2.0
53
+ gemfile: gemfiles/6.0.gemfile
54
+ - rvm: 2.2.2
55
+ gemfile: gemfiles/6.0.gemfile
56
+ - rvm: 2.4.5
57
+ gemfile: gemfiles/6.0.gemfile
46
58
 
47
59
  before_install:
48
60
  - gem install bundler --version=1.17.3
data/Appraisals CHANGED
@@ -13,3 +13,7 @@ end
13
13
  appraise "5.2" do
14
14
  gem "rails", "~> 5.2"
15
15
  end
16
+
17
+ appraise "6.0" do
18
+ gem 'rails', '~> 6.0.0.beta3'
19
+ end
@@ -1,11 +1,33 @@
1
+ ## 3.3.2 (April 12th, 2019)
2
+
3
+ Features:
4
+ - Added uptime robot to configuration.rb (@razel1982, #556)
5
+ - Check to see if being run in Rails application and run in before_initialize (@husteadrobert, #555)
6
+
7
+ Bugfixes:
8
+ - Fix error message interpolation (@hanibash, #553)
9
+ - Fix Bigdecimal warnings (@agraves, #551)
10
+ - Avoid hitting up on redis for robots/excluded users. (@andrehjr, #544)
11
+ - Checks for defined?(request) on Helper#exclude_visitor?. (@andrehjr)
12
+
13
+ Misc:
14
+ - Update travis to add Rails 6 (@edmilton, #559)
15
+ - Fix broken specs in developement environment (@dougpetronilio, #557)
16
+
1
17
  ## 3.3.1 (January 11th, 2019)
18
+
19
+ Features:
2
20
  - Filter some more bots (@janosch-x, #542)
21
+
22
+ Bugfixes:
3
23
  - Fix Dashboard Pagination Helper typo (@cattekin, #541)
4
- - Tweak RSpec instructions (@eliotsykes, #540)
5
24
  - Do not storage alternative in cookie if experiment has a winner (@sadhu89, #539)
6
- - Improve README regarding rspec usage (@vermaxik, #538)
7
25
  - fix user participating alternative not found (@NaturalHokke, #536)
8
26
 
27
+ Misc:
28
+ - Tweak RSpec instructions (@eliotsykes, #540)
29
+ - Improve README regarding rspec usage (@vermaxik, #538)
30
+
9
31
  ## 3.3.0 (August 13th, 2018)
10
32
 
11
33
  Features:
data/README.md CHANGED
@@ -950,4 +950,4 @@ Please note that this project is released with a [Contributor Code of Conduct](C
950
950
 
951
951
  ## Copyright
952
952
 
953
- [MIT License](LICENSE) © 2018 [Andrew Nesbitt](https://github.com/andrew).
953
+ [MIT License](LICENSE) © 2019 [Andrew Nesbitt](https://github.com/andrew).
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "codeclimate-test-reporter"
7
+ gem "rails", "~> 6.0.0.beta3"
8
+
9
+ gemspec path: "../"
@@ -66,4 +66,11 @@ module Split
66
66
  end
67
67
  end
68
68
 
69
- Split.configure {}
69
+ # Check to see if being run in a Rails application. If so, wait until before_initialize to run configuration so Gems that create ENV variables have the chance to initialize first.
70
+ if defined?(::Rails)
71
+ class Railtie < Rails::Railtie
72
+ config.before_initialize { Split.configure {} }
73
+ end
74
+ else
75
+ Split.configure {}
76
+ end
@@ -3,7 +3,7 @@ module Split
3
3
  module CombinedExperimentsHelper
4
4
  def ab_combined_test(metric_descriptor, control = nil, *alternatives)
5
5
  return nil unless experiment = find_combined_experiment(metric_descriptor)
6
- raise(Split::InvalidExperimentsFormatError, 'Unable to find experiment #{metric_descriptor} in configuration') if experiment[:combined_experiments].nil?
6
+ raise(Split::InvalidExperimentsFormatError, "Unable to find experiment #{metric_descriptor} in configuration") if experiment[:combined_experiments].nil?
7
7
 
8
8
  alternative = nil
9
9
  weighted_alternatives = nil
@@ -98,6 +98,7 @@ module Split
98
98
  'Panopta' => 'Monitoring service',
99
99
  'Pingdom' => 'Pingdom monitoring',
100
100
  'SiteUptime' => 'Site monitoring services',
101
+ 'UptimeRobot' => 'Monitoring service',
101
102
 
102
103
  # ???
103
104
  'DigitalPersona Fingerprint Software' => 'HP Fingerprint scanner',
@@ -19,9 +19,9 @@ module Split
19
19
 
20
20
  def round(number, precision = 2)
21
21
  begin
22
- BigDecimal.new(number.to_s)
22
+ BigDecimal(number.to_s)
23
23
  rescue ArgumentError
24
- BigDecimal.new(0)
24
+ BigDecimal(0)
25
25
  end.round(precision).to_f
26
26
  end
27
27
 
@@ -8,7 +8,7 @@ module Split
8
8
  def ab_test(metric_descriptor, control = nil, *alternatives)
9
9
  begin
10
10
  experiment = ExperimentCatalog.find_or_initialize(metric_descriptor, control, *alternatives)
11
- alternative = if Split.configuration.enabled
11
+ alternative = if Split.configuration.enabled && !exclude_visitor?
12
12
  experiment.save
13
13
  raise(Split::InvalidExperimentsFormatError) unless (Split.configuration.experiments || {}).fetch(experiment.name.to_sym, {})[:combined_experiments].nil?
14
14
  trial = Trial.new(:user => ab_user, :experiment => experiment,
@@ -122,7 +122,7 @@ module Split
122
122
  end
123
123
 
124
124
  def exclude_visitor?
125
- instance_exec(request, &Split.configuration.ignore_filter) || is_ignored_ip_address? || is_robot? || is_preview?
125
+ defined?(request) && (instance_exec(request, &Split.configuration.ignore_filter) || is_ignored_ip_address? || is_robot? || is_preview?)
126
126
  end
127
127
 
128
128
  def is_robot?
@@ -2,6 +2,6 @@
2
2
  module Split
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
@@ -564,6 +564,11 @@ describe Split::Helper do
564
564
  expect(alternative).to eq experiment.control.name
565
565
  end
566
566
 
567
+ it 'should not create a experiment' do
568
+ ab_test('link_color', 'blue', 'red')
569
+ expect(Split::Experiment.new('link_color')).to be_a_new_record
570
+ end
571
+
567
572
  it "should not increment the participation count" do
568
573
 
569
574
  previous_red_count = Split::Alternative.new('red', 'link_color').participant_count
@@ -41,4 +41,5 @@ Gem::Specification.new do |s|
41
41
  s.add_development_dependency 'rspec', '~> 3.7'
42
42
  s.add_development_dependency 'pry', '~> 0.10'
43
43
  s.add_development_dependency 'fakeredis', '~> 0.7'
44
+ s.add_development_dependency 'rails', '>= 4.2'
44
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: split
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2019-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.7'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rails
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '4.2'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '4.2'
153
167
  description:
154
168
  email:
155
169
  - andrewnez@gmail.com
@@ -176,6 +190,7 @@ files:
176
190
  - gemfiles/5.0.gemfile
177
191
  - gemfiles/5.1.gemfile
178
192
  - gemfiles/5.2.gemfile
193
+ - gemfiles/6.0.gemfile
179
194
  - lib/split.rb
180
195
  - lib/split/algorithms/block_randomization.rb
181
196
  - lib/split/algorithms/weighted_sample.rb
@@ -270,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
285
  version: 2.0.0
271
286
  requirements: []
272
287
  rubyforge_project: split
273
- rubygems_version: 2.6.14.3
288
+ rubygems_version: 2.7.6
274
289
  signing_key:
275
290
  specification_version: 4
276
291
  summary: Rack based split testing framework