envoy-proxy 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/envoy-proxy.gemspec +2 -2
- data/lib/envoy/server/trunk.rb +13 -8
- data/lib/envoy/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e12a9dc7bdb8e9ed83fd43ed0721c7c24fe93c
|
4
|
+
data.tar.gz: 960a0a5cb549bb9bd9c5800bdf241cb3d1c75006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc30bd5f5b6b967bef9ee9ee97635a94c489c48c3cc82642e0d8f00da73890bfb7c67ae2f1605975647c9029aab459dbaa8494b3b84dec7990249ecbd9be579
|
7
|
+
data.tar.gz: aafbf07d55daea5fdb3eb0e0ee98037c204e6f65f53c89ce3dbebc16ac42fc217f9ec1e7e00d4d38053881d8617b04f213f57e2b4bdc0ddf54d9b85a3d0082b6
|
data/envoy-proxy.gemspec
CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency('eventmachine', '
|
23
|
-
spec.add_dependency('bert', '
|
22
|
+
spec.add_dependency('eventmachine', '~> 1.0')
|
23
|
+
spec.add_dependency('bert', '~> 1.1')
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
26
|
spec.add_development_dependency "rake"
|
data/lib/envoy/server/trunk.rb
CHANGED
@@ -32,6 +32,10 @@ module Envoy
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def receive_pong
|
35
|
+
EM.add_timer 5 do
|
36
|
+
log "ping"
|
37
|
+
send_object :ping
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
41
|
def receive_close id, code = nil
|
@@ -62,16 +66,17 @@ module Envoy
|
|
62
66
|
close_connection(true)
|
63
67
|
end
|
64
68
|
|
69
|
+
def version? *requirement
|
70
|
+
Gem::Requirement.new(*requirement) =~ Gem::Version.new(@options[:version])
|
71
|
+
end
|
72
|
+
|
65
73
|
def receive_options options
|
66
74
|
@options = options
|
67
|
-
if
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
EM.add_periodic_timer 20 do
|
73
|
-
send_object :message, "Checking client is still here. Upgrade to hide this message."
|
74
|
-
end
|
75
|
+
if version? "~> 0.1"
|
76
|
+
receive_pong
|
77
|
+
end
|
78
|
+
if version? "< #{Envoy::VERSION}"
|
79
|
+
send_object :message, "Your client is out of date. Please upgrade to #{Envoy::VERSION}."
|
75
80
|
end
|
76
81
|
if @key and @key != @options[:key]
|
77
82
|
halt "Key is invalid"
|
data/lib/envoy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envoy-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Baum
|
@@ -14,30 +14,30 @@ dependencies:
|
|
14
14
|
name: eventmachine
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bert
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1
|
33
|
+
version: '1.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.1
|
40
|
+
version: '1.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|