prefab-cloud-ruby 1.8.5 → 1.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/VERSION +1 -1
- data/lib/prefab/config_resolver.rb +4 -0
- data/lib/prefab/config_value_unwrapper.rb +1 -1
- data/lib/prefab/options.rb +4 -1
- data/prefab-cloud-ruby.gemspec +3 -3
- data/test/test_config_value_unwrapper.rb +26 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08c5749617f280419c9737d7a0961a69f718dd8c5cc1db73066a198c0d37561c'
|
4
|
+
data.tar.gz: aa211a7fcc73b06d343178ce75a8d673fd45bca7bdf40837a1da5f7217bf3c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a6ca64f6157cb62d4fddb62d8f5f3c6b9764e37b79ba53b7901d5988008733ac6c95851a8b66056dfdfb636f5739e4a4bd15c20dd8cd157a8329913e813151
|
7
|
+
data.tar.gz: 0a6470d0f65411f96e02512dbecf7806732f21b2b18431a9e0cb1e5b3a9c043d7c30c7ea5398a9abb4955b0f4be4051c4bdbaa382c25b5baa882372bb66f189d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.8.7 - 2024-10-25
|
4
|
+
|
5
|
+
- Add option symbolize_json_names (#211)
|
6
|
+
|
7
|
+
|
8
|
+
## 1.8.6 - 2024-10-07
|
9
|
+
|
10
|
+
- Fix deprecation warning caused by x_datafile being set by default (#208)
|
11
|
+
|
3
12
|
## 1.8.5 - 2024-09-27
|
4
13
|
|
5
14
|
- Fix JS bootstrapping and improve performance (#206)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.8.
|
1
|
+
1.8.7
|
data/lib/prefab/options.rb
CHANGED
@@ -20,6 +20,7 @@ module Prefab
|
|
20
20
|
attr_reader :datafile
|
21
21
|
attr_reader :global_context
|
22
22
|
attr_accessor :is_fork
|
23
|
+
attr_reader :symbolize_json_names
|
23
24
|
|
24
25
|
module ON_INITIALIZATION_FAILURE
|
25
26
|
RAISE = :raise
|
@@ -67,8 +68,9 @@ module Prefab
|
|
67
68
|
collect_max_evaluation_summaries: DEFAULT_MAX_EVAL_SUMMARIES,
|
68
69
|
allow_telemetry_in_local_mode: false,
|
69
70
|
datafile: ENV['PREFAB_DATAFILE'],
|
70
|
-
x_datafile:
|
71
|
+
x_datafile: nil, # DEPRECATED in favor of `datafile`
|
71
72
|
x_use_local_cache: false,
|
73
|
+
symbolize_json_names: false,
|
72
74
|
global_context: {}
|
73
75
|
)
|
74
76
|
@api_key = api_key
|
@@ -96,6 +98,7 @@ module Prefab
|
|
96
98
|
@use_local_cache = x_use_local_cache
|
97
99
|
@is_fork = false
|
98
100
|
@global_context = global_context
|
101
|
+
@symbolize_json_names = symbolize_json_names
|
99
102
|
|
100
103
|
# defaults that may be overridden by context_upload_mode
|
101
104
|
@collect_shapes = false
|
data/prefab-cloud-ruby.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: prefab-cloud-ruby 1.8.
|
5
|
+
# stub: prefab-cloud-ruby 1.8.7 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "prefab-cloud-ruby".freeze
|
9
|
-
s.version = "1.8.
|
9
|
+
s.version = "1.8.7"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Jeff Dwyer".freeze]
|
14
|
-
s.date = "2024-
|
14
|
+
s.date = "2024-10-25"
|
15
15
|
s.description = "Feature Flags, Live Config, and Dynamic Log Levels as a service".freeze
|
16
16
|
s.email = "jdwyer@prefab.cloud".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -65,10 +65,25 @@ class TestConfigValueUnwrapper < Minitest::Test
|
|
65
65
|
assert_equal 390605 ,unwrap(config_value, CONFIG, EMPTY_CONTEXT).in_seconds
|
66
66
|
end
|
67
67
|
|
68
|
-
def test_unwrapping_json
|
68
|
+
def test_unwrapping_json
|
69
69
|
json = PrefabProto::Json.new(json: '{"a": 1, "b": "c"}')
|
70
70
|
config_value = PrefabProto::ConfigValue.new(json: json)
|
71
|
-
assert_equal({"a" => 1, "b" => "c"}, unwrap(config_value, CONFIG, EMPTY_CONTEXT))
|
71
|
+
assert_equal({"a" => 1, "b" => "c"}, unwrap(config_value, CONFIG, EMPTY_CONTEXT))
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_unwrapping_json_with_symbolize_json_names_true
|
75
|
+
@mock_resolver = MockResolver.new(symbolize_json_names: true)
|
76
|
+
json = PrefabProto::Json.new(json: '{"a": 1, "b": "c"}')
|
77
|
+
config_value = PrefabProto::ConfigValue.new(json: json)
|
78
|
+
assert_equal({:a => 1, :b => "c"}, unwrap(config_value, CONFIG, EMPTY_CONTEXT))
|
79
|
+
|
80
|
+
json = PrefabProto::Json.new(json: '{"foo": { "bar": "baz"}, "cow": "moo"}')
|
81
|
+
config_value = PrefabProto::ConfigValue.new(json: json)
|
82
|
+
assert_equal({:foo=>{:bar=>"baz"}, :cow=>"moo"}, unwrap(config_value, CONFIG, EMPTY_CONTEXT))
|
83
|
+
|
84
|
+
json = PrefabProto::Json.new(json: '[{"foo": { "bar": "baz"}}, {"cow": "moo"}]')
|
85
|
+
config_value = PrefabProto::ConfigValue.new(json: json)
|
86
|
+
assert_equal([{:foo=>{:bar=>"baz"}}, {:cow=>"moo"}], unwrap(config_value, CONFIG, EMPTY_CONTEXT))
|
72
87
|
end
|
73
88
|
|
74
89
|
def test_unwrapping_weighted_values
|
@@ -228,6 +243,15 @@ class TestConfigValueUnwrapper < Minitest::Test
|
|
228
243
|
end
|
229
244
|
|
230
245
|
class MockResolver
|
246
|
+
|
247
|
+
def initialize(symbolize_json_names: false)
|
248
|
+
@symbolize_json_names = symbolize_json_names
|
249
|
+
end
|
250
|
+
|
251
|
+
def symbolize_json_names?
|
252
|
+
@symbolize_json_names
|
253
|
+
end
|
254
|
+
|
231
255
|
def get(key)
|
232
256
|
if DECRYPTION_KEY_NAME == key
|
233
257
|
Prefab::Evaluation.new(config: PrefabProto::Config.new(key: key),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prefab-cloud-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dwyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|