protobuf 2.8.3 → 2.8.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce09086e344463e2c1193ad642e5ddf90186a40b
|
4
|
+
data.tar.gz: e215cd2b66f2a290ed0193a4dae2ec7329780de5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c1d0bea9a61d7d6b921ec859419ebbdac79a75efc54987b5cbaa7a378069d75755e6d04c47ab2c2d1b5f4fd71d206b2a89d5fe069db5e6b6e607b1cfc9428f
|
7
|
+
data.tar.gz: 172872992b14d0b53d1375789a4c2ea76519c4bc8b560fcc9b752fbc68822ada11cea4987ff2b5319a79bd68295d8fc7b71100510f73d49383ea8d79fe7af61b
|
data/CHANGES.md
CHANGED
@@ -10,8 +10,9 @@ module Protobuf
|
|
10
10
|
bytes
|
11
11
|
end
|
12
12
|
|
13
|
+
# TODO: make replace character configurable?
|
13
14
|
def encode(value)
|
14
|
-
|
15
|
+
value = value.dup if value.frozen?
|
15
16
|
value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "")
|
16
17
|
value.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING)
|
17
18
|
|
data/lib/protobuf/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Protobuf::Field::StringField do
|
4
|
+
describe '#encode' do
|
5
|
+
context 'when a repeated string field contains frozen strings' do
|
6
|
+
it 'does not raise an encoding error' do
|
7
|
+
expect {
|
8
|
+
frozen_strings = [ "foo".freeze, "bar".freeze, "baz".freeze ]
|
9
|
+
::Test::ResourceFindRequest.encode(:name => 'resource', :widgets => frozen_strings)
|
10
|
+
}.not_to raise_error
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when a repeated bytes field contains frozen strings' do
|
15
|
+
it 'does not raise an encoding error' do
|
16
|
+
expect {
|
17
|
+
frozen_strings = [ "foo".freeze, "bar".freeze, "baz".freeze ]
|
18
|
+
::Test::ResourceFindRequest.encode(:name => 'resource', :widget_bytes => frozen_strings)
|
19
|
+
}.not_to raise_error
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -49,6 +49,8 @@ module Test
|
|
49
49
|
class ResourceFindRequest
|
50
50
|
required ::Protobuf::Field::StringField, :name, 1
|
51
51
|
optional ::Protobuf::Field::BoolField, :active, 2
|
52
|
+
repeated ::Protobuf::Field::StringField, :widgets, 3
|
53
|
+
repeated ::Protobuf::Field::BytesField, :widget_bytes, 4
|
52
54
|
end
|
53
55
|
|
54
56
|
class ResourceSleepRequest
|
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
|
+
version: 2.8.4
|
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-
|
13
|
+
date: 2013-09-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -292,6 +292,7 @@ files:
|
|
292
292
|
- spec/lib/protobuf/enum_spec.rb
|
293
293
|
- spec/lib/protobuf/enum_value_spec.rb
|
294
294
|
- spec/lib/protobuf/field/int32_field_spec.rb
|
295
|
+
- spec/lib/protobuf/field/string_field_spec.rb
|
295
296
|
- spec/lib/protobuf/generators/base_spec.rb
|
296
297
|
- spec/lib/protobuf/generators/enum_generator_spec.rb
|
297
298
|
- spec/lib/protobuf/generators/extension_generator_spec.rb
|
@@ -385,6 +386,7 @@ test_files:
|
|
385
386
|
- spec/lib/protobuf/enum_spec.rb
|
386
387
|
- spec/lib/protobuf/enum_value_spec.rb
|
387
388
|
- spec/lib/protobuf/field/int32_field_spec.rb
|
389
|
+
- spec/lib/protobuf/field/string_field_spec.rb
|
388
390
|
- spec/lib/protobuf/generators/base_spec.rb
|
389
391
|
- spec/lib/protobuf/generators/enum_generator_spec.rb
|
390
392
|
- spec/lib/protobuf/generators/extension_generator_spec.rb
|