pacproxy 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6a4c4d49256abefe3d1058dc41f485f0cc9bab5
4
- data.tar.gz: a64708a9332cbe508a0caae11006fd57dbfdba4d
3
+ metadata.gz: 544d350a0f41fbbd036432458ec322674a7699a9
4
+ data.tar.gz: f719176796dc8ed6e8df8702b704fecd0103e157
5
5
  SHA512:
6
- metadata.gz: 309c7a012f364fb3116104c274fe8969b6f27fd85f9a67bffadfb82aac10631fb7570099df829b28c90fa0a9e2b1bb56872c46620ec1d94e1c9450c4e3aef18a
7
- data.tar.gz: b1547a897a53e42b067fb11d8e6ac666f1178d9542b5adf23afb4068da40132324f0ff7f8faeee4d858cb90f55544cd798f97b4171293d209e90df3bbff7cb2e
6
+ metadata.gz: 0e5579ec3c7435b4bd209fba6462809d57e2de1e4d531c6421af2054d7f70d24789583db451648dcb066298431dd0f1a89b6bc3faa9b4d8596efd6add5ef39d0
7
+ data.tar.gz: d55a68ce7de1ca3bf24a838eb837e89cc148fc72733752432fd049cedd0c63ef5862615cf769d60aa9c26c128d90a1df512907fa611386b66632cf059d60256e
data/README.md CHANGED
@@ -2,24 +2,36 @@
2
2
 
3
3
  Pacproxy provides http/https proxy routed with proxy.pac.
4
4
 
5
+ **:warning:Now Pacproxy is very early stage, so it might have big change.**
6
+
5
7
  ## Installation
6
8
 
7
- Add this line to your application's Gemfile:
9
+ Add this line to your application's Gemfile, for example:
8
10
 
9
11
  gem 'pacproxy'
12
+ gem 'therubyracer'
10
13
 
11
14
  And then execute:
12
15
 
13
16
  $ bundle
14
17
 
15
- Or install it yourself as:
18
+ ## Requirements
19
+
20
+ After installing the `pacproxy` gem you must install a JavaScript runtime. Compatible runtimes include
21
+ (see [pac](https://github.com/samuelkadolph/ruby-pac/blob/master/README.md):
16
22
 
17
- $ gem install pacproxy
23
+ * [therubyracer](https://rubygems.org/gems/therubyracer) Google V8 embedded within Ruby
24
+ * [therubyrhino](https://rubygems.org/gems/therubyrhino/) Mozilla Rhino embedded within JRuby
25
+ * [johnson](https://rubygems.org/gems/johnson/) Mozilla SpiderMonkey embedded within Ruby 1.8
26
+ * [mustang](https://rubygems.org/gems/mustang/) Mustang V8 embedded within Ruby
18
27
 
19
28
  ## Usage
20
29
 
21
30
  $ bundle exec pacproxy -P proxy.pac -p 3128
22
31
 
32
+ or
33
+
34
+ $ bundle exec pacproxy -P http://sample.org/proxy.pac -p 3128
23
35
 
24
36
  ## Contributing
25
37
 
data/bin/pacproxy CHANGED
@@ -2,21 +2,35 @@
2
2
 
3
3
  require 'pacproxy'
4
4
  require 'optparse'
5
+ require 'logger'
5
6
 
6
7
  port = 3128
7
8
  proxy_pac = nil
9
+ daemonize = false
10
+ log_file = 'pacproxy.log'
8
11
 
9
12
  OptionParser.new do |o|
13
+ o.on('-d', 'daemonize') { daemonize = true }
14
+ o.on('-l LOGFILE', String, "specify log file. default: #{log_file}") { |l| log_file = l }
10
15
  o.on('-p PORT', Integer,"specify listening port. default: #{port}") { |p| port = p }
11
16
  o.on('-P PROXYPAC', String, 'specify proxy.pac location') { |pac| proxy_pac = pac }
12
17
  o.on('-h', 'show this help') { puts o; exit }
13
18
  o.parse!
14
19
  end
15
20
 
16
- s = Pacproxy::Pacproxy.new({Port: port,Proxypac: proxy_pac})
21
+ logger = Logger.new(log_file, 'weekly')
22
+ logger.level = Logger::DEBUG
23
+
24
+ s = Pacproxy::Pacproxy.new(Port: port,
25
+ Proxypac: proxy_pac,
26
+ Logger: logger)
17
27
 
18
28
  Signal.trap('INT') do
19
29
  s.shutdown
20
30
  end
21
31
 
22
- s.start
32
+ if daemonize
33
+ WEBrick::Daemon.start { s.start }
34
+ else
35
+ s.start
36
+ end
@@ -1,3 +1,3 @@
1
1
  module Pacproxy
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/pacproxy.gemspec CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'therubyracer', '~> 0.12.1'
22
21
  spec.add_dependency 'pac', '~> 1.0.0'
23
22
 
24
23
  spec.add_development_dependency 'bundler', '~> 1.6'
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pacproxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OTA Hiroshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-06 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: therubyracer
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: 0.12.1
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: 0.12.1
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: pac
29
15
  requirement: !ruby/object:Gem::Requirement