local_pac 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +19 -5
- data/README.md +49 -2
- data/Rakefile +56 -1
- data/lib/local_pac/version.rb +2 -1
- data/local_pac.gemspec +0 -2
- metadata +2 -33
data/Gemfile
CHANGED
@@ -7,14 +7,28 @@ group :test do
|
|
7
7
|
gem 'rack-test', require: 'rack/test'
|
8
8
|
gem 'rspec', require: false
|
9
9
|
gem 'fuubar', require: false
|
10
|
-
|
11
|
-
|
10
|
+
gem 'simplecov', require: false
|
11
|
+
gem 'rubocop', require: false
|
12
|
+
gem 'coveralls', require: false
|
12
13
|
end
|
13
14
|
|
14
15
|
group :development do
|
15
|
-
gem '
|
16
|
+
gem 'awesome_print', require: false
|
17
|
+
gem 'debugger'
|
18
|
+
gem 'debugger-completion'
|
16
19
|
gem 'foreman', require: false
|
17
|
-
gem '
|
20
|
+
gem 'github-markup'
|
18
21
|
gem 'pry'
|
19
|
-
gem 'debugger'
|
22
|
+
gem 'pry-debugger', require: false
|
23
|
+
gem 'pry-doc', require: false
|
24
|
+
gem 'redcarpet', require: false
|
25
|
+
gem 'tmrb', require: false
|
26
|
+
gem 'yard', require: false
|
20
27
|
end
|
28
|
+
|
29
|
+
gem 'rake', group: [:development, :test], require: false
|
30
|
+
gem 'fedux_org-stdlib', group: [:development, :test], require: false
|
31
|
+
gem 'bundler', '~> 1.3', group: [:development, :test], require: false
|
32
|
+
gem 'erubis', group: [:development, :test]
|
33
|
+
gem 'versionomy', group: [:development, :test], require: false
|
34
|
+
gem 'activesupport', group: [:development, :test], require: false
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# LocalPac
|
2
2
|
|
3
|
-
|
3
|
+
Serve proxy.pac-files with ease.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,54 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
You need to place your proxy.pac in one of the following directories:
|
22
|
+
|
23
|
+
* $HOME/.config/pacfiles/
|
24
|
+
* $HOME/.pacfiles/
|
25
|
+
|
26
|
+
Otherwise the gem will use it's default proxy.pac:
|
27
|
+
|
28
|
+
```javascript
|
29
|
+
function FindProxyForURL(url, host) {
|
30
|
+
return "DIRECT";
|
31
|
+
}
|
32
|
+
```
|
33
|
+
|
34
|
+
After storing your proxy.pac-files you can serve them via:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
local_pac serve
|
38
|
+
|
39
|
+
# Output:
|
40
|
+
# [2014-02-11 14:30:51] INFO WEBrick 1.3.1
|
41
|
+
# [2014-02-11 14:30:51] INFO ruby 1.9.3 (2013-11-22) [x86_64-linux]
|
42
|
+
# == Sinatra/1.4.4 has taken the stage on 8000 for development with backup from WEBrick
|
43
|
+
# [2014-02-11 14:30:51] INFO WEBrick::HTTPServer#start: pid=2295 port=8000
|
44
|
+
```
|
45
|
+
|
46
|
+
|
47
|
+
After that you need to point your browser to your proxy.pac:
|
48
|
+
|
49
|
+
```
|
50
|
+
http://localhost:8000/v1/pac/<name>.pac
|
51
|
+
```
|
52
|
+
|
53
|
+
|
54
|
+
If you want to use it in a larger deployment, you might want to use the
|
55
|
+
systemd-files provided by the gem:
|
56
|
+
|
57
|
+
* share/system/local_pac.socket
|
58
|
+
* share/system/local_pac.service
|
59
|
+
|
60
|
+
## Reading
|
61
|
+
|
62
|
+
A good website to support you writing proxy.pac-files is:
|
63
|
+
http://findproxyforurl.com.
|
64
|
+
|
65
|
+
## Future
|
66
|
+
|
67
|
+
* Add feature: Compress proxy.pac-files before delivering them
|
68
|
+
* Improve API to support further functionality
|
22
69
|
|
23
70
|
## Contributing
|
24
71
|
|
data/Rakefile
CHANGED
@@ -1 +1,56 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
require 'fedux_org/stdlib/rake'
|
4
|
+
|
5
|
+
require 'local_pac/version'
|
6
|
+
|
7
|
+
def software
|
8
|
+
'local_pac'
|
9
|
+
end
|
10
|
+
|
11
|
+
def version
|
12
|
+
LocalPac::VERSION
|
13
|
+
end
|
14
|
+
|
15
|
+
def root_directory
|
16
|
+
File.expand_path('../', __FILE__)
|
17
|
+
end
|
18
|
+
|
19
|
+
def tar_file
|
20
|
+
File.join(pkg_directory, "#{software}-#{version}.tar.gz")
|
21
|
+
end
|
22
|
+
|
23
|
+
def tmp_directory
|
24
|
+
File.join(root_directory, 'tmp', "#{software}-#{version}")
|
25
|
+
end
|
26
|
+
|
27
|
+
def gem_file
|
28
|
+
File.join(root_directory, 'pkg', "#{software}-#{version}.gem")
|
29
|
+
end
|
30
|
+
|
31
|
+
def pkg_directory
|
32
|
+
File.join(root_directory, 'pkg')
|
33
|
+
end
|
34
|
+
|
35
|
+
def gem_directory
|
36
|
+
File.join(root_directory, 'vendor', 'cache')
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => 'gem:build'
|
40
|
+
|
41
|
+
file gem_file => 'gem:build'
|
42
|
+
|
43
|
+
file tmp_directory do
|
44
|
+
FileUtils.mkdir_p tmp_directory
|
45
|
+
end
|
46
|
+
|
47
|
+
namespace :gem do
|
48
|
+
desc 'build tar file'
|
49
|
+
task :package => [gem_file, tmp_directory] do
|
50
|
+
FileUtils.mv File.join(pkg_directory, "#{software}-#{version}.gem"), tmp_directory
|
51
|
+
|
52
|
+
Dir.chdir('tmp') do
|
53
|
+
sh "tar -czf #{tar_file} #{File.basename tmp_directory}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/local_pac/version.rb
CHANGED
data/local_pac.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: local_pac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -27,38 +27,6 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: bundler
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '1.5'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '1.5'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rake
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
30
|
description: ! 'This gem helps you to serve proxy.pacs locallly
|
63
31
|
|
64
32
|
'
|
@@ -139,3 +107,4 @@ test_files:
|
|
139
107
|
- spec/support/filesystem.rb
|
140
108
|
- spec/support/rack_test.rb
|
141
109
|
- spec/support/rspec.rb
|
110
|
+
has_rdoc:
|