proxy_pac_rb 0.5.9 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/proxy_pac_rb/rspec/helpers.rb +15 -7
- data/lib/proxy_pac_rb/version.rb +1 -1
- data/spec/rspec/validitiy_spec.rb +15 -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: c8947d531f4f1dad52295ebfce27b5fff8a77393
|
4
|
+
data.tar.gz: 346759a3aef384fba2aec24b023b95c301bf0128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 688dfae547bd7239087380d8b6f00eb076eebd2fc2c1db72f5e5785739515fd30afbc3f78fdf5c8c9fc89e0903ec886a0f37212063c441ad64350b89115d23a1
|
7
|
+
data.tar.gz: 46b1e53ce947b583a8bab4aa7023e047c0fd73fcffcf52b0a77009195ee4cd9687d9a3805797275b289193d0b43a69c6d862135d6282a3b7bae708ec4be73889
|
data/Gemfile.lock
CHANGED
@@ -3,13 +3,7 @@ module ProxyPacRb
|
|
3
3
|
# Helpers for proxy.pac tests
|
4
4
|
module Helpers
|
5
5
|
def proxy_pac
|
6
|
-
|
7
|
-
subject
|
8
|
-
else
|
9
|
-
File.join(root_path, subject)
|
10
|
-
end
|
11
|
-
|
12
|
-
file = ProxyPacRb::ProxyPacFile.new(source: source)
|
6
|
+
file = ProxyPacRb::ProxyPacFile.new(source: _proxy_pac_source)
|
13
7
|
|
14
8
|
_proxy_pac_loader.load(file)
|
15
9
|
_proxy_pac_linter.lint(file)
|
@@ -32,6 +26,20 @@ module ProxyPacRb
|
|
32
26
|
|
33
27
|
private
|
34
28
|
|
29
|
+
def _proxy_pac_source
|
30
|
+
url_host = begin
|
31
|
+
Addressable::URI.parse(subject).host
|
32
|
+
rescue
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
|
36
|
+
if subject.nil? || /FindProxyForURL/ === subject || url_host
|
37
|
+
subject
|
38
|
+
else
|
39
|
+
File.join(root_path, subject)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
35
43
|
def _environment
|
36
44
|
Environment.new(time: time, client_ip: client_ip)
|
37
45
|
end
|
data/lib/proxy_pac_rb/version.rb
CHANGED
@@ -12,6 +12,21 @@ RSpec.describe 'Validity', type: :proxy_pac do
|
|
12
12
|
|
13
13
|
context 'when is valid' do
|
14
14
|
it { expect(proxy_pac).to be_valid }
|
15
|
+
|
16
|
+
context 'although it makes URI to raise invalid url error' do
|
17
|
+
subject do
|
18
|
+
<<-EOS.strip_heredoc.chomp
|
19
|
+
function FindProxyForURL(url, host) {
|
20
|
+
// comment
|
21
|
+
if ( dnsDomainIs ( host, "example.org") ) {
|
22
|
+
return "PROXY 10.0.0.0:8080";
|
23
|
+
}
|
24
|
+
}
|
25
|
+
EOS
|
26
|
+
end
|
27
|
+
|
28
|
+
it { expect(proxy_pac).to be_valid }
|
29
|
+
end
|
15
30
|
end
|
16
31
|
|
17
32
|
context 'when is not valid' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_pac_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Günnewig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|