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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 954f9875f9848b8fd0088d497b9893c29f617b8429a7e2f1f16c3f9d5066999f
4
- data.tar.gz: '0888f67ae0c78cb606d60e48d76e78524f6f1813293cc5074fc647666e6d28a3'
3
+ metadata.gz: 29acae4b3b93be3b2f682d783634c24f0bc9b6350f4ec62ff2cdc7dd66aef5b2
4
+ data.tar.gz: 4ee04847aac6dd11a21108835f0b2040a9bd88c5cd1668f2296e4e6ba4536e68
5
5
  SHA512:
6
- metadata.gz: f547d86824abfffc45b0ea16b81527ab3275ec5741199f08d4dcba88bec65a163f97eadc5a7a220f3aab90d3474f909bc40a479e478b3958863a6f261896c2e6
7
- data.tar.gz: a358a1a5e278055dff0e9c45942a830538d35a7d8a51a9e5995d8642e7a3c2714f40e6a241075befb4921e960ea31ee7248abbf88f72d4ec3f616d077200546a
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(*debug_extensions)
11
+ def debug
12
12
  log.section_heading(config_name) if config_name
13
13
 
14
- debug_extensions.each do |debug_extension|
15
- send(debug_extension) if respond_to?(debug_extension)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KConfig
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "k_config",
3
- "version": "0.0.4",
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.4",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k_config",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Command line and CI/CD tools for K Config",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys