protobuf 3.6.1 → 3.6.2

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1ade84f515216bc1d573cf3bf09ddab628bcd315
4
+ data.tar.gz: 57c0b9827e458ed1bfd2ea3d792201bc56e1b7ab
5
+ SHA512:
6
+ metadata.gz: 3caab35f4594aa538e48fc41af7a802e3b99d1c0797d82f2b1a4c0cc5e4256b4bbeea819e36274594009a0ebf21fa5d70d4915ef8cf8d5f9523677d29477bf29
7
+ data.tar.gz: b6da3a96f2d8a4492a981098e964af5c597c439caa5f99316df79a994390c13945a1e297a85bdefb70097ec46e4c9b33eeb94b8298fb1ceaeed8a1415c6ab2bd
@@ -19,6 +19,10 @@ Style/ClassAndModuleChildren:
19
19
  Exclude:
20
20
  - '**/*.pb.rb'
21
21
 
22
+ Style/ClassAndModuleCamelCase:
23
+ Exclude:
24
+ - '**/*.pb.rb'
25
+
22
26
  Style/EmptyLineBetweenDefs:
23
27
  AllowAdjacentOneLineDefs: true
24
28
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # protobuf
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/protobuf.svg)](http://badge.fury.io/rb/protobuf)
4
- [![Build Status](https://secure.travis-ci.org/ruby-protobuf/protobuf.svg?branch=master)](https://travis-ci.org/localshred/protobuf)
5
- [![Gitter chat](https://badges.gitter.im/localshred/protobuf.svg)](https://gitter.im/localshred/protobuf)
4
+ [![Build Status](https://secure.travis-ci.org/ruby-protobuf/protobuf.svg?branch=master)](https://travis-ci.org/ruby-protobuf/protobuf)
5
+ [![Gitter chat](https://badges.gitter.im/ruby-protobuf/protobuf.svg)](https://gitter.im/ruby-protobuf/protobuf)
6
6
  [![protobuf API Documentation](https://www.omniref.com/ruby/gems/protobuf.png)](https://www.omniref.com/ruby/gems/protobuf)
7
7
 
8
8
  Protobuf is an implementation of [Google's protocol buffers][google-pb] in ruby, version 2.5.0 is currently supported.
@@ -22,12 +22,12 @@ an [API roadmap][].
22
22
  See recent changes in the [release notes][] or the [changelog][].
23
23
 
24
24
  [google-pb]: http://code.google.com/p/protobuf "Google Protocol Buffers"
25
- [wiki]: https://github.com/localshred/protobuf/wiki "Wiki home page"
26
- [Installation Guide]: https://github.com/localshred/protobuf/wiki/Installation "Installation guide"
27
- [compiling definitions]: https://github.com/localshred/protobuf/wiki/Compiling-Definitions "Compiling guide"
28
- [object APIs]: https://github.com/localshred/protobuf/wiki/Messages-&-Enums "Message & Enum object APIs guide"
29
- [services]: https://github.com/localshred/protobuf/wiki/Services "Services object API guide"
30
- [clients]: https://github.com/localshred/protobuf/wiki/Clients "Client object API guide"
31
- [API roadmap]: https://github.com/localshred/protobuf/wiki/API-Roadmap "API Roadmap guide"
32
- [release notes]: https://github.com/localshred/protobuf/releases "Release notes"
33
- [changelog]: https://github.com/localshred/protobuf/blob/master/CHANGES.md "CHANGES.md"
25
+ [wiki]: https://github.com/ruby-protobuf/protobuf/wiki "Wiki home page"
26
+ [Installation Guide]: https://github.com/ruby-protobuf/protobuf/wiki/Installation "Installation guide"
27
+ [compiling definitions]: https://github.com/ruby-protobuf/protobuf/wiki/Compiling-Definitions "Compiling guide"
28
+ [object APIs]: https://github.com/ruby-protobuf/protobuf/wiki/Messages-&-Enums "Message & Enum object APIs guide"
29
+ [services]: https://github.com/ruby-protobuf/protobuf/wiki/Services "Services object API guide"
30
+ [clients]: https://github.com/ruby-protobuf/protobuf/wiki/Clients "Client object API guide"
31
+ [API roadmap]: https://github.com/ruby-protobuf/protobuf/wiki/API-Roadmap "API Roadmap guide"
32
+ [release notes]: https://github.com/ruby-protobuf/protobuf/releases "Release notes"
33
+ [changelog]: https://github.com/ruby-protobuf/protobuf/blob/master/CHANGES.md "CHANGES.md"
@@ -19,18 +19,18 @@ module Protobuf
19
19
  # Default is Socket as it has no external dependencies.
20
20
  DEFAULT_CONNECTOR = :socket
21
21
 
22
- module_function
23
-
24
22
  class << self
25
23
  # Client Host
26
24
  #
27
25
  # Default: `hostname` of the system
28
26
  #
29
27
  # The name or address of the host to use during client RPC calls.
30
- attr_accessor :client_host
28
+ attr_writer :client_host
31
29
  end
32
30
 
33
- self.client_host = Socket.gethostname
31
+ def self.client_host
32
+ @client_host ||= Socket.gethostname
33
+ end
34
34
 
35
35
  # Connector Type
36
36
  #
@@ -56,6 +56,9 @@ module Protobuf
56
56
  enum = new(self, name, tag)
57
57
  @enums ||= []
58
58
  @enums << enum
59
+ # defining a new field for the enum will cause cached @values and @mapped_enums
60
+ # to be incorrect; reset them
61
+ @mapped_enums = @values = nil
59
62
  const_set(name, enum)
60
63
  end
61
64
 
@@ -99,6 +99,9 @@ module Protobuf
99
99
  field = ::Protobuf::Field.build(self, rule, type_class, field_name, tag, options)
100
100
  field_store[field_name] = field
101
101
  field_store[tag] = field
102
+ # defining a new field for the message will cause cached @all_fields, @extension_fields,
103
+ # and @fields to be incorrect; reset them
104
+ @all_fields = @extension_fields = @fields = nil
102
105
 
103
106
  str_field_store[field_name.to_s] = field
104
107
 
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.6.1'
2
+ VERSION = '3.6.2'
3
3
  end
@@ -56,5 +56,4 @@ RSpec.describe ::Protobuf::CodeGenerator do
56
56
  end
57
57
  end
58
58
  end
59
-
60
59
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require PROTOS_PATH.join('enum.pb')
2
3
 
3
4
  RSpec.describe Protobuf::Enum do
4
5
 
@@ -183,7 +183,12 @@ RSpec.describe Protobuf::Message do
183
183
  end
184
184
 
185
185
  context 'ignoring unknown fields' do
186
- before { ::Protobuf.ignore_unknown_fields = true }
186
+ around do |example|
187
+ orig = ::Protobuf.ignore_unknown_fields?
188
+ ::Protobuf.ignore_unknown_fields = true
189
+ example.call
190
+ ::Protobuf.ignore_unknown_fields = orig
191
+ end
187
192
 
188
193
  context 'with valid fields' do
189
194
  let(:values) { { :name => "Jim" } }
@@ -203,8 +208,12 @@ RSpec.describe Protobuf::Message do
203
208
  end
204
209
 
205
210
  context 'not ignoring unknown fields' do
206
- before { ::Protobuf.ignore_unknown_fields = false }
207
- after { ::Protobuf.ignore_unknown_fields = true }
211
+ around do |example|
212
+ orig = ::Protobuf.ignore_unknown_fields?
213
+ ::Protobuf.ignore_unknown_fields = false
214
+ example.call
215
+ ::Protobuf.ignore_unknown_fields = orig
216
+ end
208
217
 
209
218
  context 'with valid fields' do
210
219
  let(:values) { { :name => "Jim" } }
@@ -56,9 +56,15 @@ RSpec.describe ::Protobuf do
56
56
  end
57
57
 
58
58
  describe '.print_deprecation_warnings?' do
59
- before { described_class.instance_variable_set(:@print_deprecation_warnings, nil) }
59
+ around do |example|
60
+ orig = described_class.print_deprecation_warnings?
61
+ example.call
62
+ described_class.print_deprecation_warnings = orig
63
+ end
60
64
 
61
65
  it 'defaults to a true value' do
66
+ allow(ENV).to receive(:key?).with('PB_IGNORE_DEPRECATIONS').and_return(false)
67
+ described_class.instance_variable_set('@field_deprecator', nil)
62
68
  expect(described_class.print_deprecation_warnings?).to be true
63
69
  end
64
70
 
@@ -69,20 +75,24 @@ RSpec.describe ::Protobuf do
69
75
 
70
76
  context 'when ENV["PB_IGNORE_DEPRECATIONS"] present' do
71
77
  it 'defaults to a false value' do
72
- ENV['PB_IGNORE_DEPRECATIONS'] = '1'
78
+ allow(ENV).to receive(:key?).with('PB_IGNORE_DEPRECATIONS').and_return(true)
79
+ described_class.instance_variable_set('@field_deprecator', nil)
73
80
  expect(described_class.print_deprecation_warnings?).to be false
74
81
  end
75
82
  end
76
83
  end
77
84
 
78
85
  describe '.ignore_unknown_fields?' do
79
- before do
80
- if described_class.instance_variable_defined?(:@_ignore_unknown_fields)
81
- described_class.send(:remove_instance_variable, :@_ignore_unknown_fields)
82
- end
86
+ around do |example|
87
+ orig = described_class.ignore_unknown_fields?
88
+ example.call
89
+ described_class.ignore_unknown_fields = orig
83
90
  end
84
91
 
85
92
  it 'defaults to a true value' do
93
+ if described_class.instance_variable_defined?('@ignore_unknown_fields')
94
+ described_class.send(:remove_instance_variable, '@ignore_unknown_fields')
95
+ end
86
96
  expect(described_class.ignore_unknown_fields?).to be true
87
97
  end
88
98
 
metadata CHANGED
@@ -1,257 +1,184 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
5
- prerelease:
4
+ version: 3.6.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - BJ Neilsen
9
8
  - Brandon Dewitt
10
9
  - Devin Christensen
11
10
  - Adam Hutchison
12
- autorequire:
11
+ autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2016-02-01 00:00:00.000000000 Z
14
+ date: 2016-02-02 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
- name: activesupport
19
17
  requirement: !ruby/object:Gem::Requirement
20
- none: false
21
18
  requirements:
22
- - - ! '>='
19
+ - - ">="
23
20
  - !ruby/object:Gem::Version
24
21
  version: '3.2'
25
- type: :runtime
22
+ name: activesupport
26
23
  prerelease: false
24
+ type: :runtime
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
- - - ! '>='
27
+ - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: '3.2'
33
30
  - !ruby/object:Gem::Dependency
34
- name: middleware
35
31
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
32
  requirements:
38
- - - ! '>='
33
+ - - ">="
39
34
  - !ruby/object:Gem::Version
40
35
  version: '0'
41
- type: :runtime
36
+ name: middleware
42
37
  prerelease: false
38
+ type: :runtime
43
39
  version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
40
  requirements:
46
- - - ! '>='
41
+ - - ">="
47
42
  - !ruby/object:Gem::Version
48
43
  version: '0'
49
44
  - !ruby/object:Gem::Dependency
50
- name: thor
51
45
  requirement: !ruby/object:Gem::Requirement
52
- none: false
53
46
  requirements:
54
- - - ! '>='
47
+ - - ">="
55
48
  - !ruby/object:Gem::Version
56
49
  version: '0'
57
- type: :runtime
50
+ name: thor
58
51
  prerelease: false
52
+ type: :runtime
59
53
  version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
54
  requirements:
62
- - - ! '>='
55
+ - - ">="
63
56
  - !ruby/object:Gem::Version
64
57
  version: '0'
65
58
  - !ruby/object:Gem::Dependency
66
- name: thread_safe
67
59
  requirement: !ruby/object:Gem::Requirement
68
- none: false
69
60
  requirements:
70
- - - ! '>='
61
+ - - ">="
71
62
  - !ruby/object:Gem::Version
72
63
  version: '0'
73
- type: :runtime
64
+ name: thread_safe
74
65
  prerelease: false
66
+ type: :runtime
75
67
  version_requirements: !ruby/object:Gem::Requirement
76
- none: false
77
68
  requirements:
78
- - - ! '>='
69
+ - - ">="
79
70
  - !ruby/object:Gem::Version
80
71
  version: '0'
81
72
  - !ruby/object:Gem::Dependency
82
- name: ffi-rzmq
83
73
  requirement: !ruby/object:Gem::Requirement
84
- none: false
85
74
  requirements:
86
- - - ! '>='
75
+ - - ">="
87
76
  - !ruby/object:Gem::Version
88
77
  version: '0'
89
- type: :development
78
+ name: ffi-rzmq
90
79
  prerelease: false
80
+ type: :development
91
81
  version_requirements: !ruby/object:Gem::Requirement
92
- none: false
93
82
  requirements:
94
- - - ! '>='
83
+ - - ">="
95
84
  - !ruby/object:Gem::Version
96
85
  version: '0'
97
86
  - !ruby/object:Gem::Dependency
98
- name: rake
99
87
  requirement: !ruby/object:Gem::Requirement
100
- none: false
101
88
  requirements:
102
- - - ! '>='
89
+ - - ">="
103
90
  - !ruby/object:Gem::Version
104
91
  version: '0'
105
- type: :development
92
+ name: rake
106
93
  prerelease: false
94
+ type: :development
107
95
  version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
96
  requirements:
110
- - - ! '>='
97
+ - - ">="
111
98
  - !ruby/object:Gem::Version
112
99
  version: '0'
113
100
  - !ruby/object:Gem::Dependency
114
- name: rspec
115
101
  requirement: !ruby/object:Gem::Requirement
116
- none: false
117
102
  requirements:
118
- - - ! '>='
103
+ - - ">="
119
104
  - !ruby/object:Gem::Version
120
105
  version: '3.0'
121
- type: :development
106
+ name: rspec
122
107
  prerelease: false
108
+ type: :development
123
109
  version_requirements: !ruby/object:Gem::Requirement
124
- none: false
125
110
  requirements:
126
- - - ! '>='
111
+ - - ">="
127
112
  - !ruby/object:Gem::Version
128
113
  version: '3.0'
129
114
  - !ruby/object:Gem::Dependency
130
- name: rubocop
131
115
  requirement: !ruby/object:Gem::Requirement
132
- none: false
133
116
  requirements:
134
117
  - - '='
135
118
  - !ruby/object:Gem::Version
136
119
  version: 0.34.2
137
- type: :development
120
+ name: rubocop
138
121
  prerelease: false
122
+ type: :development
139
123
  version_requirements: !ruby/object:Gem::Requirement
140
- none: false
141
124
  requirements:
142
125
  - - '='
143
126
  - !ruby/object:Gem::Version
144
127
  version: 0.34.2
145
128
  - !ruby/object:Gem::Dependency
146
- name: simplecov
147
129
  requirement: !ruby/object:Gem::Requirement
148
- none: false
149
130
  requirements:
150
- - - ! '>='
131
+ - - ">="
151
132
  - !ruby/object:Gem::Version
152
133
  version: '0'
153
- type: :development
134
+ name: simplecov
154
135
  prerelease: false
155
- version_requirements: !ruby/object:Gem::Requirement
156
- none: false
157
- requirements:
158
- - - ! '>='
159
- - !ruby/object:Gem::Version
160
- version: '0'
161
- - !ruby/object:Gem::Dependency
162
- name: timecop
163
- requirement: !ruby/object:Gem::Requirement
164
- none: false
165
- requirements:
166
- - - ! '>='
167
- - !ruby/object:Gem::Version
168
- version: '0'
169
136
  type: :development
170
- prerelease: false
171
137
  version_requirements: !ruby/object:Gem::Requirement
172
- none: false
173
138
  requirements:
174
- - - ! '>='
139
+ - - ">="
175
140
  - !ruby/object:Gem::Version
176
141
  version: '0'
177
142
  - !ruby/object:Gem::Dependency
178
- name: yard
179
143
  requirement: !ruby/object:Gem::Requirement
180
- none: false
181
144
  requirements:
182
- - - ! '>='
145
+ - - ">="
183
146
  - !ruby/object:Gem::Version
184
147
  version: '0'
185
- type: :development
148
+ name: timecop
186
149
  prerelease: false
187
- version_requirements: !ruby/object:Gem::Requirement
188
- none: false
189
- requirements:
190
- - - ! '>='
191
- - !ruby/object:Gem::Version
192
- version: '0'
193
- - !ruby/object:Gem::Dependency
194
- name: pry-debugger
195
- requirement: !ruby/object:Gem::Requirement
196
- none: false
197
- requirements:
198
- - - ! '>='
199
- - !ruby/object:Gem::Version
200
- version: '0'
201
150
  type: :development
202
- prerelease: false
203
151
  version_requirements: !ruby/object:Gem::Requirement
204
- none: false
205
152
  requirements:
206
- - - ! '>='
153
+ - - ">="
207
154
  - !ruby/object:Gem::Version
208
155
  version: '0'
209
156
  - !ruby/object:Gem::Dependency
210
- name: pry-stack_explorer
211
157
  requirement: !ruby/object:Gem::Requirement
212
- none: false
213
158
  requirements:
214
- - - ! '>='
159
+ - - ">="
215
160
  - !ruby/object:Gem::Version
216
161
  version: '0'
217
- type: :development
162
+ name: yard
218
163
  prerelease: false
219
- version_requirements: !ruby/object:Gem::Requirement
220
- none: false
221
- requirements:
222
- - - ! '>='
223
- - !ruby/object:Gem::Version
224
- version: '0'
225
- - !ruby/object:Gem::Dependency
226
- name: varint
227
- requirement: !ruby/object:Gem::Requirement
228
- none: false
229
- requirements:
230
- - - ! '>='
231
- - !ruby/object:Gem::Version
232
- version: '0'
233
164
  type: :development
234
- prerelease: false
235
165
  version_requirements: !ruby/object:Gem::Requirement
236
- none: false
237
166
  requirements:
238
- - - ! '>='
167
+ - - ">="
239
168
  - !ruby/object:Gem::Version
240
169
  version: '0'
241
170
  - !ruby/object:Gem::Dependency
242
- name: ruby-prof
243
171
  requirement: !ruby/object:Gem::Requirement
244
- none: false
245
172
  requirements:
246
- - - ! '>='
173
+ - - ">="
247
174
  - !ruby/object:Gem::Version
248
175
  version: '0'
249
- type: :development
176
+ name: pry
250
177
  prerelease: false
178
+ type: :development
251
179
  version_requirements: !ruby/object:Gem::Requirement
252
- none: false
253
180
  requirements:
254
- - - ! '>='
181
+ - - ">="
255
182
  - !ruby/object:Gem::Version
256
183
  version: '0'
257
184
  description: Google Protocol Buffers serialization and RPC implementation for Ruby.
@@ -266,11 +193,11 @@ executables:
266
193
  extensions: []
267
194
  extra_rdoc_files: []
268
195
  files:
269
- - .gitignore
270
- - .rubocop.yml
271
- - .rubocop_todo.yml
272
- - .travis.yml
273
- - .yardopts
196
+ - ".gitignore"
197
+ - ".rubocop.yml"
198
+ - ".rubocop_todo.yml"
199
+ - ".travis.yml"
200
+ - ".yardopts"
274
201
  - CHANGES.md
275
202
  - CONTRIBUTING.md
276
203
  - Gemfile
@@ -449,33 +376,26 @@ files:
449
376
  homepage: https://github.com/localshred/protobuf
450
377
  licenses:
451
378
  - MIT
452
- post_install_message:
379
+ metadata: {}
380
+ post_install_message:
453
381
  rdoc_options: []
454
382
  require_paths:
455
383
  - lib
456
384
  required_ruby_version: !ruby/object:Gem::Requirement
457
- none: false
458
385
  requirements:
459
- - - ! '>='
386
+ - - ">="
460
387
  - !ruby/object:Gem::Version
461
388
  version: '0'
462
- segments:
463
- - 0
464
- hash: 752985443878971570
465
389
  required_rubygems_version: !ruby/object:Gem::Requirement
466
- none: false
467
390
  requirements:
468
- - - ! '>='
391
+ - - ">="
469
392
  - !ruby/object:Gem::Version
470
393
  version: '0'
471
- segments:
472
- - 0
473
- hash: 752985443878971570
474
394
  requirements: []
475
- rubyforge_project:
476
- rubygems_version: 1.8.24
477
- signing_key:
478
- specification_version: 3
395
+ rubyforge_project:
396
+ rubygems_version: 2.4.8
397
+ signing_key:
398
+ specification_version: 4
479
399
  summary: Google Protocol Buffers serialization and RPC implementation for Ruby.
480
400
  test_files: []
481
- has_rdoc:
401
+ has_rdoc: