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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71f47aa6186498d65fe216a62f4d6b12739954ad
4
- data.tar.gz: 1f2d01c51e737379378f0015996a843997736ad6
3
+ metadata.gz: d9e12a9dc7bdb8e9ed83fd43ed0721c7c24fe93c
4
+ data.tar.gz: 960a0a5cb549bb9bd9c5800bdf241cb3d1c75006
5
5
  SHA512:
6
- metadata.gz: 2de124ad4d7063e9013bef55a2a48c90a0fb905ac0ea3c0bcedd60d854242f0cfed7e0405ada4e4a1a14772dbdbe1c858c12bce3554d265a4a98e99bb0011da6
7
- data.tar.gz: aa27e4cd74e3ef97b01f8fd9ab73d0b74231d9f9d81f2bebf27dfdeca436ae2a679107e9707d63ae82412756fa6624b8fea85c11b3ad51ffea20f8406bc8ab1f
6
+ metadata.gz: 8cc30bd5f5b6b967bef9ee9ee97635a94c489c48c3cc82642e0d8f00da73890bfb7c67ae2f1605975647c9029aab459dbaa8494b3b84dec7990249ecbd9be579
7
+ data.tar.gz: aafbf07d55daea5fdb3eb0e0ee98037c204e6f65f53c89ce3dbebc16ac42fc217f9ec1e7e00d4d38053881d8617b04f213f57e2b4bdc0ddf54d9b85a3d0082b6
@@ -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', '>= 1.0.3')
23
- spec.add_dependency('bert', '>= 1.1.6')
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"
@@ -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 (@options[:version].split(".").map(&:to_i) <=> [0, 1, 0]) > -1
68
- EM.add_periodic_timer 5 do
69
- send_object :ping
70
- end
71
- else
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"
@@ -1,3 +1,3 @@
1
1
  module Envoy
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
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.3
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.3
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.3
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.6
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.6
40
+ version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement