protobuf 2.2.5-java → 2.2.6-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ module Protobuf
18
18
  def self.fetch(value)
19
19
  case value
20
20
  when ::Protobuf::EnumValue then
21
- value
21
+ value.value
22
22
  when Numeric then
23
23
  enum_by_value(value.to_i)
24
24
  when String, Symbol then
@@ -41,7 +41,11 @@ module Protobuf
41
41
  end
42
42
 
43
43
  def to_i
44
- @value.to_i
44
+ @value
45
+ end
46
+
47
+ def to_int
48
+ @value.to_int
45
49
  end
46
50
 
47
51
  def to_s(format = :value_string)
@@ -33,7 +33,7 @@ module Protobuf
33
33
  end
34
34
 
35
35
  def log_signature
36
- @_log_signature ||= "client-#{self.class}"
36
+ @_log_signature ||= "[client-#{self.class}]"
37
37
  end
38
38
 
39
39
  # Set a complete callback on the client to return the object (self).
@@ -58,7 +58,7 @@ module Protobuf
58
58
  end
59
59
 
60
60
  def log_signature
61
- @_log_signature ||= "client-#{self.class}"
61
+ @_log_signature ||= "[client-#{self.class}]"
62
62
  end
63
63
 
64
64
  def parse_response
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.2.5'
2
+ VERSION = '2.2.6'
3
3
  PROTOC_VERSION = '2.4.1'
4
4
  end
@@ -12,4 +12,8 @@ describe Protobuf::EnumValue do
12
12
  its(:inspect) { should eq('#<Protobuf::EnumValue Test::EnumTestType::ONE=1>') }
13
13
  specify { subject.to_s(:name).should eq("ONE") }
14
14
 
15
+ it "can be used as the index to an array" do
16
+ array = [0, 1, 2, 3]
17
+ array[::Test::EnumTestType::ONE].should eq(1)
18
+ end
15
19
  end
@@ -23,12 +23,14 @@ end
23
23
  c.mock_with :rspec
24
24
 
25
25
  c.before(:suite) do
26
- unless ENV['NO_COMPILE_TEST_PROTOS']
27
- $stdout.puts 'Compiling test protos (use NO_COMPILE_TEST_PROTOS=1 to skip)'
28
- proto_path = File.expand_path("../support/", __FILE__)
29
- cmd = %Q{ rprotoc --proto_path=#{proto_path} --ruby_out=#{proto_path} #{File.join(proto_path, '**', '*.proto')} }
30
- puts cmd
31
- %x{#{cmd}}
26
+ unless defined?(JRUBY_VERSION)
27
+ unless ENV['NO_COMPILE_TEST_PROTOS']
28
+ $stdout.puts 'Compiling test protos (use NO_COMPILE_TEST_PROTOS=1 to skip)'
29
+ proto_path = File.expand_path("../support/", __FILE__)
30
+ cmd = %Q{ rprotoc --proto_path=#{proto_path} --ruby_out=#{proto_path} #{File.join(proto_path, '**', '*.proto')} }
31
+ puts cmd
32
+ %x{#{cmd}}
33
+ end
32
34
  end
33
35
  end
34
36
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.2.5
5
+ version: 2.2.6
6
6
  platform: java
7
7
  authors:
8
8
  - BJ Neilsen