protobuf 2.6.3-java → 2.6.4-java

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.
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - "1.9.2"
4
4
  - "1.9.3"
5
- - jruby-19mode
6
- - ruby-head
7
- - jruby-head
8
5
  script: NO_COMPILE_TEST_PROTOS=1 bundle exec rake spec
6
+ before_install:
7
+ - sudo apt-get install -qq libzmq-dev
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # protobuf
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/protobuf.png)](http://badge.fury.io/rb/protobuf)
3
4
  [![Build Status](https://secure.travis-ci.org/localshred/protobuf.png?branch=master)](https://travis-ci.org/localshred/protobuf)
4
5
 
5
6
  ***IMPORTANT: Those upgrading from version 1.4.2 to 2.X should read the [UPGRADING.md](https://github.com/localshred/protobuf/blob/master/UPGRADING.md) notes***
6
7
 
7
- Protobuf is an implementation of [Google's protocol buffers][google-pb] in ruby. We currently support version 2.4.0. It's a gem for managing 3 things:
8
+ Protobuf is an implementation of [Google's protocol buffers][google-pb] in ruby. We currently support version 2.4.1 with support for the new 2.5 coming shortly after it becomes final. It's a gem for managing 3 things:
8
9
 
9
10
  1. Generating ruby classes from `.proto` files.
10
11
  2. Provide an RPC mechanism for calling remote services.
@@ -114,7 +114,7 @@ void RubyGenerator::PrintMessage(const Descriptor* descriptor, bool print_fields
114
114
  map<string,string> data;
115
115
  data["class_name"] = descriptor->name();
116
116
 
117
- if (print_fields) {
117
+ if (print_fields && (descriptor->field_count() > 0 || descriptor->extension_count() > 0)) {
118
118
  printer_->Print(data, "class $class_name$");
119
119
  PrintNewLine();
120
120
  printer_->Indent();
@@ -118,7 +118,6 @@ class LIBPROTOC_EXPORT RubyGenerator : public CodeGenerator {
118
118
  }
119
119
  else if (c == 95) { // underscore char
120
120
  segment_end = true;
121
- continue;
122
121
  }
123
122
  else if (segment_end) {
124
123
  if (c >= 97 && c <= 122) { // a-z chars
data/lib/protobuf/enum.rb CHANGED
@@ -7,7 +7,7 @@ module Protobuf
7
7
  enum_value = ::Protobuf::EnumValue.new(self, name, value)
8
8
  const_set(name, enum_value)
9
9
  @values ||= {}
10
- @names ||= []
10
+ @names ||= {}
11
11
  @values[name] = enum_value
12
12
  @names[value] = name
13
13
  end
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.6.3'
2
+ VERSION = '2.6.4'
3
3
  PROTOC_VERSION = '2.4.1'
4
4
  end
@@ -121,16 +121,23 @@ describe ::Protobuf::CLI do
121
121
  context 'when not given' do
122
122
  let(:test_args) { [] }
123
123
 
124
- it 'sets the deprecation warning flag to true when no ENV is present and no command line option' do
125
- described_class.start(args)
126
- ::Protobuf.print_deprecation_warnings?.should be_true
124
+ context 'when no ENV is present and no command line option' do
125
+ before { ENV.delete("PB_IGNORE_DEPRECATIONS") }
126
+
127
+ it 'sets the deprecation warning flag to true' do
128
+ described_class.start(args)
129
+ ::Protobuf.print_deprecation_warnings?.should be_true
130
+ end
127
131
  end
128
132
 
129
- it 'sets the deprecation warning flag to false if ENV["PB_IGNORE_DEPRECATIONS"] is present' do
130
- ENV["PB_IGNORE_DEPRECATIONS"] = "1"
131
- described_class.start(args)
132
- ::Protobuf.print_deprecation_warnings?.should be_false
133
- ENV.delete("PB_IGNORE_DEPRECATIONS")
133
+ context 'if ENV["PB_IGNORE_DEPRECATIONS"] is present' do
134
+ before { ENV["PB_IGNORE_DEPRECATIONS"] = "1" }
135
+ after { ENV.delete("PB_IGNORE_DEPRECATIONS") }
136
+
137
+ it 'sets the deprecation warning flag to false ' do
138
+ described_class.start(args)
139
+ ::Protobuf.print_deprecation_warnings?.should be_false
140
+ end
134
141
  end
135
142
  end
136
143
 
@@ -2,9 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe Protobuf::Enum do
4
4
  let(:name) { :THREE }
5
- let(:tag) { 3 }
5
+ let(:tag) { 3 }
6
6
 
7
7
  before(:all) do
8
+ Test::EnumTestType.define(:MINUS_ONE, -1)
8
9
  Test::EnumTestType.define(name, tag)
9
10
  end
10
11
 
@@ -47,7 +48,7 @@ describe Protobuf::Enum do
47
48
 
48
49
  describe '.enum_by_value' do
49
50
  it 'gets the EnumValue corresponding to the given value (tag)' do
50
- Test::EnumTestType.enum_by_value(tag).should eq Test::EnumTestType::THREE
51
+ Test::EnumTestType.enum_by_value(tag).should eq Test::EnumTestType.const_get(name)
51
52
  end
52
53
  end
53
54
 
@@ -82,6 +83,7 @@ describe Protobuf::Enum do
82
83
  describe '.values' do
83
84
  it 'provides a hash of defined EnumValues' do
84
85
  Test::EnumTestType.values.should eq({
86
+ :MINUS_ONE => Test::EnumTestType::MINUS_ONE,
85
87
  :ONE => Test::EnumTestType::ONE,
86
88
  :TWO => Test::EnumTestType::TWO,
87
89
  :THREE => Test::EnumTestType::THREE
data/spec/spec_helper.rb CHANGED
@@ -18,6 +18,9 @@ if ENV["DEBUG"]
18
18
  ::Protobuf::Logger.configure(:file => debug_log, :level => ::Logger::DEBUG)
19
19
  end
20
20
 
21
+ # Get rid of the deprecation env var if present (messes with specs).
22
+ ENV.delete("PB_IGNORE_DEPRECATIONS")
23
+
21
24
  ::RSpec.configure do |c|
22
25
  c.include(::Sander6::CustomMatchers)
23
26
  c.mock_with :rspec
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.6.3
5
+ version: 2.6.4
6
6
  platform: java
7
7
  authors:
8
8
  - BJ Neilsen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-15 00:00:00.000000000Z
13
+ date: 2013-01-28 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport