webproxy 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/webproxy +3 -1
  2. data/lib/webproxy.rb +3 -2
  3. metadata +6 -4
@@ -3,6 +3,8 @@ require 'webproxy'
3
3
 
4
4
  if ARGV.length == 1
5
5
  WebProxy.run!(ARGV.first)
6
+ elsif ARGV.length == 2
7
+ WebProxy.run!(ARGV.first, ARGV.last)
6
8
  else
7
- puts "Usage: webproxy http://www.google.com"
9
+ puts "Usage: webproxy http://www.google.com [port]"
8
10
  end
@@ -1,10 +1,11 @@
1
1
  require 'rubygems'
2
+ gem 'rack', '= 1.1.0'
2
3
  require 'rack'
3
4
  require 'httparty' # <--- I should remove this as a dependency and just use Net::HTTP ... if I ever actually use this code for anything
4
5
 
5
6
  class WebProxy
6
7
 
7
- def self.run!(host)
8
+ def self.run!(host, port = 8080)
8
9
  handler = Rack::Handler::WEBrick
9
10
 
10
11
  begin
@@ -18,7 +19,7 @@ class WebProxy
18
19
  end
19
20
  end
20
21
 
21
- handler.run WebProxy.new(host)
22
+ handler.run WebProxy.new(host), :Port => port.to_i
22
23
  end
23
24
 
24
25
  def initialize host
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - remi
@@ -22,11 +22,13 @@ dependencies:
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "="
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
+ - 1
29
+ - 1
28
30
  - 0
29
- version: "0"
31
+ version: 1.1.0
30
32
  type: :runtime
31
33
  version_requirements: *id001
32
34
  - !ruby/object:Gem::Dependency