ece_prewarmer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ece_prewarmer/version.rb +1 -1
- data/lib/ece_prewarmer.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20e8e87e2ecefb39735c8c49ede563b047e6aecd
|
4
|
+
data.tar.gz: 0a9462edc917e130ae783bf625b1260046ad1552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ce664af01bb0e3c86c120eeb76120c6b44875d47b73d580251e135d8bf7ecd1c6fb7347505fd0b6c4353c7da83a2e6330828f3dfbc954e5eb1416601a0e80ae
|
7
|
+
data.tar.gz: 34893a605451f490b4d9a2fec7703b353cbfa0e6c9d1dc77d9739c8a8182410b7f7157f790ee231cc51701404cde935a13c53bba31ea6f9454e7cb7de9470c7f
|
data/lib/ece_prewarmer.rb
CHANGED
@@ -16,8 +16,11 @@ module EcePrewarmer
|
|
16
16
|
def self.remove_host_alias(hostname, file = nil)
|
17
17
|
file ||= '/etc/hosts'
|
18
18
|
hosts = Hosts::File.read(file)
|
19
|
-
to_delete = hosts.elements.each_with_index.map
|
20
|
-
|
19
|
+
to_delete = hosts.elements.each_with_index.map do |e,i|
|
20
|
+
return nil unless e.is_a? Aef::Hosts::Entry
|
21
|
+
i if e.name == hostname
|
22
|
+
end
|
23
|
+
to_delete.compact.each { |i| hosts.elements[i] = nil }
|
21
24
|
hosts.elements.compact!
|
22
25
|
hosts.write
|
23
26
|
end
|