unleash 6.0.9 → 6.0.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ec95dfcbd69db765eeffd84ea41bab4376726f4d882d7f700ba4045ba264282
4
- data.tar.gz: 68f847b9bb15e3e396ecf17d2d2486e5bb5ec1db87e094495bf6cef600a6b58a
3
+ metadata.gz: 5a23662fb04c5a20dc6e463557eb69b6de11fcc1366517e8e29f58197b1bcc06
4
+ data.tar.gz: c49a8688177f6cf8b1c5bac670eeb7ea99b2c3722d483cf6c7e497ece05d38bc
5
5
  SHA512:
6
- metadata.gz: 15ff22dc3211ac161f568031d53b0b51a24b159938319b98ba51892c252641b2076ded1899c401b41823c07ebd6a96e8919948379a12cc3c1f9872d75ab14982
7
- data.tar.gz: fd708746986658bf90bc8678152ae99b51c644c3d464aeb0b6097e95bcc0a6880d7bdb09008465e2cf5898b7dfe0e2c35f7ea335abd18ba211853fe0b1bba608
6
+ metadata.gz: 36055d7ac9511cb35a299350ae80f094c97f3fe8121699bda8f94142383af27442bf89b232c745e9b86074770dd9f235d361479974b6f62bae9b4ea2fe421af2
7
+ data.tar.gz: 5b18ad9294bdd8d037ee40effe51ccb49599aadcdf9659b113bb4fb01ee922a6483af155ecf6a6c25ebb9c63783aabfbc95fb0011673f65554a04f35343ea3a9
data/CHANGELOG.md CHANGED
@@ -13,6 +13,10 @@ Note: These changes are not considered notable:
13
13
 
14
14
  ## [Unreleased]
15
15
 
16
+ ## [6.0.10] - 2024-12-19
17
+ ### Fixed
18
+ - Fixed an edge case issue where the client was failing to send metrics after 10 minutes of not having metrics (#219)
19
+
16
20
  ## [6.0.9] - 2024-11-21
17
21
  ### Fixed
18
22
  - Fixed an issue where the server not sending the encoding would break file saving (#215)
data/README.md CHANGED
@@ -25,7 +25,7 @@ Ruby client for the [Unleash](https://github.com/Unleash/unleash) feature manage
25
25
  Add this line to your application's Gemfile:
26
26
 
27
27
  ```ruby
28
- gem 'unleash', '~> 6.0.7'
28
+ gem 'unleash', '~> 6.0.10'
29
29
  ```
30
30
 
31
31
  And then execute:
@@ -534,7 +534,7 @@ end
534
534
  ## Development
535
535
 
536
536
  After checking out the repo, run `bin/setup` to install dependencies.
537
- Then, run `rake spec` to run the tests.
537
+ Then, run `bundle exec rake spec` to run the tests.
538
538
  You can also run `bin/console` for an interactive prompt that will allow you to experiment.
539
539
 
540
540
  This SDK is also built against the Unleash Client Specification tests.
@@ -542,7 +542,7 @@ To run the Ruby SDK against this test suite, you'll need to have a copy on your
542
542
 
543
543
  `git clone --branch v$(ruby echo_client_spec_version.rb) https://github.com/Unleash/client-specification.git`
544
544
 
545
- After doing this, `rake spec` will also run the client specification tests.
545
+ After doing this, `bundle exec rake spec` will also run the client specification tests.
546
546
 
547
547
  To install this gem onto your local machine, run `bundle exec rake install`.
548
548
 
@@ -15,7 +15,6 @@ module Unleash
15
15
 
16
16
  def generate_report
17
17
  metrics = Unleash&.engine&.get_metrics()
18
- return nil if metrics.nil? || metrics.empty?
19
18
 
20
19
  {
21
20
  'platformName': RUBY_ENGINE,
@@ -24,21 +23,21 @@ module Unleash
24
23
  'specVersion': Unleash::CLIENT_SPECIFICATION_VERSION,
25
24
  'appName': Unleash.configuration.app_name,
26
25
  'instanceId': Unleash.configuration.instance_id,
27
- 'bucket': metrics
26
+ 'bucket': metrics || {}
28
27
  }
29
28
  end
30
29
 
31
30
  def post
32
31
  Unleash.logger.debug "post() Report"
33
32
 
34
- bucket = self.generate_report
35
- if bucket.nil? && (Time.now - self.last_time < LONGEST_WITHOUT_A_REPORT) # and last time is less then 10 minutes...
36
- Unleash.logger.debug "Report not posted to server, as it would have been empty. (and has been empty for up to 10 min)"
33
+ report = self.generate_report
37
34
 
35
+ if report[:bucket].empty? && (Time.now - self.last_time < LONGEST_WITHOUT_A_REPORT) # and last time is less then 10 minutes...
36
+ Unleash.logger.debug "Report not posted to server, as it would have been empty. (and has been empty for up to 10 min)"
38
37
  return
39
38
  end
40
39
 
41
- response = Unleash::Util::Http.post(Unleash.configuration.client_metrics_uri, bucket.to_json)
40
+ response = Unleash::Util::Http.post(Unleash.configuration.client_metrics_uri, report.to_json)
42
41
 
43
42
  if ['200', '202'].include? response.code
44
43
  Unleash.logger.debug "Report sent to unleash server successfully. Server responded with http code #{response.code}"
@@ -1,3 +1,3 @@
1
1
  module Unleash
2
- VERSION = "6.0.9".freeze
2
+ VERSION = "6.0.10".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unleash
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.9
4
+ version: 6.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renato Arruda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-21 00:00:00.000000000 Z
11
+ date: 2024-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yggdrasil-engine
@@ -188,7 +188,7 @@ homepage: https://github.com/unleash/unleash-client-ruby
188
188
  licenses:
189
189
  - Apache-2.0
190
190
  metadata: {}
191
- post_install_message:
191
+ post_install_message:
192
192
  rdoc_options: []
193
193
  require_paths:
194
194
  - lib
@@ -203,8 +203,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  requirements: []
206
- rubygems_version: 3.5.6
207
- signing_key:
206
+ rubygems_version: 3.4.20
207
+ signing_key:
208
208
  specification_version: 4
209
209
  summary: Unleash feature toggle client.
210
210
  test_files: []