splitclient-rb 4.2.0 → 4.2.1

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
2
  SHA1:
3
- metadata.gz: 81550066a81a8d86d50b4cea93346252fd3e19f6
4
- data.tar.gz: 004ebf8003e161eef3712c4ba68350a732f113d8
3
+ metadata.gz: 74a4925604de05a5e5d9422be5f62b1ec8d66a07
4
+ data.tar.gz: 879a2f9cad369b6dd0f52d6f23f5ebf6fd514475
5
5
  SHA512:
6
- metadata.gz: bc9efa8080b148c9513ada659f842543ed1672e42cd64c1085c1c8a162e31553930509ca43e30a8b12a1ee9c5c434b5ac4347318bdd3cbb15e707071b45d368b
7
- data.tar.gz: 43cfabd292ae2579e976508bc133894c697978f9cd03cc1c344ac1e48670f51b9cf77888e8db99ce1c8b3eb0f6b31061ddb577b550822d6a5905e74a194a6b23
6
+ metadata.gz: 98e87182688107a90fefd26ac3d7d108ba09a99024afd0f3a3620b2fe1f64fabc917da6f1a54d71f5af560c680f1321ae0516ed26d4643e5daa7291ecf41f482
7
+ data.tar.gz: 24af1504410b5075632ffc8e06d1fa2704218438bb91375f01a45d5b564be73ecf44bd66a6ad3cbfb96d8913f53e0b04b5d285fc794396b89e5c223e7f8e28e8
@@ -1,3 +1,6 @@
1
+ 4.2.1 (July 20, 2017)
2
+ - Coerce string to regexp for Regexp matcher
3
+
1
4
  4.2.0 (July 18, 2017)
2
5
  - Add new boolean/regexp matchers
3
6
  - Add support for split dependency on other splits
@@ -424,9 +424,20 @@ Currently SDK supports:
424
424
 
425
425
  Other servers should work fine as well, but haven't been tested.
426
426
 
427
- ### Unicorn
427
+ ### Unicorn and Puma in cluster mode (only for "memory mode")
428
428
 
429
- If you're using Unicorn in the `memory` mode you'll need to include this line in your unicorn config (probably `config/unicorn.rb`):
429
+ During the start of your application SDK spawns multiple threads, each thread has an infinite loop inside which is used to fetch splits/segments or send impressions/metrics.
430
+ Several servers like Unicorn and Puma in cluster mode (i.e. with `workers` > 0) spawn multiple child processes, but when child process is spawn it does not recreate threads, which existed in the parent process, that's why if you use Unicorn or Puma in cluster mode you need to make two small extra steps.
431
+
432
+ For both servers you will need to have the following line in your `config/initializers/splitclient.rb`:
433
+
434
+ ```ruby
435
+ Rails.configuration.split_factory = factory
436
+ ```
437
+
438
+ #### Unicorn
439
+
440
+ If you're using Unicorn you'll need to include this line in your Unicorn config (probably `config/unicorn.rb`):
430
441
 
431
442
  ```ruby
432
443
  after_fork do |server, worker|
@@ -434,12 +445,20 @@ after_fork do |server, worker|
434
445
  end
435
446
  ```
436
447
 
437
- Also, you will need to have the following line in your `config/initializers/splitclient.rb`:
448
+ By doing that SDK will recreate threads for each new worker, besides master.
449
+
450
+ #### Puma
451
+
452
+ For those who use Puma in cluster mode add this to your Puma config (probably `config/puma.rb`):
438
453
 
439
454
  ```ruby
440
- Rails.configuration.split_factory = factory
455
+ on_worker_boot do |worker_number|
456
+ Rails.configuration.split_factory.resume! if worker_number.nr > 0
457
+ end
441
458
  ```
442
459
 
460
+ By doing that SDK will recreate threads for each new worker, besides master.
461
+
443
462
  ## Framework support
444
463
 
445
464
  Currently SDK supports:
@@ -6,18 +6,13 @@ module SplitIoClient
6
6
 
7
7
  def initialize(attribute, regexp_string)
8
8
  @attribute = attribute
9
- @regexp_string = regexp_string
9
+ @regexp_string = @regexp_string.is_a?(Regexp) ? regexp_string : Regexp.new(regexp_string)
10
10
  end
11
11
 
12
12
  def match?(_matching_key, _bucketing_key, _evaluator, data)
13
13
  value = data.fetch(@attribute) { |attr| data[attr.to_s] || data[attr.to_sym] }
14
14
 
15
- if @regexp_string.is_a? Regexp
16
- (value =~ @regexp_string) != nil
17
- else
18
- # String here
19
- value == @regexp_string
20
- end
15
+ (value =~ @regexp_string) != nil
21
16
  end
22
17
  end
23
18
  end
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '4.2.0'
2
+ VERSION = '4.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-19 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler