splitclient-rb 7.3.5.pre.rc5-java → 8.0.0.pre.rc1-java

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: 977dd4ad2b5e91d089796e2cc452f18dd1865465
4
- data.tar.gz: dba8da2b6f8e25bd670f40588a6c8ce004ac2719
3
+ metadata.gz: 3361d3010afe34c3f431e3acea95c91dacf6a835
4
+ data.tar.gz: 13e9c1f8f7b32a9769ab474934c34c844636fbff
5
5
  SHA512:
6
- metadata.gz: 5b874e277d8ed4f803591238f130b1f16b885909f480f97aaf4f007f189d6699ddef901105a622784c9d6a17f18b418db1f284834d4c4367b28e133bc73b1fb3
7
- data.tar.gz: 9e955a69fa2d695d65a3b8131c84e413e87ffffb66e927573a85954691f953c36eb6f0149fe772174ec7d0944c35271198d3c3d627b3173fcae0adab32c652f4
6
+ metadata.gz: 4f0d7bc586a3452dceeadad1aa70f662ff789ff6c8fdfeb879772dd8e92a1d37f7c81d78eb78ce27dfdb6d57a25f1daed9556c790733f7d8423f6e606cfdd6b5
7
+ data.tar.gz: 3fe42c3ebfaf805648381194f882d063a2b02027c21d428ada11eee2eb5273a8f97b632cb024b4d645d28a358dc60c25d8fa3cd5af88f1c452168c889d5d3783
@@ -1,10 +1,4 @@
1
- on:
2
- push:
3
- branches:
4
- - do-not-send-impressions
5
- pull_request:
6
- branches:
7
- - do-not-send-impressions
1
+ on: [push, pull_request]
8
2
 
9
3
  jobs:
10
4
  test:
data/.rubocop.yml CHANGED
@@ -52,7 +52,7 @@ Naming/FileName:
52
52
  - splitclient-rb.gemspec
53
53
 
54
54
  AllCops:
55
- TargetRubyVersion: 2.3.6
55
+ TargetRubyVersion: 2.5
56
56
  Exclude:
57
57
  - gemfiles/* # excluded as appraisal generates them with errors
58
58
  - lib/*
data/Rakefile CHANGED
@@ -3,7 +3,6 @@
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
5
  require 'rubocop/rake_task'
6
- require 'appraisal'
7
6
 
8
7
  Dir['tasks/**/*.rake'].each { |rake| load rake }
9
8
 
@@ -26,10 +25,4 @@ else
26
25
  end
27
26
  end
28
27
 
29
- if !ENV['APPRAISAL_INITIALIZED']
30
- task :default do
31
- sh 'appraisal install && rake appraisal && rake rubocop'
32
- end
33
- else
34
- task default: %i[spec rubocop]
35
- end
28
+ task default: %i[spec rubocop]
@@ -31,9 +31,9 @@ module SplitIoClient
31
31
  def uniques_formatter(uniques)
32
32
  return if uniques.nil? || uniques.empty?
33
33
 
34
- to_return = { mtks: [] }
34
+ to_return = { keys: [] }
35
35
  uniques.each do |key, value|
36
- to_return[:mtks] << {
36
+ to_return[:keys] << {
37
37
  f: key,
38
38
  ks: value.to_a
39
39
  }
@@ -29,8 +29,6 @@ module SplitIoClient
29
29
  impressions_count.each do |key, value|
30
30
  pipeline.hincrby(impressions_count_key, key, value)
31
31
  end
32
-
33
- @future = pipeline.hlen(impressions_count_key)
34
32
  end
35
33
 
36
34
  expire_impressions_count_key(impressions_count, result)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'net/http/persistent'
4
-
5
3
  module SplitIoClient
6
4
  module Api
7
5
  class Client
@@ -54,33 +52,12 @@ module SplitIoClient
54
52
  private
55
53
 
56
54
  def api_client
57
- if needs_patched_net_http_persistent_adapter?
58
- require 'splitclient-rb/engine/api/faraday_adapter/patched_net_http_persistent'
59
-
60
- Faraday::Adapter.register_middleware(
61
- net_http_persistent: SplitIoClient::FaradayAdapter::PatchedNetHttpPersistent
62
- )
63
- end
64
-
65
55
  @api_client ||= Faraday.new do |builder|
66
56
  builder.use SplitIoClient::FaradayMiddleware::Gzip
67
57
  builder.adapter :net_http_persistent
68
58
  end
69
59
  end
70
60
 
71
- def needs_patched_net_http_persistent_adapter?
72
- new_net_http_persistent? && incompatible_faraday_version?
73
- end
74
-
75
- def incompatible_faraday_version?
76
- version = Faraday::VERSION.split('.')[0..1]
77
- version[0].to_i == 0 && version[1].to_i < 13
78
- end
79
-
80
- def new_net_http_persistent?
81
- Net::HTTP::Persistent::VERSION.split('.').first.to_i >= 3
82
- end
83
-
84
61
  def common_headers(api_key)
85
62
  {
86
63
  'Authorization' => "Bearer #{api_key}",
@@ -18,9 +18,9 @@ module SplitIoClient
18
18
  end
19
19
 
20
20
  def record_unique_keys(uniques)
21
- return if uniques[:mtks].empty?
21
+ return if uniques[:keys].empty?
22
22
 
23
- post_telemetry("#{@config.telemetry_service_url}/mtks/ss", uniques, 'mtks')
23
+ post_telemetry("#{@config.telemetry_service_url}/keys/ss", uniques, 'unique_keys')
24
24
  rescue StandardError => e
25
25
  @config.log_found_exception(__method__.to_s, e)
26
26
  end
@@ -41,17 +41,20 @@ module SplitIoClient
41
41
  private
42
42
 
43
43
  def schedule_next_token_refresh(time)
44
- @config.threads[:schedule_next_token_refresh] = Thread.new do
45
- begin
46
- @config.logger.debug("schedule_next_token_refresh refresh in #{time} seconds.") if @config.debug_enabled
47
- sleep(time)
48
- @config.logger.debug('schedule_next_token_refresh starting ...') if @config.debug_enabled
49
- @sse_handler.stop
50
- start_sse
51
- rescue StandardError => e
52
- @config.logger.debug("schedule_next_token_refresh error: #{e.inspect}") if @config.debug_enabled
53
- end
54
- end
44
+ @config.threads[:schedule_next_token_refresh] = Thread.new { refresh_token_task(time) }
45
+ end
46
+
47
+ def refresh_token_task(time)
48
+ @config.logger.debug("schedule_next_token_refresh refresh in #{time} seconds.") if @config.debug_enabled
49
+
50
+ sleep(time)
51
+
52
+ @config.logger.debug('schedule_next_token_refresh starting ...') if @config.debug_enabled
53
+ @sse_handler.stop
54
+
55
+ start_sse
56
+ rescue StandardError => e
57
+ @config.logger.debug("schedule_next_token_refresh error: #{e.inspect}") if @config.debug_enabled
55
58
  end
56
59
 
57
60
  def record_telemetry(time)
@@ -30,7 +30,7 @@ module SplitIoClient
30
30
  private
31
31
 
32
32
  def config_key
33
- "#{@config.redis_namespace}.telemetry.config"
33
+ "#{@config.redis_namespace}.telemetry.init"
34
34
  end
35
35
  end
36
36
  end
@@ -15,21 +15,21 @@ module SplitIoClient
15
15
  private
16
16
 
17
17
  def stats_thread
18
- @config.threads[:telemetry_stats_sender] = Thread.new do
19
- begin
20
- @config.logger.info('Starting Telemetry Sync Task')
18
+ @config.threads[:telemetry_stats_sender] = Thread.new { telemetry_sync_task }
19
+ end
21
20
 
22
- loop do
23
- sleep(@config.telemetry_refresh_rate)
21
+ def telemetry_sync_task
22
+ @config.logger.info('Starting Telemetry Sync Task')
24
23
 
25
- @telemetry_synchronizer.synchronize_stats
26
- end
27
- rescue SplitIoClient::SDKShutdownException
28
- @telemetry_synchronizer.synchronize_stats
24
+ loop do
25
+ sleep(@config.telemetry_refresh_rate)
29
26
 
30
- @config.logger.info('Posting Telemetry due to shutdown')
31
- end
27
+ @telemetry_synchronizer.synchronize_stats
32
28
  end
29
+ rescue SplitIoClient::SDKShutdownException
30
+ @telemetry_synchronizer.synchronize_stats
31
+
32
+ @config.logger.info('Posting Telemetry due to shutdown')
33
33
  end
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '7.3.5.pre.rc5'
2
+ VERSION = '8.0.0.pre.rc1'
3
3
  end
@@ -49,7 +49,6 @@ require 'splitclient-rb/validators'
49
49
  require 'splitclient-rb/split_factory_registry'
50
50
 
51
51
  require 'splitclient-rb/engine/api/faraday_middleware/gzip'
52
- require 'splitclient-rb/engine/api/faraday_adapter/patched_net_http_persistent'
53
52
  require 'splitclient-rb/engine/api/client'
54
53
  require 'splitclient-rb/engine/api/impressions'
55
54
  require 'splitclient-rb/engine/api/segments'
@@ -8,16 +8,15 @@ Gem::Specification.new do |spec|
8
8
  spec.name = 'splitclient-rb'
9
9
  spec.version = SplitIoClient::VERSION
10
10
  spec.authors = ['Split Software']
11
- spec.email = ['pato@split.io']
12
-
11
+ spec.email = ['mauro.sanz@split.io']
13
12
  spec.summary = 'Ruby client for split SDK.'
14
13
  spec.description = 'Ruby client for using split SDK.'
15
14
  spec.homepage = 'https://github.com/splitio/ruby-client'
16
15
  spec.license = 'Apache-2.0'
17
16
 
18
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|features|ext)/}) }
19
-
20
18
  spec.require_paths = ['lib']
19
+ spec.required_ruby_version = '>= 2.5.0'
21
20
 
22
21
  if defined?(JRUBY_VERSION)
23
22
  spec.platform = 'java'
@@ -37,7 +36,6 @@ Gem::Specification.new do |spec|
37
36
  end
38
37
 
39
38
  spec.add_development_dependency 'allocation_stats', '~> 0.1'
40
- spec.add_development_dependency 'appraisal', '~> 2.4'
41
39
  spec.add_development_dependency 'bundler', '~> 2.2'
42
40
  spec.add_development_dependency 'pry', '~> 0.14'
43
41
  spec.add_development_dependency 'pry-nav', '~> 1.0'
@@ -53,7 +51,7 @@ Gem::Specification.new do |spec|
53
51
 
54
52
  spec.add_runtime_dependency 'bitarray', '~> 1.3'
55
53
  spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
56
- spec.add_runtime_dependency 'faraday', '>= 0.8', '< 2.0'
54
+ spec.add_runtime_dependency 'faraday', '>= 1.1', '< 2.0'
57
55
  spec.add_runtime_dependency 'json', '>= 1.8', '< 3.0'
58
56
  spec.add_runtime_dependency 'jwt', '>= 1.0.0', '< 3.0'
59
57
  spec.add_runtime_dependency 'lru_redux', '~> 1.1'
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: 7.3.5.pre.rc5
4
+ version: 8.0.0.pre.rc1
5
5
  platform: java
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-20 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.1'
27
- - !ruby/object:Gem::Dependency
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '2.4'
33
- name: appraisal
34
- prerelease: false
35
- type: :development
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.4'
41
27
  - !ruby/object:Gem::Dependency
42
28
  requirement: !ruby/object:Gem::Requirement
43
29
  requirements:
@@ -239,7 +225,7 @@ dependencies:
239
225
  requirements:
240
226
  - - ">="
241
227
  - !ruby/object:Gem::Version
242
- version: '0.8'
228
+ version: '1.1'
243
229
  - - "<"
244
230
  - !ruby/object:Gem::Version
245
231
  version: '2.0'
@@ -250,7 +236,7 @@ dependencies:
250
236
  requirements:
251
237
  - - ">="
252
238
  - !ruby/object:Gem::Version
253
- version: '0.8'
239
+ version: '1.1'
254
240
  - - "<"
255
241
  - !ruby/object:Gem::Version
256
242
  version: '2.0'
@@ -384,7 +370,7 @@ dependencies:
384
370
  version: '0.3'
385
371
  description: Ruby client for using split SDK.
386
372
  email:
387
- - pato@split.io
373
+ - mauro.sanz@split.io
388
374
  executables: []
389
375
  extensions: []
390
376
  extra_rdoc_files: []
@@ -395,7 +381,6 @@ files:
395
381
  - ".gitignore"
396
382
  - ".rubocop.yml"
397
383
  - ".simplecov"
398
- - Appraisals
399
384
  - CHANGES.txt
400
385
  - CONTRIBUTORS-GUIDE.md
401
386
  - Gemfile
@@ -446,7 +431,6 @@ files:
446
431
  - lib/splitclient-rb/constants.rb
447
432
  - lib/splitclient-rb/engine/api/client.rb
448
433
  - lib/splitclient-rb/engine/api/events.rb
449
- - lib/splitclient-rb/engine/api/faraday_adapter/patched_net_http_persistent.rb
450
434
  - lib/splitclient-rb/engine/api/faraday_middleware/gzip.rb
451
435
  - lib/splitclient-rb/engine/api/impressions.rb
452
436
  - lib/splitclient-rb/engine/api/segments.rb
@@ -549,7 +533,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
549
533
  requirements:
550
534
  - - ">="
551
535
  - !ruby/object:Gem::Version
552
- version: '0'
536
+ version: 2.5.0
553
537
  required_rubygems_version: !ruby/object:Gem::Requirement
554
538
  requirements:
555
539
  - - ">"
data/Appraisals DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- appraise 'faraday-before-0.13' do
4
- gem 'faraday', '>= 0.9', '< 0.13'
5
- gem 'net-http-persistent', '~> 3.0'
6
- end
7
-
8
- appraise 'faraday-after-0.13' do
9
- gem 'faraday', '> 0.13'
10
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SplitIoClient
4
- module FaradayAdapter
5
- class PatchedNetHttpPersistent < Faraday::Adapter::NetHttpPersistent
6
- ##
7
- # Borrowed directly from the latest `NetHttpPersistent` adapter implementation.
8
- #
9
- # https://github.com/lostisland/faraday/blob/master/lib/faraday/adapter/net_http_persistent.rb
10
- #
11
- def net_http_connection(env)
12
- @cached_connection ||=
13
- if Net::HTTP::Persistent.instance_method(:initialize).parameters.first == [:key, :name]
14
- Net::HTTP::Persistent.new(name: 'Faraday')
15
- else
16
- Net::HTTP::Persistent.new('Faraday')
17
- end
18
-
19
- proxy_uri = proxy_uri(env)
20
- @cached_connection.proxy = proxy_uri if @cached_connection.proxy_uri != proxy_uri
21
- @cached_connection
22
- end
23
-
24
- def proxy_uri(env)
25
- proxy_uri = nil
26
- if (proxy = env[:request][:proxy])
27
- proxy_uri = ::URI::HTTP === proxy[:uri] ? proxy[:uri].dup : ::URI.parse(proxy[:uri].to_s)
28
- proxy_uri.user = proxy_uri.password = nil
29
- # awful patch for net-http-persistent 2.8 not unescaping user/password
30
- (
31
- class << proxy_uri;
32
- self;
33
- end).class_eval do
34
- define_method(:user) { proxy[:user] }
35
- define_method(:password) { proxy[:password] }
36
- end if proxy[:user]
37
- end
38
- proxy_uri
39
- end
40
-
41
- def with_net_http_connection(env)
42
- yield net_http_connection(env)
43
- end
44
- end
45
- end
46
- end