config_skeleton 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config_skeleton.gemspec +1 -1
- data/lib/config_skeleton.rb +8 -3
- 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: 20798a914f83d1ab8531eb66259f202816e40ade371172102058536cf2fa3af7
|
4
|
+
data.tar.gz: 5f742b8f777496e322f845eccc9c641eb7bad0815c8853cd1eea26bbddd2080c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9873af5655630b61a5833a58d6203836a78d4e11218802608fbcde86ada691e6e38ae2a52dd088037e00be1721aed145c6c057cd3c0175ad4279995d3da7d91e
|
7
|
+
data.tar.gz: a9e1d788d30246ee436a452076fd157d03864123b3b1eca420c26cb5d6c0684752a5028e4930f81195e2e47e6a8253f468564d525eb3bff8738bf61299d8658a
|
data/config_skeleton.gemspec
CHANGED
data/lib/config_skeleton.rb
CHANGED
@@ -371,7 +371,7 @@ class ConfigSkeleton < ServiceSkeleton
|
|
371
371
|
#
|
372
372
|
# @note this can optionally be implemented by subclasses.
|
373
373
|
#
|
374
|
-
def before_regenerate_config(force_reload:, existing_config_hash:); end
|
374
|
+
def before_regenerate_config(force_reload:, existing_config_hash:, existing_config_data:); end
|
375
375
|
|
376
376
|
# Run code after the config is regenerated and potentially a new file is written.
|
377
377
|
#
|
@@ -465,8 +465,13 @@ class ConfigSkeleton < ServiceSkeleton
|
|
465
465
|
# @return [void]
|
466
466
|
#
|
467
467
|
def regenerate_config(force_reload: false)
|
468
|
-
|
469
|
-
|
468
|
+
data = File.read(config_file)
|
469
|
+
existing_config_hash = Digest::MD5.hexdigest(data)
|
470
|
+
before_regenerate_config(
|
471
|
+
force_reload: force_reload,
|
472
|
+
existing_config_hash: existing_config_hash,
|
473
|
+
existing_config_data: data
|
474
|
+
)
|
470
475
|
|
471
476
|
logger.debug(logloc) { "force? #{force_reload.inspect}" }
|
472
477
|
tmpfile = Tempfile.new(service_name, File.dirname(config_file))
|