vagrant-proxyconf 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/CHANGELOG.md +25 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +38 -64
- data/Rakefile +1 -0
- data/lib/vagrant-proxyconf/action.rb +1 -0
- data/lib/vagrant-proxyconf/action/base.rb +13 -3
- data/lib/vagrant-proxyconf/action/configure_chef_proxy.rb +11 -1
- data/lib/vagrant-proxyconf/action/configure_docker_proxy.rb +13 -6
- data/lib/vagrant-proxyconf/action/configure_env_proxy.rb +3 -3
- data/lib/vagrant-proxyconf/action/configure_git_proxy.rb +5 -4
- data/lib/vagrant-proxyconf/action/configure_npm_proxy.rb +3 -3
- data/lib/vagrant-proxyconf/action/configure_yum_proxy.rb +3 -3
- data/lib/vagrant-proxyconf/cap/coreos/docker_proxy_conf.rb +10 -6
- data/lib/vagrant-proxyconf/version.rb +1 -1
- data/spec/unit/vagrant-proxyconf/action/configure_env_proxy_spec.rb +59 -0
- 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: 3b424b5c07112e6ac773ce1d53b1ffced7dd2360
|
4
|
+
data.tar.gz: 45bed17d7789495f69f6b7da03b1e2c50590f002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 231af2e8b37bbb116e7b5669c63561c990703814d08ed815e2e248a25c102eaf4ffcae6046b84e1a619250c34f640ae50930bed86b65ba205d0ef007f0018f66
|
7
|
+
data.tar.gz: 3f7535f2203faa712e9fd0ba8a5b6ad2486bb526d282f68d00cae5c3f1f2be6777b8456cc909c3a8538c5dd705387eda76f8a530d9096130ef256fc6d5b1b314
|
data/.travis.yml
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: false
|
2
4
|
|
3
5
|
before_install:
|
4
6
|
- rvm @global do gem uninstall bundler --all --executables
|
7
|
+
- gem uninstall bundler --all --executables
|
5
8
|
- gem install bundler --version '~> 1.5.2'
|
6
9
|
- bundle --version
|
7
10
|
bundler_args: --without=development
|
8
11
|
|
9
12
|
rvm: 2.0.0
|
10
|
-
env: VAGRANT_VERSION=v1.
|
13
|
+
env: VAGRANT_VERSION=v1.7.2
|
11
14
|
matrix:
|
12
15
|
include:
|
16
|
+
- env: VAGRANT_VERSION=v1.6.5
|
13
17
|
- env: VAGRANT_VERSION=v1.5.4
|
14
18
|
- env: VAGRANT_VERSION=v1.4.3
|
15
19
|
- env: VAGRANT_VERSION=v1.3.5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# 1.5.0 / 2015-01-15
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Ignore specific applications by passing a hash to `config.proxy.enabled` ([GH-93][])
|
6
|
+
- Support the `chef_zero` provisioner in Vagrant 1.7+ ([GH-105][])
|
7
|
+
|
8
|
+
Improvements:
|
9
|
+
|
10
|
+
- Add -f option for mv and rm commands to overrides any -i or -n options in shell aliases ([GH-90][])
|
11
|
+
- Use system-wide configuration for NPM ([GH-91][])
|
12
|
+
- Avoid restarting docker when configuration doesn't change ([GH-92][])
|
13
|
+
- Fix Chef provisioner detection compatibility with Vagrant 1.7+ ([GH-103][])
|
14
|
+
|
15
|
+
Bug fixes:
|
16
|
+
|
17
|
+
- Don't error if removing non-existing git proxy configuration ([GH-94][])
|
18
|
+
|
1
19
|
# 1.4.0 / 2014-09-28
|
2
20
|
|
3
21
|
Features:
|
@@ -181,3 +199,10 @@ Bug fixes:
|
|
181
199
|
[GH-63]: https://github.com/tmatilai/vagrant-proxyconf/issues/63 "Issue 63"
|
182
200
|
[GH-67]: https://github.com/tmatilai/vagrant-proxyconf/issues/67 "Issue 67"
|
183
201
|
[GH-69]: https://github.com/tmatilai/vagrant-proxyconf/issues/69 "Issue 69"
|
202
|
+
[GH-90]: https://github.com/tmatilai/vagrant-proxyconf/issues/90 "Issue 90"
|
203
|
+
[GH-91]: https://github.com/tmatilai/vagrant-proxyconf/issues/91 "Issue 91"
|
204
|
+
[GH-92]: https://github.com/tmatilai/vagrant-proxyconf/issues/92 "Issue 92"
|
205
|
+
[GH-93]: https://github.com/tmatilai/vagrant-proxyconf/issues/93 "Issue 93"
|
206
|
+
[GH-94]: https://github.com/tmatilai/vagrant-proxyconf/issues/94 "Issue 94"
|
207
|
+
[GH-103]: https://github.com/tmatilai/vagrant-proxyconf/issues/103 "Issue 103"
|
208
|
+
[GH-105]: https://github.com/tmatilai/vagrant-proxyconf/issues/105 "Issue 105"
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2013-
|
3
|
+
Copyright (c) 2013-2015 Teemu Matilainen <teemu.matilainen@iki.fi>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -21,10 +21,12 @@ The plugin can set:
|
|
21
21
|
* generic `http_proxy` etc. environment variables that many programs support
|
22
22
|
* default proxy configuration for all Chef provisioners
|
23
23
|
* proxy configuration for Apt
|
24
|
-
* proxy configuration for
|
24
|
+
* proxy configuration for Docker
|
25
|
+
* proxy configuration for Git
|
25
26
|
* proxy configuration for npm
|
26
|
-
* proxy configuration for Yum
|
27
27
|
* proxy configuration for PEAR
|
28
|
+
* proxy configuration for Subversion
|
29
|
+
* proxy configuration for Yum
|
28
30
|
* simple proxy configuration for Windows
|
29
31
|
|
30
32
|
## Quick start
|
@@ -123,7 +125,21 @@ VAGRANT_HTTP_PROXY="http://proxy.example.com:8080" vagrant up
|
|
123
125
|
|
124
126
|
### Disabling the plugin
|
125
127
|
|
126
|
-
The plugin can be totally skipped by setting `config.proxy.enabled` to `false` or empty string (`""`).
|
128
|
+
The plugin can be totally skipped by setting `config.proxy.enabled` to `false` or empty string (`""`).
|
129
|
+
This can be useful to for example disable it for some provider.
|
130
|
+
Specific applications can be skipped by setting `config.proxy.enabled` to
|
131
|
+
a hash( like `{ svn: false }`).
|
132
|
+
This disabling keeps proxy configurations for applications on the guest.
|
133
|
+
The configurations must be cleared before disabling if needed.
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
config.proxy.enabled # => all applications enabled(default)
|
137
|
+
config.proxy.enabled = true # => all applications enabled
|
138
|
+
config.proxy.enabled = { svn: false, docker: false }
|
139
|
+
# => specific applications disabled
|
140
|
+
config.proxy.enabled = "" # => all applications disabled
|
141
|
+
config.proxy.enabled = false # => all applications disabled
|
142
|
+
```
|
127
143
|
|
128
144
|
#### Example Vagrantfile
|
129
145
|
|
@@ -138,40 +154,36 @@ Vagrant.configure("2") do |config|
|
|
138
154
|
end
|
139
155
|
```
|
140
156
|
|
141
|
-
###
|
157
|
+
### Configuration for applications
|
158
|
+
Configures applications to use proxy settings. The configurations will be written to
|
159
|
+
configuration files for each application.
|
160
|
+
|
161
|
+
#### Configurable applications
|
162
|
+
Following applications can be configured.
|
163
|
+
Configurations are based on default configuration(`config.proxy.*`) and
|
164
|
+
can be overridden except SVN.
|
165
|
+
SVN configuration is not set if no SVN specific configuration.
|
142
166
|
|
143
|
-
|
167
|
+
| Application | Base conf. | Specific conf. | Env. var. |
|
168
|
+
| -----------------------|----------------|---------------------|---------------|
|
169
|
+
| configure_apt_proxy | config.proxy.* | config.apt_proxy.* | VAGRANT_APT_* |
|
170
|
+
| configure_git_proxy | N/A | config.git_proxy.* | VAGRANT_GIT_* |
|
171
|
+
| configure_svn_proxy | N/A | config.svn_proxy.* | VAGRANT_SVN_* |
|
172
|
+
| configure_yum_proxy | config.proxy.* | config.yum_proxy.* | VAGRANT_YUM_* |
|
144
173
|
|
145
174
|
#### Example Vagrantfile
|
146
175
|
|
147
176
|
```ruby
|
148
177
|
Vagrant.configure("2") do |config|
|
149
|
-
config.
|
178
|
+
config.proxy.http = "http://192.168.0.2:3128/"
|
179
|
+
config.proxy.https = "http://192.168.0.2:3128/"
|
180
|
+
config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
|
181
|
+
config.apt_proxy.http = "http://192.168.33.1:3142"
|
150
182
|
config.apt_proxy.https = "DIRECT"
|
151
183
|
# ... other stuff
|
152
184
|
end
|
153
185
|
```
|
154
|
-
|
155
|
-
#### Configuration keys
|
156
|
-
|
157
|
-
* `config.apt_proxy.http` - The proxy for HTTP URIs
|
158
|
-
* `config.apt_proxy.https` - The proxy for HTTPS URIs
|
159
|
-
* `config.apt_proxy.ftp` - The proxy for FTP URIs
|
160
|
-
|
161
|
-
#### Possible values
|
162
|
-
|
163
|
-
* If all keys are unset or `nil`, no configuration is written or modified.
|
164
|
-
* A proxy can be specified in the form of _http://[user:pass@]host:port_.
|
165
|
-
* Empty string (`""`) or `false` in any key also force the configuration file to be written, but without configuration for that scheme. Can be used to clear the old configuration and/or override a global setting.
|
166
|
-
* `"DIRECT"` can be used to specify that no proxy should be used. This is mostly useful for disabling proxy for HTTPS URIs when HTTP proxy is set (as Apt defaults to the latter).
|
167
|
-
* Please refer to [apt.conf(5)](http://manpages.debian.net/man/5/apt.conf) manual for more information.
|
168
|
-
|
169
186
|
#### Environment variables
|
170
|
-
|
171
|
-
* `VAGRANT_APT_HTTP_PROXY`
|
172
|
-
* `VAGRANT_APT_HTTPS_PROXY`
|
173
|
-
* `VAGRANT_APT_FTP_PROXY`
|
174
|
-
|
175
187
|
These also override the Vagrantfile configuration. To disable or remove the proxy use "DIRECT" or an empty value.
|
176
188
|
|
177
189
|
For example to spin up a VM, run:
|
@@ -180,44 +192,6 @@ For example to spin up a VM, run:
|
|
180
192
|
VAGRANT_APT_HTTP_PROXY="http://proxy.example.com:8080" vagrant up
|
181
193
|
```
|
182
194
|
|
183
|
-
#### Running apt-cacher-ng on a Vagrant box
|
184
|
-
|
185
|
-
[apt-cacher-box](https://github.com/tmatilai/apt-cacher-box) gives an example for setting up apt-cacher proxy server in a Vagrant VM.
|
186
|
-
|
187
|
-
### Yum
|
188
|
-
|
189
|
-
Configures Yum to use the specified proxy settings. The configuration will be inserted to _/etc/yum.conf_ on the guest.
|
190
|
-
|
191
|
-
#### Example Vagrantfile
|
192
|
-
|
193
|
-
```ruby
|
194
|
-
Vagrant.configure("2") do |config|
|
195
|
-
config.yum_proxy.http = "http://192.168.33.1:3142"
|
196
|
-
# ... other stuff
|
197
|
-
end
|
198
|
-
```
|
199
|
-
|
200
|
-
#### Configuration keys
|
201
|
-
|
202
|
-
* `config.yum_proxy.http` - The proxy for yum
|
203
|
-
|
204
|
-
#### Possible values
|
205
|
-
|
206
|
-
* If the keys is unset or `nil`, the current configuration is not modified.
|
207
|
-
* A proxy can be specified in the form of _http://[user:pass@]host:port_.
|
208
|
-
* Empty string (`""`) or `false` disables the proxy from the configuration.
|
209
|
-
|
210
|
-
#### Environment variables
|
211
|
-
|
212
|
-
* `VAGRANT_YUM_HTTP_PROXY`
|
213
|
-
|
214
|
-
This also overrides the Vagrantfile configuration. To disable or remove the proxy use an empty value.
|
215
|
-
|
216
|
-
For example to spin up a VM, run:
|
217
|
-
|
218
|
-
```sh
|
219
|
-
VAGRANT_YUM_HTTP_PROXY="http://proxy.example.com:8123" vagrant up
|
220
|
-
```
|
221
195
|
|
222
196
|
## Related plugins and projects
|
223
197
|
|
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ module VagrantPlugins
|
|
14
14
|
def call(env)
|
15
15
|
@machine = env[:machine]
|
16
16
|
|
17
|
-
if !config.enabled?
|
17
|
+
if disabled? || !config.enabled?
|
18
18
|
logger.info I18n.t("vagrant_proxyconf.#{config_name}.not_enabled")
|
19
19
|
elsif !supported?
|
20
20
|
logger.info I18n.t("vagrant_proxyconf.#{config_name}.not_supported")
|
@@ -79,12 +79,12 @@ module VagrantPlugins
|
|
79
79
|
|
80
80
|
logger.debug "Configuration (#{path}):\n#{config}"
|
81
81
|
@machine.communicate.tap do |comm|
|
82
|
-
comm.sudo("rm #{tmp}", error_check: false)
|
82
|
+
comm.sudo("rm -f #{tmp}", error_check: false)
|
83
83
|
comm.upload(local_tmp.path, tmp)
|
84
84
|
comm.sudo("chmod #{opts[:mode] || '0644'} #{tmp}")
|
85
85
|
comm.sudo("chown #{opts[:owner] || 'root:root'} #{tmp}")
|
86
86
|
comm.sudo("mkdir -p #{File.dirname(path)}")
|
87
|
-
comm.sudo("mv #{tmp} #{path}")
|
87
|
+
comm.sudo("mv -f #{tmp} #{path}")
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -106,6 +106,16 @@ module VagrantPlugins
|
|
106
106
|
"#{config_name}_conf".to_sym
|
107
107
|
end
|
108
108
|
|
109
|
+
def disabled?
|
110
|
+
enabled = @machine.config.proxy.enabled
|
111
|
+
return true if enabled == false || enabled == ''
|
112
|
+
|
113
|
+
app_name = config_name.gsub(/_proxy/, '').to_sym
|
114
|
+
return enabled[app_name] == false if enabled.respond_to?(:key)
|
115
|
+
|
116
|
+
false
|
117
|
+
end
|
118
|
+
|
109
119
|
def supported?
|
110
120
|
@machine.guest.capability?(cap_name) &&
|
111
121
|
@machine.guest.capability(cap_name)
|
@@ -6,6 +6,10 @@ module VagrantPlugins
|
|
6
6
|
class Action
|
7
7
|
# Action for configuring Chef provisioners
|
8
8
|
class ConfigureChefProxy
|
9
|
+
|
10
|
+
# Array of Chef provisioner types which include proxy configuration
|
11
|
+
CHEF_PROVISIONER_TYPES = [:chef_client, :chef_solo, :chef_zero]
|
12
|
+
|
9
13
|
def initialize(app, env)
|
10
14
|
@app = app
|
11
15
|
end
|
@@ -44,7 +48,13 @@ module VagrantPlugins
|
|
44
48
|
# @return [Array] all Chef provisioners
|
45
49
|
def chef_provisioners
|
46
50
|
@machine.config.vm.provisioners.select do |prov|
|
47
|
-
|
51
|
+
# Vagrant 1.7+ uses #type, earlier versions #name
|
52
|
+
if prov.respond_to?(:type)
|
53
|
+
type = prov.type
|
54
|
+
else
|
55
|
+
type = prov.name
|
56
|
+
end
|
57
|
+
CHEF_PROVISIONER_TYPES.include?(type)
|
48
58
|
end
|
49
59
|
end
|
50
60
|
|
@@ -40,19 +40,26 @@ module VagrantPlugins
|
|
40
40
|
sed_script = docker_sed_script
|
41
41
|
local_tmp = tempfile(docker_config)
|
42
42
|
|
43
|
-
comm.sudo("rm #{tmp}", error_check: false)
|
43
|
+
comm.sudo("rm -f #{tmp}", error_check: false)
|
44
44
|
comm.upload(local_tmp.path, tmp)
|
45
45
|
comm.sudo("touch #{path}")
|
46
46
|
comm.sudo("sed -e '#{sed_script}' #{path} > #{path}.new")
|
47
47
|
comm.sudo("cat #{tmp} >> #{path}.new")
|
48
|
-
comm
|
49
|
-
comm.sudo("
|
50
|
-
comm.sudo("mv #{path}.new #{path}")
|
51
|
-
comm.sudo("rm #{tmp}")
|
52
|
-
comm.sudo(service_restart_command)
|
48
|
+
update_config(comm, path)
|
49
|
+
comm.sudo("rm -f #{tmp} #{path}.new")
|
53
50
|
end
|
54
51
|
end
|
55
52
|
|
53
|
+
def update_config(comm, path)
|
54
|
+
return if comm.test("diff #{path}.new #{path}")
|
55
|
+
|
56
|
+
# update config and restart docker when config changed
|
57
|
+
comm.sudo("chmod 0644 #{path}.new")
|
58
|
+
comm.sudo("chown root:root #{path}.new")
|
59
|
+
comm.sudo("mv -f #{path}.new #{path}")
|
60
|
+
comm.sudo(service_restart_command)
|
61
|
+
end
|
62
|
+
|
56
63
|
def detect_export
|
57
64
|
@machine.communicate.tap do |comm|
|
58
65
|
comm.test('which systemctl') ? @export = '' : @export = 'export '
|
@@ -59,15 +59,15 @@ module VagrantPlugins
|
|
59
59
|
local_tmp = tempfile(environment_config)
|
60
60
|
|
61
61
|
@machine.communicate.tap do |comm|
|
62
|
-
comm.sudo("rm #{tmp}", error_check: false)
|
62
|
+
comm.sudo("rm -f #{tmp}", error_check: false)
|
63
63
|
comm.upload(local_tmp.path, tmp)
|
64
64
|
comm.sudo("touch #{path}")
|
65
65
|
comm.sudo("sed -e '#{sed_script}' #{path} > #{path}.new")
|
66
66
|
comm.sudo("cat #{tmp} >> #{path}.new")
|
67
67
|
comm.sudo("chmod 0644 #{path}.new")
|
68
68
|
comm.sudo("chown root:root #{path}.new")
|
69
|
-
comm.sudo("mv #{path}.new #{path}")
|
70
|
-
comm.sudo("rm #{tmp}")
|
69
|
+
comm.sudo("mv -f #{path}.new #{path}")
|
70
|
+
comm.sudo("rm -f #{tmp}")
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -21,13 +21,14 @@ module VagrantPlugins
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def configure_machine
|
24
|
-
command = "#{git_path} config --system "
|
25
24
|
if config.http
|
26
|
-
|
25
|
+
@machine.communicate.sudo(
|
26
|
+
"#{git_path} config --system http.proxy #{config.http}")
|
27
27
|
else
|
28
|
-
|
28
|
+
@machine.communicate.sudo(
|
29
|
+
"#{git_path} config --system --unset-all http.proxy",
|
30
|
+
error_check: false)
|
29
31
|
end
|
30
|
-
@machine.communicate.sudo(command)
|
31
32
|
end
|
32
33
|
|
33
34
|
def git_path
|
@@ -23,15 +23,15 @@ module VagrantPlugins
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def set_or_delete_proxy(key, value)
|
26
|
-
command = "#{npm_path} config "
|
26
|
+
command = "#{npm_path} config --global "
|
27
27
|
if value
|
28
28
|
command << "set #{key} #{escape(value)}"
|
29
29
|
else
|
30
30
|
command << "delete #{key}"
|
31
31
|
|
32
|
-
# ensure that the
|
32
|
+
# ensure that the npmrc file exists to work around
|
33
33
|
# https://github.com/npm/npm/issues/5065
|
34
|
-
@machine.communicate.sudo("
|
34
|
+
@machine.communicate.sudo("#{npm_path} config --global set #{key} foo")
|
35
35
|
end
|
36
36
|
@machine.communicate.sudo(command)
|
37
37
|
end
|
@@ -18,14 +18,14 @@ module VagrantPlugins
|
|
18
18
|
path = config_path
|
19
19
|
|
20
20
|
@machine.communicate.tap do |comm|
|
21
|
-
comm.sudo("rm #{tmp}", error_check: false)
|
21
|
+
comm.sudo("rm -f #{tmp}", error_check: false)
|
22
22
|
comm.upload(ProxyConf.resource("yum_config.awk"), tmp)
|
23
23
|
comm.sudo("touch #{path}")
|
24
24
|
comm.sudo("gawk -f #{tmp} #{proxy_params} #{path} > #{path}.new")
|
25
25
|
comm.sudo("chmod 0644 #{path}.new")
|
26
26
|
comm.sudo("chown root:root #{path}.new")
|
27
|
-
comm.sudo("mv #{path}.new #{path}")
|
28
|
-
comm.sudo("rm #{tmp}")
|
27
|
+
comm.sudo("mv -f #{path}.new #{path}")
|
28
|
+
comm.sudo("rm -f #{tmp}")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -11,13 +11,17 @@ module VagrantPlugins
|
|
11
11
|
return false unless Util.which(machine, 'docker')
|
12
12
|
|
13
13
|
machine.communicate.tap do |comm|
|
14
|
-
src_file='/usr/lib/systemd/system/docker.service'
|
15
|
-
|
16
|
-
|
14
|
+
src_file = '/usr/lib/systemd/system/docker.service'
|
15
|
+
dst_file = '/etc/systemd/system/docker.service'
|
16
|
+
tmp_file = '/tmp/docker.service'
|
17
|
+
env_file = 'EnvironmentFile=-\/etc\/default\/docker'
|
17
18
|
comm.sudo("sed -e 's/\\[Service\\]/[Service]\\n#{env_file}/g' #{src_file} > #{tmp_file}")
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
unless comm.test("diff #{tmp_file} #{dst_file}")
|
20
|
+
# update config and restart docker when config changed
|
21
|
+
comm.sudo("mv -f #{tmp_file} #{dst_file}")
|
22
|
+
comm.sudo('systemctl daemon-reload')
|
23
|
+
end
|
24
|
+
comm.sudo("rm -f #{tmp}")
|
21
25
|
end
|
22
26
|
'/etc/default/docker'
|
23
27
|
end
|
@@ -8,4 +8,63 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureEnvProxy do
|
|
8
8
|
it { is_expected.to eq 'env_proxy' }
|
9
9
|
end
|
10
10
|
|
11
|
+
describe '#disabled?' do
|
12
|
+
subject do
|
13
|
+
conf = described_class.new(double, double)
|
14
|
+
machine = double('machine')
|
15
|
+
allow(machine).to receive_message_chain(:config, :proxy, :enabled)
|
16
|
+
.and_return(@config_proxy_enabled)
|
17
|
+
conf.instance_variable_set(:@machine, machine)
|
18
|
+
conf.send(:disabled?)
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when config proxy is enabled' do
|
22
|
+
it do
|
23
|
+
@config_proxy_enabled = true
|
24
|
+
is_expected.to eq false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
context 'when config proxy is not enabled' do
|
28
|
+
it do
|
29
|
+
@config_proxy_enabled = false
|
30
|
+
is_expected.to eq true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
context 'when config proxy is empty string' do
|
34
|
+
it do
|
35
|
+
@config_proxy_enabled = ''
|
36
|
+
is_expected.to eq true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'when target config proxy is enabled' do
|
41
|
+
it do
|
42
|
+
@config_proxy_enabled = { env: true }
|
43
|
+
is_expected.to eq false
|
44
|
+
end
|
45
|
+
end
|
46
|
+
context 'when target config proxy target is not enabled' do
|
47
|
+
it do
|
48
|
+
@config_proxy_enabled = { env: false }
|
49
|
+
is_expected.to eq true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
context 'when other config proxy are not enabled' do
|
53
|
+
it do
|
54
|
+
@config_proxy_enabled = {
|
55
|
+
svn: false,
|
56
|
+
apt: false,
|
57
|
+
chef: false,
|
58
|
+
docker: false,
|
59
|
+
git: false,
|
60
|
+
npm: false,
|
61
|
+
pear: false,
|
62
|
+
svn: false,
|
63
|
+
yum: false
|
64
|
+
}
|
65
|
+
is_expected.to eq false
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
11
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-proxyconf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Teemu Matilainen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Vagrant plugin that configures the virtual machine to use proxy servers
|
14
14
|
email:
|