k_config 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +7 -0
- data/lib/k_config/configuration.rb +30 -3
- data/lib/k_config/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29acae4b3b93be3b2f682d783634c24f0bc9b6350f4ec62ff2cdc7dd66aef5b2
|
4
|
+
data.tar.gz: 4ee04847aac6dd11a21108835f0b2040a9bd88c5cd1668f2296e4e6ba4536e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f1bda2d981ad6a02e34a2c56792e60dac755f36c929edbd837f092e89cf37ea909c1b47dd02d07501bbfe358e699bd73de8b4ba64a552b6fc28bc3148dd363c
|
7
|
+
data.tar.gz: 85e9ae1e7fa10e326ef1eedccd76d2d71657b56bc96635433fe5a5d0b9ef4602f525fff0d9813b5d629fd95da00ecac0b1400fa5a034fa7c9faba781147c6118
|
data/docs/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.0.4](https://github.com/klueless-io/k_config/compare/v0.0.3...v0.0.4) (2022-02-04)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add custom debug support ([5e1c344](https://github.com/klueless-io/k_config/commit/5e1c34444a23b7e3e9d50106524ed055e50d2d9b))
|
7
|
+
|
1
8
|
## [0.0.3](https://github.com/klueless-io/k_config/compare/v0.0.2...v0.0.3) (2022-02-04)
|
2
9
|
|
3
10
|
|
@@ -8,11 +8,38 @@ module KConfig
|
|
8
8
|
|
9
9
|
attr_accessor :config_name
|
10
10
|
|
11
|
-
def debug
|
11
|
+
def debug
|
12
12
|
log.section_heading(config_name) if config_name
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
self.class.registered_keys.each do |key|
|
15
|
+
method = "#{key}_debug".to_sym
|
16
|
+
send(method) if respond_to?(method)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize_copy(orig)
|
21
|
+
self.class.registered_keys.each do |key|
|
22
|
+
method = "#{key}_initialize_copy".to_sym
|
23
|
+
send(method, orig) if respond_to?(method)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class << self
|
28
|
+
def registered_keys
|
29
|
+
@registered_keys ||= []
|
30
|
+
end
|
31
|
+
|
32
|
+
# Register configuration extension key
|
33
|
+
#
|
34
|
+
# This key provides a unique method name prefix to common methods such as debug and initialize_copy
|
35
|
+
def register(key, extension)
|
36
|
+
if registered_keys.include?(key)
|
37
|
+
puts "Key #{key} already registered ... skipping"
|
38
|
+
return registered_keys
|
39
|
+
end
|
40
|
+
|
41
|
+
include(extension)
|
42
|
+
registered_keys << key
|
16
43
|
end
|
17
44
|
end
|
18
45
|
end
|
data/lib/k_config/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "k_config",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.5",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "k_config",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.5",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.1",
|
data/package.json
CHANGED