vagrant-goodhosts 1.0.11 → 1.0.12

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
  SHA256:
3
- metadata.gz: 49d1ef8ce5027c31ed5ec247e6e970c8c4aeaf63768f580a01a8a728c72ab0d7
4
- data.tar.gz: abab4a95a6f01277fcfdaaac8e18a14a8bf8e2c734d2d9e458458f6224a8f73d
3
+ metadata.gz: e0a9a9277945173d86017e1adc047ab0f77c2cc1779720feacab37f2095eeaab
4
+ data.tar.gz: 20814631c5aea07c8eb72a7ea7458ef0e6617ce5358585587a62883c30cee311
5
5
  SHA512:
6
- metadata.gz: 300fb83736beb9410f886bc3973e7f3280dfad083b9b0bf995d265f1cd74b53cca9b930255deabc738fcf900768049f102044fe901a069515278a81d77d16435
7
- data.tar.gz: d24e96eafd0d1bf66c00d8ba52625601af178b3f4e87dc2ec9fcfc8316b465cee3b8ec1dc781759465cb48f02afd6be9cf1772366f7f79bd85525f0b1ddfcced
6
+ metadata.gz: 8ff28f24b53144938296b34731d73f0569724b4d2bd877ef5e1d148a4a485de2c2aefe34abaecdd60ba9a3a6d3c24296d3a21ddebe42864e32dfa459083ec19b
7
+ data.tar.gz: 11c2e604dace4cc0cb75a829f0162d0a3a9941f14ba9103fc79333ee87d4eab107c659c463ff4fe3fa19395549a6089e56fda12256da95a9abd6e627e5ba8712
data/README.md CHANGED
@@ -80,13 +80,13 @@ This disables `vagrant-goodhosts` from running on **suspend** and **halt**.
80
80
 
81
81
  ### Disable file hosts clean
82
82
 
83
- If you don't want `/etc/hosts` file cleaned add in your `VagrantFile`:
83
+ If you want `/etc/hosts` file cleaned add in your `VagrantFile`:
84
84
 
85
85
  ```ruby
86
- config.goodhosts.disable_clean = true
86
+ config.goodhosts.disable_clean = false
87
87
  ```
88
88
 
89
- This disables `vagrant-goodhosts` from running the clean command.
89
+ This enable `vagrant-goodhosts` from running the clean command in every call.
90
90
 
91
91
  ## Suppressing prompts for elevating privileges
92
92
 
@@ -80,7 +80,7 @@ module VagrantPlugins
80
80
  return hostnames
81
81
  end
82
82
 
83
- def shouldClean(ip_address)
83
+ def disableClean(ip_address)
84
84
  unless ip_address.nil?
85
85
  return @machine.config.goodhosts.disable_clean
86
86
  end
@@ -100,15 +100,16 @@ module VagrantPlugins
100
100
  @ui.error "[vagrant-goodhosts] Error adding some hosts, no IP was provided for the following hostnames: #{hostnames}"
101
101
  next
102
102
  end
103
- clean = ''
104
103
  if cli.include? ".exe"
105
- if not shouldClean(ip_address)
106
- clean = "\"--clean\","
104
+ clean = "\"--clean\","
105
+ if disableClean(ip_address)
106
+ clean = ''
107
107
  end
108
108
  stdin, stdout, stderr, wait_thr = Open3.popen3("powershell", "-Command", "Start-Process '#{cli}' -ArgumentList \"add\",#{clean}\"#{ip_address}\",\"#{hostnames}\" -Verb RunAs")
109
109
  else
110
- if not shouldClean(ip_address)
111
- clean = "--clean"
110
+ clean = "--clean"
111
+ if disableClean(ip_address)
112
+ clean = ''
112
113
  end
113
114
  stdin, stdout, stderr, wait_thr = Open3.popen3("sudo #{cli} add #{clean} #{ip_address} #{hostnames}")
114
115
  end
@@ -134,13 +135,15 @@ module VagrantPlugins
134
135
  next
135
136
  end
136
137
  if cli.include? ".exe"
137
- if not shouldClean(ip_address)
138
- clean = "\"--clean\","
138
+ clean = "\"--clean\","
139
+ if disableClean(ip_address)
140
+ clean = ''
139
141
  end
140
142
  stdin, stdout, stderr, wait_thr = Open3.popen3("powershell", "-Command", "Start-Process '#{cli}' -ArgumentList \"remove\",#{clean}\"#{ip_address}\",\"#{hostnames}\" -Verb RunAs")
141
143
  else
142
- if not shouldClean(ip_address)
143
- clean = "--clean"
144
+ clean = "\"--clean\","
145
+ if disableClean(ip_address)
146
+ clean = ''
144
147
  end
145
148
  stdin, stdout, stderr, wait_thr = Open3.popen3("sudo #{cli} remove #{clean} #{ip_address} #{hostnames}")
146
149
  end
@@ -9,7 +9,7 @@ module VagrantPlugins
9
9
  attr_accessor :disable_clean
10
10
 
11
11
  def initialize
12
- @disable_clean = false
12
+ @disable_clean = true
13
13
  end
14
14
  end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GoodHosts
3
- VERSION = '1.0.11'
3
+ VERSION = '1.0.12'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-goodhosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniele Scasciafratte