proxylocal 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/client.rb +12 -10
- data/proxylocal.gemspec +2 -2
- metadata +4 -4
data/Rakefile
CHANGED
data/lib/client.rb
CHANGED
@@ -32,25 +32,27 @@ module ProxyLocal
|
|
32
32
|
EventMachine::connect(options[:server_host], options[:server_port], self) do |c|
|
33
33
|
c.instance_eval do
|
34
34
|
@options = options
|
35
|
-
send_object(:options
|
35
|
+
send_object(BERT::Tuple[:options, @options])
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
def receive_object(
|
42
|
-
|
43
|
-
puts obj[:message]
|
44
|
-
end
|
45
|
-
|
46
|
-
EventMachine.stop_event_loop if obj[:halt]
|
41
|
+
def receive_object(message)
|
42
|
+
message = [message] unless message.is_a?(Array)
|
47
43
|
|
48
|
-
|
44
|
+
case message[0]
|
45
|
+
when :message
|
46
|
+
puts message[1]
|
47
|
+
when :halt
|
48
|
+
EventMachine.stop_event_loop
|
49
|
+
when :request
|
50
|
+
_, uuid, request = message
|
49
51
|
EventMachine::connect('127.0.0.1', @options[:local_port], ClientProxy) do |connection|
|
50
52
|
connection.callback do |data|
|
51
|
-
send_object(:
|
53
|
+
send_object(BERT::Tuple[:response, uuid, data])
|
52
54
|
end
|
53
|
-
connection.send_data(
|
55
|
+
connection.send_data(request)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
data/proxylocal.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{proxylocal}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Just Lest"]
|
9
|
-
s.date = %q{2010-11-
|
9
|
+
s.date = %q{2010-11-12}
|
10
10
|
s.default_executable = %q{proxylocal}
|
11
11
|
s.description = %q{http://proxylocal.com/}
|
12
12
|
s.email = %q{just.lest@gmail.com}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxylocal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Just Lest
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-12 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|