prefab-cloud-ruby 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/prefab/config_value_wrapper.rb +1 -1
- data/prefab-cloud-ruby.gemspec +4 -3
- data/test/test_config_value_wrapper.rb +42 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb91b8be5a01c3bab3312d277a27117c0449713623e1605863486c3809cff0cd
|
4
|
+
data.tar.gz: 3deaeb9fcb458ef461771865463c5163f8b5c6833a45d1e7af4ec3474f5d04bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2555fc0364fef33c11e3e7866a00ab5df766e859c73baedbb39712ddceb07ec96d0216c5e79dd7336e40951de85b773100864356fd24423f3257a8e3ab40e073
|
7
|
+
data.tar.gz: 44c9813ede3c95db9820e0247c71c7e4a1e0e21b5981d074025baf546e5f3e7de6362744acedd831437e3b10ca747cdb73ec596ec1394b82ff7e70481ab57a52
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -9,7 +9,7 @@ module Prefab
|
|
9
9
|
when TrueClass, FalseClass
|
10
10
|
PrefabProto::ConfigValue.new(bool: value)
|
11
11
|
when Array
|
12
|
-
PrefabProto::ConfigValue.new(string_list:
|
12
|
+
PrefabProto::ConfigValue.new(string_list: PrefabProto::StringList.new(values: value.map(&:to_s)))
|
13
13
|
else
|
14
14
|
PrefabProto::ConfigValue.new(string: value.to_s)
|
15
15
|
end
|
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.0.
|
5
|
+
# stub: prefab-cloud-ruby 1.0.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "prefab-cloud-ruby".freeze
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.1"
|
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 = "2023-08-
|
14
|
+
s.date = "2023-08-17"
|
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.executables = ["console".freeze]
|
@@ -86,6 +86,7 @@ Gem::Specification.new do |s|
|
|
86
86
|
"test/test_config_loader.rb",
|
87
87
|
"test/test_config_resolver.rb",
|
88
88
|
"test/test_config_value_unwrapper.rb",
|
89
|
+
"test/test_config_value_wrapper.rb",
|
89
90
|
"test/test_context.rb",
|
90
91
|
"test/test_context_shape.rb",
|
91
92
|
"test/test_context_shape_aggregator.rb",
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
class TestConfigValueWrapper < Minitest::Test
|
6
|
+
def test_wrap_integer
|
7
|
+
result = Prefab::ConfigValueWrapper.wrap(42)
|
8
|
+
assert_instance_of PrefabProto::ConfigValue, result
|
9
|
+
assert_equal 42, result.int
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_wrap_float
|
13
|
+
result = Prefab::ConfigValueWrapper.wrap(3.14)
|
14
|
+
assert_instance_of PrefabProto::ConfigValue, result
|
15
|
+
assert_equal 3.14, result.double
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_wrap_boolean_true
|
19
|
+
result = Prefab::ConfigValueWrapper.wrap(true)
|
20
|
+
assert_instance_of PrefabProto::ConfigValue, result
|
21
|
+
assert_equal true, result.bool
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_wrap_boolean_false
|
25
|
+
result = Prefab::ConfigValueWrapper.wrap(false)
|
26
|
+
assert_instance_of PrefabProto::ConfigValue, result
|
27
|
+
assert_equal false, result.bool
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_wrap_array
|
31
|
+
result = Prefab::ConfigValueWrapper.wrap(['one', 'two', 'three'])
|
32
|
+
assert_instance_of PrefabProto::ConfigValue, result
|
33
|
+
assert_instance_of PrefabProto::StringList, result.string_list
|
34
|
+
assert_equal ['one', 'two', 'three'], result.string_list.values
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_wrap_string
|
38
|
+
result = Prefab::ConfigValueWrapper.wrap('hello')
|
39
|
+
assert_instance_of PrefabProto::ConfigValue, result
|
40
|
+
assert_equal 'hello', result.string
|
41
|
+
end
|
42
|
+
end
|
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.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dwyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- test/test_config_loader.rb
|
246
246
|
- test/test_config_resolver.rb
|
247
247
|
- test/test_config_value_unwrapper.rb
|
248
|
+
- test/test_config_value_wrapper.rb
|
248
249
|
- test/test_context.rb
|
249
250
|
- test/test_context_shape.rb
|
250
251
|
- test/test_context_shape_aggregator.rb
|