protobuf 2.6.3-java → 2.6.4-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -3
- data/README.md +2 -1
- data/ext/ruby_generator/RubyGenerator.cpp +1 -1
- data/ext/ruby_generator/RubyGenerator.h +0 -1
- data/lib/protobuf/enum.rb +1 -1
- data/lib/protobuf/version.rb +1 -1
- data/spec/lib/protobuf/cli_spec.rb +15 -8
- data/spec/lib/protobuf/enum_spec.rb +4 -2
- data/spec/spec_helper.rb +3 -0
- metadata +2 -2
data/.travis.yml
CHANGED
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.
|
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();
|
data/lib/protobuf/enum.rb
CHANGED
data/lib/protobuf/version.rb
CHANGED
@@ -121,16 +121,23 @@ describe ::Protobuf::CLI do
|
|
121
121
|
context 'when not given' do
|
122
122
|
let(:test_args) { [] }
|
123
123
|
|
124
|
-
|
125
|
-
|
126
|
-
|
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
|
-
|
130
|
-
ENV["PB_IGNORE_DEPRECATIONS"] = "1"
|
131
|
-
|
132
|
-
|
133
|
-
|
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)
|
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
|
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.
|
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-
|
13
|
+
date: 2013-01-28 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|