configx 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/config_x/version.rb +1 -1
- data/sig/config_x/config_factory.rbs +12 -12
- metadata +2 -5
- data/sig/shims/deep_merge.rbs +0 -7
- data/sig/shims/env.rbs +0 -17
- data/sig/shims/zeitwerk/loader.rbs +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d85130348f312704220c410aca5c215e2952201fb9a63046f05481425a02801d
|
4
|
+
data.tar.gz: 50a9cde21b965cb19186f6811799e4f9c499af61e7d7646de30260934abd7d9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 903a2499e0e20966bb866df5265f64e6510b86ad8943d7cfdb828bf952321ccd3ccbfc37c2032b374a6f5fef00b85d85a3ca0b10083bc84148628148faae78e2
|
7
|
+
data.tar.gz: 9b161e055d6c6e9846dad1a8b3f2ab3cc7dabee62e831c52e3396b6773262d67c9848c70221511c6894c4088f18fd02f89ada93be9a70d4ad4e71624e4249237
|
data/README.md
CHANGED
@@ -161,6 +161,13 @@ config = ConfigX.builder
|
|
161
161
|
.load
|
162
162
|
```
|
163
163
|
|
164
|
+
Sometimes you may want to just load configuration from a single source, for example, from for testing purposes:
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
config = ConfigX.from({api: {enabled: true}})
|
168
|
+
config.api.enabled # => true
|
169
|
+
```
|
170
|
+
|
164
171
|
## Development
|
165
172
|
|
166
173
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/config_x/version.rb
CHANGED
@@ -13,21 +13,21 @@ module ConfigX
|
|
13
13
|
def self.default_file_name: -> String
|
14
14
|
|
15
15
|
def self.load: (
|
16
|
-
String env,
|
17
|
-
env_prefix: String,
|
18
|
-
env_separator: String,
|
19
|
-
dir_name: String,
|
20
|
-
file_name: String,
|
21
|
-
config_root: String
|
16
|
+
?String env,
|
17
|
+
?env_prefix: String,
|
18
|
+
?env_separator: String,
|
19
|
+
?dir_name: String,
|
20
|
+
?file_name: String,
|
21
|
+
?config_root: String
|
22
22
|
) -> Config
|
23
23
|
|
24
24
|
def initialize: (
|
25
|
-
String env,
|
26
|
-
env_prefix: String,
|
27
|
-
env_separator: String,
|
28
|
-
dir_name: String,
|
29
|
-
file_name: String,
|
30
|
-
config_root: String
|
25
|
+
?String env,
|
26
|
+
?env_prefix: String,
|
27
|
+
?env_separator: String,
|
28
|
+
?dir_name: String,
|
29
|
+
?file_name: String,
|
30
|
+
?config_root: String
|
31
31
|
) -> void
|
32
32
|
|
33
33
|
def load: -> Config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tëma Bolshakov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merge
|
@@ -74,9 +74,6 @@ files:
|
|
74
74
|
- sig/config_x/hash_source.rbs
|
75
75
|
- sig/config_x/source.rbs
|
76
76
|
- sig/config_x/yaml_source.rbs
|
77
|
-
- sig/shims/deep_merge.rbs
|
78
|
-
- sig/shims/env.rbs
|
79
|
-
- sig/shims/zeitwerk/loader.rbs
|
80
77
|
homepage: https://github.com/bolshakov/configx
|
81
78
|
licenses:
|
82
79
|
- MIT
|
data/sig/shims/deep_merge.rbs
DELETED
data/sig/shims/env.rbs
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# module ENV
|
2
|
-
# extend Enumerable[[String, String]]
|
3
|
-
#
|
4
|
-
# # def self.[]: (::String) -> (::String | nil)
|
5
|
-
# # def self.[]=: (::String, ::String) -> ::String
|
6
|
-
# # def self.fetch: [A] (key: ::String, default: A) -> (A | ::String)
|
7
|
-
# # def self.fetch: (key: ::String) ?{ ::String -> A } -> (::String | A)
|
8
|
-
# # def self.delete: (::String) -> (::String | nil)
|
9
|
-
# # def self.key?: (::String) -> bool
|
10
|
-
# # def self.clear: () -> void
|
11
|
-
# # def self.to_h: () -> Hash[::String, ::String]
|
12
|
-
# # def self.each: () { (::String, ::String) -> void } -> void
|
13
|
-
# # def self.each_key: () { (::String) -> void } -> void
|
14
|
-
# # def self.each_value: () { (::String) -> void } -> void
|
15
|
-
# # def self.keys: () -> Array[::String]
|
16
|
-
# # def self.values: () -> Array[::String]
|
17
|
-
# end
|