splitclient-rb 7.0.1.pre.rc4 → 7.0.1.pre.rc5

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
  SHA256:
3
- metadata.gz: e594bbd6140417bdce0b99925f46e3db09af26b945280c5e34917eac89edac19
4
- data.tar.gz: 8ce2b999204052796d33ee1416a2ffb7637616eaaf6becf14b46520f5e542e8d
3
+ metadata.gz: 658d0bbc6308b32fb7432b958144cb041be47ffd219edfdf9bf92250dca22546
4
+ data.tar.gz: 8b7cc0f067fa4b8845f818e913e4f52608b1555a54008f19102365a9a98d4629
5
5
  SHA512:
6
- metadata.gz: 8e96d61588f39684609ca7d1252e91b389c64f0c91d532987c7123e2eeb86ab1e769dfdaa4cf104eff2d94803fa75e5e908548e544142a961290c7d856e5f548
7
- data.tar.gz: ec1a1fa45062c25caf15236a8d703df730c030239826cbf766b4c8722b6f0e455e94012af5856564d7a33ba767a52b6749e60274939bac3ccdce9fa62d379abb
6
+ metadata.gz: 85131f1907f74de0a04f80523e056e4740722a537c3651c87a966a14e9abf8392fd5f08fde237d02d04f7c33174614d2854c36a917ca889cfa3bafe1e647fed0
7
+ data.tar.gz: 8f5d2395597f11e3732711591a0c6eacbd9bbc055c5591ab607dd7c4bfd91da9ffb080d667b48f1ebaf3f59cacd984bbf8502b0b934c0061e54e1c0296ab83ea
data/.travis.yml CHANGED
@@ -6,6 +6,15 @@ rvm:
6
6
  services:
7
7
  - redis-server
8
8
 
9
+ addons:
10
+ sonarqube: true
11
+
12
+ git:
13
+ depth: false
14
+
9
15
  before_install:
10
16
  - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
11
17
  - gem install bundler -v '< 2'
18
+
19
+ after_success:
20
+ - bash sonar-scanner.sh
data/CHANGES.txt CHANGED
@@ -1,4 +1,4 @@
1
- 7.0.1 (Oct 25, 2019)
1
+ 7.0.1 (Oct 31, 2019)
2
2
  - Updated localhost mode so that parsing of test files results in JSON data for splits analogous to that returned by the Split backend.
3
3
  - Resulting localhost data is now used indifferently from actual backend data by the SDK code.
4
4
  - Removed specific spare code dealing with localhost operations.
@@ -30,9 +30,12 @@ module SplitIoClient
30
30
  req.headers = common_headers(api_key)
31
31
  .merge('Content-Type' => 'application/json')
32
32
  .merge(headers)
33
-
34
- req.headers = req.headers.merge('SplitSDKMachineIP' => @config.machine_ip) unless @config.machine_ip.empty?
35
- req.headers = req.headers.merge('SplitSDKMachineName' => @config.machine_name) unless @config.machine_name.empty?
33
+
34
+ machine_ip = @config.machine_ip
35
+ machine_name = @config.machine_name
36
+
37
+ req.headers = req.headers.merge('SplitSDKMachineIP' => machine_ip) unless machine_ip.empty? || machine_ip == 'unknown'
38
+ req.headers = req.headers.merge('SplitSDKMachineName' => machine_name) unless machine_name.empty? || machine_name == 'unknown'
36
39
 
37
40
  req.body = data.to_json
38
41
 
@@ -511,10 +511,10 @@ module SplitIoClient
511
511
  # gets the ip where the sdk gem is running
512
512
  #
513
513
  # @return [string]
514
- def self.machine_ip(ip_addresses_enabled, machine_ip, adapter)
514
+ def self.machine_ip(ip_addresses_enabled, ip, adapter)
515
515
  if ip_addresses_enabled
516
- begin
517
- return machine_ip unless machine_ip.blank?
516
+ begin
517
+ return ip unless ip.nil? || ip.to_s.empty?
518
518
 
519
519
  loopback_ip = Socket.ip_address_list.find { |ip| ip.ipv4_loopback? }
520
520
  private_ip = Socket.ip_address_list.find { |ip| ip.ipv4_private? }
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '7.0.1.pre.rc4'
2
+ VERSION = '7.0.1.pre.rc5'
3
3
  end
data/sonar-scanner.sh ADDED
@@ -0,0 +1,42 @@
1
+ #/bin/bash -e
2
+
3
+ sonar_scanner() {
4
+ local params=$@
5
+
6
+ sonar-scanner \
7
+ -Dsonar.host.url='https://sonarqube.split-internal.com' \
8
+ -Dsonar.login="$SONAR_TOKEN" \
9
+ -Dsonar.ws.timeout='300' \
10
+ -Dsonar.sources='lib' \
11
+ -Dsonar.projectName='ruby-client' \
12
+ -Dsonar.projectKey='ruby-client' \
13
+ -Dsonar.ruby.coverage.reportPaths='coverage/.resultset.json' \
14
+ -Dsonar.links.ci='https://travis-ci.com/splitio/ruby-client' \
15
+ -Dsonar.links.scm='https://github.com/splitio/ruby-client' \
16
+ ${params}
17
+
18
+ return $?
19
+ }
20
+
21
+ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
22
+ sonar_scanner \
23
+ -Dsonar.pullrequest.provider='GitHub' \
24
+ -Dsonar.pullrequest.github.repository='splitio/ruby-client' \
25
+ -Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST \
26
+ -Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH \
27
+ -Dsonar.pullrequest.base=$TRAVIS_BRANCH
28
+ else
29
+ if [ "$TRAVIS_BRANCH" == 'master' ]; then
30
+ sonar_scanner \
31
+ -Dsonar.branch.name=$TRAVIS_BRANCH
32
+ else
33
+ if [ "$TRAVIS_BRANCH" == 'development' ]; then
34
+ TARGET_BRANCH='master'
35
+ else
36
+ TARGET_BRANCH='development'
37
+ fi
38
+ sonar_scanner \
39
+ -Dsonar.branch.name=$TRAVIS_BRANCH \
40
+ -Dsonar.branch.target=$TARGET_BRANCH
41
+ fi
42
+ fi
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.0.1.pre.rc4
4
+ version: 7.0.1.pre.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-29 00:00:00.000000000 Z
11
+ date: 2019-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: allocation_stats
@@ -387,6 +387,7 @@ files:
387
387
  - lib/splitclient-rb/utilitites.rb
388
388
  - lib/splitclient-rb/validators.rb
389
389
  - lib/splitclient-rb/version.rb
390
+ - sonar-scanner.sh
390
391
  - splitclient-rb.gemspec
391
392
  - tasks/benchmark_get_treatment.rake
392
393
  - tasks/irb.rake