envoy-proxy 1.0.0 → 1.0.1

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: 79aa6508c84fc016f6cd86578c4fc3c2e4c56bb7
4
- data.tar.gz: 0756f96ffcc9738416d2f72478dd081938e7c881
3
+ metadata.gz: c19294a78a664f18b65dcecadf00a446f22105d1
4
+ data.tar.gz: 8a88cf13c94ae2d29c637d955bf2f7e285fd97d7
5
5
  SHA512:
6
- metadata.gz: 3669908f7d9b5cdde77f905b419213190164082d8750223b06b12574d91b86e7306beefa9c9ea69ca08c3498751da947eaabec8e05d572c41bb4065cfcda092c
7
- data.tar.gz: 06434fb4ffbf9ebcf082d4118b1fd2323be2437284f13f4b06a6791f36e9dcdd6f9b835fd6ade6c20ab4de335268b9fff82fe5e14dcbd70f4fbb2cee1ab0428a
6
+ metadata.gz: a8b114e9db19b449c56a9228d3f1c896559178c23f1e5d072cbda100550393df1800ead876b3008dff45213119c3dbcbeb17ad8304c7f406e9d44d2e8355f5ae
7
+ data.tar.gz: 7585b58d5b643994d23ea27b00111b0ebcb0e0ff153247a2c444944e1f33347fc6c21e678429c4a5dc342f454bc7a996c33fab1712e4a8ba0d5cc0f47df24eaf
@@ -53,6 +53,11 @@ module Envoy
53
53
  Gem::Requirement.new(*requirement) =~ Gem::Version.new(@options[:version])
54
54
  end
55
55
 
56
+ def receive_start_tls
57
+ send_object :start_tls
58
+ start_tls
59
+ end
60
+
56
61
  def receive_pong
57
62
  unless @pinged
58
63
  send_object :ping
@@ -71,11 +76,6 @@ module Envoy
71
76
  end
72
77
  end
73
78
 
74
- def receive_start_tls
75
- send_object :start_tls
76
- start_tls
77
- end
78
-
79
79
  def receive_stream id, data
80
80
  c = channels[id]
81
81
  w = c && c.web
@@ -111,12 +111,10 @@ module Envoy
111
111
  end && halt
112
112
  if hosts.empty?
113
113
  hosts = [SecureRandom.random_number(36 ** 4).to_s(36)]
114
- message Envoy::INFO, "Service accessible at http://#{hosts[0]}.#{$zone}/"
115
- else
116
- @hosts = hosts.each do |host|
117
- Trunk.trunks[host] << self
118
- message Envoy::INFO, "Service accessible at http://#{host}.#{$zone}/"
119
- end
114
+ end
115
+ @hosts = hosts.each do |host|
116
+ Trunk.trunks[host] << self
117
+ message Envoy::INFO, "Service accessible at http://#{host}.#{$zone}/"
120
118
  end
121
119
  unless @options[:key]
122
120
  @options[:key] = SecureRandom.hex(8)
data/lib/envoy/utils.rb CHANGED
@@ -9,16 +9,21 @@ module Envoy
9
9
 
10
10
  VERBOSITIES = "FEWIDT"
11
11
 
12
- class << self
13
- attr_accessor :verbosity
12
+ def self.verbosity
13
+ @verbosity
14
+ end
15
+
16
+ def self.verbosity= (num)
17
+ @verbosity = [0, [5, num].min].max
14
18
  end
15
19
 
16
20
  def self.log (level, text, io = STDERR)
17
21
  return unless io
22
+ level = Envoy.const_get(level.upcase) unless level.is_a?(Numeric)
18
23
  return unless level <= verbosity
19
24
  message = [
20
25
  Time.now.strftime("%F %T"),
21
- VERBOSITIES[level][0],
26
+ VERBOSITIES[level],
22
27
  text
23
28
  ].compact.join(" ")
24
29
  io.puts message
data/lib/envoy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Envoy
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Baum