unleash 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pull_request.yml +6 -3
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +6 -1
- data/README.md +1 -3
- data/echo_client_spec_version.rb +3 -0
- data/lib/unleash/client.rb +5 -1
- data/lib/unleash/configuration.rb +4 -1
- data/lib/unleash/constraint.rb +2 -2
- data/lib/unleash/context.rb +1 -1
- data/lib/unleash/metrics_reporter.rb +4 -0
- data/lib/unleash/version.rb +1 -1
- data/unleash-client.gemspec +3 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d47d4a063a3d6bb76a8a8867882b4cc7bcac17e9f9b3e4c4d7524f1115093e0d
|
4
|
+
data.tar.gz: bdf1d479d9ce09c34afbfc1ecf08aabb9745f8d74256e096b9fdd30f00e455ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a7e91c6016b10445777cf45ec9d914a22467ee0668924e7a960b4779f972436871ba2990a97e6ed7cf9937d285bd6efd07b31b81d05fa01181de84fe507cdb
|
7
|
+
data.tar.gz: c6ed23eac0a4b91c081eeac6b6a7cc0bbf7c54b26782624714d5a010cd50e2c1390c9bbaf0ea37ea120255b72b7a36787003e9761a5b4b98a7e1e7f8c534b5a7
|
@@ -30,14 +30,12 @@ jobs:
|
|
30
30
|
ruby-version:
|
31
31
|
- jruby-9.4
|
32
32
|
- jruby-9.3
|
33
|
-
- jruby-9.2
|
34
33
|
- 3.3
|
35
34
|
- 3.2
|
36
35
|
- 3.1
|
37
36
|
- '3.0'
|
38
37
|
- 2.7
|
39
38
|
- 2.6
|
40
|
-
- 2.5
|
41
39
|
|
42
40
|
needs:
|
43
41
|
- lint
|
@@ -50,8 +48,13 @@ jobs:
|
|
50
48
|
ruby-version: ${{ matrix.ruby-version }}
|
51
49
|
- name: Install dependencies
|
52
50
|
run: bundle install
|
51
|
+
- name: Get test project semver
|
52
|
+
id: get_semver
|
53
|
+
run: |
|
54
|
+
semver=$(ruby echo_client_spec_version.rb)
|
55
|
+
echo "::set-output name=semver::$semver"
|
53
56
|
- name: Download test cases
|
54
|
-
run: git clone --depth 5 --branch
|
57
|
+
run: git clone --depth 5 --branch v${{ steps.get_semver.outputs.semver }} https://github.com/Unleash/client-specification.git client-specification
|
55
58
|
- name: Run tests
|
56
59
|
run: bundle exec rake
|
57
60
|
env:
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -124,7 +124,12 @@ Note: These changes are not considered notable:
|
|
124
124
|
- only send metrics if there is data to send. (#58)
|
125
125
|
- in Client#get_variant() allow context and fallback_variant as nil (#51)
|
126
126
|
|
127
|
-
[unreleased]: https://
|
127
|
+
[unreleased]: https://github.com/unleash/unleash-client-ruby/compare/v5.0.1...HEAD
|
128
|
+
[5.0.1]: https://github.com/unleash/unleash-client-ruby/compare/v5.0.0...v5.0.1
|
129
|
+
[5.0.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.6.0...v5.0.0
|
130
|
+
[4.6.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.5.0...v4.6.0
|
131
|
+
[4.5.0]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.4...v4.5.0
|
132
|
+
[4.4.4]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.3...v4.4.4
|
128
133
|
[4.4.3]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.2...v4.4.3
|
129
134
|
[4.4.2]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.1...v4.4.2
|
130
135
|
[4.4.1]: https://github.com/unleash/unleash-client-ruby/compare/v4.4.0...v4.4.1
|
data/README.md
CHANGED
@@ -16,10 +16,8 @@ Leverage the [Unleash Server](https://github.com/Unleash/unleash) for powerful f
|
|
16
16
|
* MRI 3.0
|
17
17
|
* MRI 2.7
|
18
18
|
* MRI 2.6
|
19
|
-
* MRI 2.5
|
20
19
|
* jruby 9.4
|
21
20
|
* jruby 9.3
|
22
|
-
* jruby 9.2
|
23
21
|
|
24
22
|
## Installation
|
25
23
|
|
@@ -529,7 +527,7 @@ You can also run `bin/console` for an interactive prompt that will allow you to
|
|
529
527
|
This SDK is also built against the Unleash Client Specification tests.
|
530
528
|
To run the Ruby SDK against this test suite, you'll need to have a copy on your machine, you can clone the repository directly using:
|
531
529
|
|
532
|
-
`git clone --
|
530
|
+
`git clone --branch v$(ruby echo_client_spec_version.rb) https://github.com/Unleash/client-specification.git`
|
533
531
|
|
534
532
|
After doing this, `rake spec` will also run the client specification tests.
|
535
533
|
|
data/lib/unleash/client.rb
CHANGED
@@ -119,7 +119,11 @@ module Unleash
|
|
119
119
|
'sdkVersion': "unleash-client-ruby:" + Unleash::VERSION,
|
120
120
|
'strategies': Unleash.strategies.keys,
|
121
121
|
'started': Time.now.iso8601(Unleash::TIME_RESOLUTION),
|
122
|
-
'interval': Unleash.configuration.metrics_interval_in_millis
|
122
|
+
'interval': Unleash.configuration.metrics_interval_in_millis,
|
123
|
+
'platformName': RUBY_ENGINE,
|
124
|
+
'platformVersion': RUBY_VERSION,
|
125
|
+
'yggdrasilVersion': nil,
|
126
|
+
'specVersion': Unleash::CLIENT_SPECIFICATION_VERSION
|
123
127
|
}
|
124
128
|
end
|
125
129
|
|
@@ -3,6 +3,9 @@ require 'tmpdir'
|
|
3
3
|
require 'unleash/bootstrap/configuration'
|
4
4
|
|
5
5
|
module Unleash
|
6
|
+
gemspec = Gem::Specification.load('unleash-client.gemspec')
|
7
|
+
CLIENT_SPECIFICATION_VERSION = gemspec.metadata['client-specification-version'].freeze
|
8
|
+
|
6
9
|
class Configuration
|
7
10
|
attr_accessor \
|
8
11
|
:url,
|
@@ -54,7 +57,7 @@ module Unleash
|
|
54
57
|
'User-Agent' => "UnleashClientRuby/#{Unleash::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION} [#{RUBY_PLATFORM}]",
|
55
58
|
'UNLEASH-INSTANCEID' => self.instance_id,
|
56
59
|
'UNLEASH-APPNAME' => self.app_name,
|
57
|
-
'Unleash-Client-Spec' =>
|
60
|
+
'Unleash-Client-Spec' => CLIENT_SPECIFICATION_VERSION
|
58
61
|
}.merge!(generate_custom_http_headers)
|
59
62
|
end
|
60
63
|
|
data/lib/unleash/constraint.rb
CHANGED
@@ -55,9 +55,9 @@ module Unleash
|
|
55
55
|
|
56
56
|
def self.on_valid_date(val1, val2)
|
57
57
|
val1 = DateTime.parse(val1)
|
58
|
-
val2 = DateTime.parse(val2)
|
58
|
+
val2 = val2.is_a?(DateTime) ? val2 : DateTime.parse(val2)
|
59
59
|
yield(val1, val2)
|
60
|
-
rescue ArgumentError
|
60
|
+
rescue ArgumentError, TypeError
|
61
61
|
Unleash.logger.warn "Unleash::ConstraintMatcher unable to parse either context_value (#{val1}) \
|
62
62
|
or constraint_value (#{val2}) into a date. Returning false!"
|
63
63
|
false
|
data/lib/unleash/context.rb
CHANGED
@@ -20,7 +20,7 @@ module Unleash
|
|
20
20
|
|
21
21
|
def to_s
|
22
22
|
"<Context: user_id=#{@user_id},session_id=#{@session_id},remote_address=#{@remote_address},properties=#{@properties}" \
|
23
|
-
",app_name=#{@app_name},environment=#{@environment}>"
|
23
|
+
",app_name=#{@app_name},environment=#{@environment},current_time=#{@current_time}>"
|
24
24
|
end
|
25
25
|
|
26
26
|
def to_h
|
@@ -24,6 +24,10 @@ module Unleash
|
|
24
24
|
report = {
|
25
25
|
'appName': Unleash.configuration.app_name,
|
26
26
|
'instanceId': Unleash.configuration.instance_id,
|
27
|
+
'platformName': RUBY_ENGINE,
|
28
|
+
'platformVersion': RUBY_VERSION,
|
29
|
+
'yggdrasilVersion': nil,
|
30
|
+
'specVersion': Unleash::CLIENT_SPECIFICATION_VERSION,
|
27
31
|
'bucket': {
|
28
32
|
'start': start.iso8601(Unleash::TIME_RESOLUTION),
|
29
33
|
'stop': stop.iso8601(Unleash::TIME_RESOLUTION),
|
data/lib/unleash/version.rb
CHANGED
data/unleash-client.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.bindir = 'bin'
|
22
22
|
spec.executables = spec.files.grep(%r{^bin/unleash}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
|
-
spec.required_ruby_version = ">= 2.
|
24
|
+
spec.required_ruby_version = ">= 2.6"
|
25
25
|
|
26
26
|
spec.add_dependency "murmurhash3", "~> 0.1.7"
|
27
27
|
|
@@ -31,6 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency "rspec-json_expectations", "~> 2.2"
|
32
32
|
spec.add_development_dependency "webmock", "~> 3.18.1"
|
33
33
|
|
34
|
+
spec.metadata["client-specification-version"] = "5.0.2"
|
35
|
+
|
34
36
|
# rubocop:disable Gemspec/RubyVersionGlobalsUsage, Style/IfUnlessModifier
|
35
37
|
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.0')
|
36
38
|
spec.add_development_dependency "rubocop", "~> 1.51.0"
|
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: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renato Arruda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: murmurhash3
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- bin/console
|
161
161
|
- bin/setup
|
162
162
|
- bin/unleash-client
|
163
|
+
- echo_client_spec_version.rb
|
163
164
|
- examples/bootstrap.rb
|
164
165
|
- examples/default-toggles.json
|
165
166
|
- examples/extending_unleash_with_opentelemetry.rb
|
@@ -200,7 +201,8 @@ files:
|
|
200
201
|
homepage: https://github.com/unleash/unleash-client-ruby
|
201
202
|
licenses:
|
202
203
|
- Apache-2.0
|
203
|
-
metadata:
|
204
|
+
metadata:
|
205
|
+
client-specification-version: 5.0.2
|
204
206
|
post_install_message:
|
205
207
|
rdoc_options: []
|
206
208
|
require_paths:
|
@@ -209,14 +211,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
211
|
requirements:
|
210
212
|
- - ">="
|
211
213
|
- !ruby/object:Gem::Version
|
212
|
-
version: '2.
|
214
|
+
version: '2.6'
|
213
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
216
|
requirements:
|
215
217
|
- - ">="
|
216
218
|
- !ruby/object:Gem::Version
|
217
219
|
version: '0'
|
218
220
|
requirements: []
|
219
|
-
rubygems_version: 3.
|
221
|
+
rubygems_version: 3.5.6
|
220
222
|
signing_key:
|
221
223
|
specification_version: 4
|
222
224
|
summary: Unleash feature toggle client.
|