protobuf 2.8.4 → 2.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce09086e344463e2c1193ad642e5ddf90186a40b
4
- data.tar.gz: e215cd2b66f2a290ed0193a4dae2ec7329780de5
3
+ metadata.gz: a856318d0dafa9da5a88d40dcc319c500e766a13
4
+ data.tar.gz: 868ee8f458233c1bf2e62a9db3371a4b0f698391
5
5
  SHA512:
6
- metadata.gz: 51c1d0bea9a61d7d6b921ec859419ebbdac79a75efc54987b5cbaa7a378069d75755e6d04c47ab2c2d1b5f4fd71d206b2a89d5fe069db5e6b6e607b1cfc9428f
7
- data.tar.gz: 172872992b14d0b53d1375789a4c2ea76519c4bc8b560fcc9b752fbc68822ada11cea4987ff2b5319a79bd68295d8fc7b71100510f73d49383ea8d79fe7af61b
6
+ metadata.gz: 138f5e2b81b0c2375012bbc6ee4bae97a2af3e53cb83e5f348ee407544c29628a6b4bbc6cdef95f44467ed9180a23ad93a148f6f3b8e2f00bd2768455ea89335
7
+ data.tar.gz: 3775fad99cbc871003c146c8c86cc2a2e1a9ab29f439bfd5b12e0e0c115fd18ba4f70558095f1b48a3a54910361c47e6de20fcb6c514e3ae0ab470a510217aaa
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 2.8.5
2
+ ----------
3
+
4
+ - Fix issue where ServiceDirectory lookups were failing when given a class name, breaking the directory load balancing. (#119)
5
+
1
6
  2.8.4
2
7
  ----------
3
8
 
@@ -91,8 +91,8 @@ module Protobuf
91
91
 
92
92
  def lookup(service)
93
93
  if running?
94
- if @listings_by_service.key?(service)
95
- @listings_by_service[service].entries.sample
94
+ if @listings_by_service.key?(service.to_s)
95
+ @listings_by_service[service.to_s].entries.sample
96
96
  end
97
97
  end
98
98
  end
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.8.4'
2
+ VERSION = '2.8.5'
3
3
  PROTOC_VERSION = '2.5.0'
4
4
  end
@@ -49,6 +49,7 @@ describe ::Protobuf::Rpc::ServiceDirectory do
49
49
  @address = "127.0.0.1"
50
50
  @port = 33333
51
51
  @socket = UDPSocket.new
52
+ EchoService = Class.new
52
53
 
53
54
  described_class.address = @address
54
55
  described_class.port = @port
@@ -202,6 +203,13 @@ describe ::Protobuf::Rpc::ServiceDirectory do
202
203
 
203
204
  subject.lookup("EchoService").port.should eq "7777"
204
205
  end
206
+
207
+ context 'when given service identifier is a class name' do
208
+ it 'returns the listing corresponding to the class name' do
209
+ send_beacon(:heartbeat, echo_server)
210
+ subject.lookup(EchoService).uuid.should eq echo_server.uuid
211
+ end
212
+ end
205
213
  end
206
214
 
207
215
  describe "#restart" do
@@ -239,7 +247,7 @@ describe ::Protobuf::Rpc::ServiceDirectory do
239
247
  let(:servers) {
240
248
  100.times.collect do |x|
241
249
  ::Protobuf::Rpc::DynamicDiscovery::Server.new(
242
- :uuid => server_name = "performance_server#{x + 1}",
250
+ :uuid => "performance_server#{x + 1}",
243
251
  :address => '127.0.0.1',
244
252
  :port => (5555 + x).to_s,
245
253
  :ttl => rand(1..5),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.4
4
+ version: 2.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Neilsen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-06 00:00:00.000000000 Z
13
+ date: 2013-09-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport