From 7e434ecbb4c136cbb0ba3a1e57c3c4e087873b1f Mon Sep 17 00:00:00 2001 From: John Landis Date: Thu, 17 May 2018 16:35:39 -0400 Subject: [PATCH 1/3] Move newlines out of quoted header and footer. Match carriage return along with newline in hosts file pattern. --- lib/vagrant-hostmanager/hosts_file/updater.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vagrant-hostmanager/hosts_file/updater.rb b/lib/vagrant-hostmanager/hosts_file/updater.rb index 4ba7d19..ba8f38b 100644 --- a/lib/vagrant-hostmanager/hosts_file/updater.rb +++ b/lib/vagrant-hostmanager/hosts_file/updater.rb @@ -88,8 +88,8 @@ module VagrantPlugins def update_content(file_content, resolving_machine, include_id, line_endings) id = include_id ? " id: #{read_or_create_id}" : "" - header = "## vagrant-hostmanager-start#{id}\n" - footer = "## vagrant-hostmanager-end\n" + header = "## vagrant-hostmanager-start#{id}" + footer = "## vagrant-hostmanager-end" body = get_machines .map { |machine| get_hosts_file_entry(machine, resolving_machine) } .join @@ -146,12 +146,12 @@ module VagrantPlugins if body.empty? block = "\n" else - block = "\n\n" + header + body + footer + "\n" + block = "\n\n" + header + "\n" + body + footer + "\n\n" end # Pattern for finding existing block header_pattern = Regexp.quote(header) footer_pattern = Regexp.quote(footer) - pattern = Regexp.new("\n*#{header_pattern}.*?#{footer_pattern}\n*", Regexp::MULTILINE) + pattern = Regexp.new("[\r\n]*#{header_pattern}.*?#{footer_pattern}[\r\n]*", Regexp::MULTILINE) # Replace existing block or append content = old_content.match(pattern) ? old_content.sub(pattern, block) : old_content.rstrip + block if line_endings == "crlf" From 93b672d82940e2e0dcc44bdd99429a83bd89155f Mon Sep 17 00:00:00 2001 From: Seth Reeser Date: Fri, 18 May 2018 10:23:04 -0400 Subject: [PATCH 2/3] Releasing v1.8.9 --- lib/vagrant-hostmanager/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-hostmanager/version.rb b/lib/vagrant-hostmanager/version.rb index fa6acc5..ae0a99a 100644 --- a/lib/vagrant-hostmanager/version.rb +++ b/lib/vagrant-hostmanager/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module HostManager - VERSION = '1.8.8' + VERSION = '1.8.9' end end From 2b75b7f00f4b929023c7d6e3cd70d75b334c560b Mon Sep 17 00:00:00 2001 From: Seth Reeser Date: Fri, 18 May 2018 10:34:59 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5ef103c..2eb8fb1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ Vagrant Host Manager `vagrant-hostmanager` is a Vagrant plugin that manages the `hosts` file on guest machines (and optionally the host). Its goal is to enable resolution of multi-machine environments deployed with a cloud provider where IP addresses are not known in advance. +Do you like what we do? Consider supporting us through Patreon. All of the money goes directly back into growing our collection of open source and free software. +[![Patreon](https://img.shields.io/badge/patreon-donate-red.svg)](https://www.patreon.com/devopsgroup) + Installation ------------