config_curator 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/config_curator/collection.rb +2 -2
- data/lib/config_curator/units/config_file.rb +11 -2
- data/lib/config_curator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e2b559882994bb8018bbe48134184ae10ff7f77
|
4
|
+
data.tar.gz: 2f9dc98e7e92abed3919cd1254ec1ead0d92a136
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 743e75e64d381dad366fcd0edbab0c3e9ffa2540492883a6ccf4ada91ab24a5b3519652f0ea0d061aafc63b0d6bdb73ef3af2eeb13c36c081a0c876d75ee711c
|
7
|
+
data.tar.gz: 42344300ff9789b36ac74860167ba3338910a7aabffa8a38b9c3974b23425498302306109c2cd27ac86b9d43e55a32ed41d7e0d59de76df2173c86c924f6ead8
|
data/CHANGELOG.md
CHANGED
@@ -137,10 +137,10 @@ module ConfigCurator
|
|
137
137
|
# @param quiet [Boolean] suppress some {#logger} output
|
138
138
|
# @return [Boolean] if unit was installed
|
139
139
|
def install_unit(unit, type, quiet = false)
|
140
|
-
unit.install
|
140
|
+
success = unit.install
|
141
141
|
logger.info do
|
142
142
|
"Installed #{type_name(type)}: #{unit.source} ⇨ #{unit.destination_path}"
|
143
|
-
end unless quiet
|
143
|
+
end unless quiet || !success
|
144
144
|
return true
|
145
145
|
|
146
146
|
rescue Unit::InstallFailed => e
|
@@ -64,12 +64,21 @@ module ConfigCurator
|
|
64
64
|
|
65
65
|
# Will look for files with the naming pattern `filename.hostname.ext`.
|
66
66
|
# @param path [String] path to the non-host-specific file
|
67
|
+
# rubocop:disable Metrics/MethodLength
|
67
68
|
def search_for_host_specific_file(path)
|
68
69
|
directory = File.dirname path
|
70
|
+
filename = File.basename path
|
69
71
|
extension = File.extname path
|
70
|
-
basename =
|
72
|
+
basename = filename.chomp(extension)
|
71
73
|
if Dir.exist? directory
|
72
|
-
|
74
|
+
files = Dir.entries(directory)
|
75
|
+
|
76
|
+
file = files.grep(/^#{filename}\.#{hostname.downcase}$/).first
|
77
|
+
return File.join directory, file unless file.nil?
|
78
|
+
|
79
|
+
extension.gsub!(/^\./, '\.')
|
80
|
+
regex = /^#{basename}\.#{hostname.downcase}#{extension}$/
|
81
|
+
file = files.grep(regex).first
|
73
82
|
return File.join directory, file unless file.nil?
|
74
83
|
end
|
75
84
|
nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_curator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Boyd Sosenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|