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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 830ebb0e814d789a00e537ad91277bf4bb339eab
4
- data.tar.gz: 18c74f7b0f6b45d28901806a460c2ba5eb310b44
3
+ metadata.gz: 20e8e87e2ecefb39735c8c49ede563b047e6aecd
4
+ data.tar.gz: 0a9462edc917e130ae783bf625b1260046ad1552
5
5
  SHA512:
6
- metadata.gz: 458678c74d7b5085459bf1ea579d9baad16acd3f7b19f306fdce9cdb70ce414e792e33d5acd4805d34c06ff6d63caa84f49ff1ef04fd05ef4f4fd7c2695f5fba
7
- data.tar.gz: a7a4a2029ddb354d78bf3de1d381dcf54279f053591dcb71833c01685007ed9dfff7bc7c8e5474f8a31aeb46b0a974b18a6b061d430d94e6c160464263422a51
6
+ metadata.gz: 4ce664af01bb0e3c86c120eeb76120c6b44875d47b73d580251e135d8bf7ecd1c6fb7347505fd0b6c4353c7da83a2e6330828f3dfbc954e5eb1416601a0e80ae
7
+ data.tar.gz: 34893a605451f490b4d9a2fec7703b353cbfa0e6c9d1dc77d9739c8a8182410b7f7157f790ee231cc51701404cde935a13c53bba31ea6f9454e7cb7de9470c7f
@@ -1,3 +1,3 @@
1
1
  module EcePrewarmer
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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 {|e,i| i if e.name == hostname }.compact
20
- to_delete.each { |i| hosts.elements[i] = nil }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ece_prewarmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Bruna