configx 0.1.0 → 0.3.0

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: 51b3ba99940f73078c374d7fb7804e231e58657903d6592ad9b594f42925d3b2
4
- data.tar.gz: f51ed4cd4c47db8f05eb512d83d2d38bc0277e6acaed4aef54bd964e1bf87812
3
+ metadata.gz: d85130348f312704220c410aca5c215e2952201fb9a63046f05481425a02801d
4
+ data.tar.gz: 50a9cde21b965cb19186f6811799e4f9c499af61e7d7646de30260934abd7d9f
5
5
  SHA512:
6
- metadata.gz: 0d07f1c7ab54071b42411736e107635a6c75a2a867dc22e32c685e7964eaa9ab1c4204a988c797a6280b0dc71a8470d760b16fb8092e04142a138c9d3c8bc9fd
7
- data.tar.gz: 5bf94989849a17a47c833a6599ca029123fdf1b96cb704baab1d028fcfd9ce6efb09b1ed7b50285bc41fce5c05a78e70ceeab36367f53e14631a77c892162559
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigX
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -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.1.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-05 00:00:00.000000000 Z
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
@@ -1,7 +0,0 @@
1
- module DeepMerge
2
- def self.deep_merge!: [K1, V1, K2, V2] (
3
- Hash[K1, V1] source,
4
- Hash[K2, V2] destination,
5
- ?overwrite_arrays: bool
6
- ) -> Hash[K1 | K2, V1 | V2]
7
- end
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
@@ -1,8 +0,0 @@
1
- module Zeitwerk
2
- class Loader
3
- def self.for_gem: -> instance
4
-
5
- def ignore: (String) -> void
6
- def setup: -> void
7
- end
8
- end