beefcake 1.1.0.pre1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/README.md +1 -2
- data/RELEASE_NOTES.md +13 -2
- data/lib/beefcake.rb +6 -2
- data/lib/beefcake/generator.rb +2 -1
- data/lib/beefcake/version.rb +1 -1
- data/test/message_test.rb +7 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed744b9caa6b57789377796034a56352d1e00021
|
4
|
+
data.tar.gz: fecc18649eff37cd0d8fb136d96c8c7293269d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50f43b7f70831ee864940dde83a2cc995d809cfe5a7e3b71dc1cf86aa98ccb000655765a47c797aa5c4e7c2a3f5d433734a6b99b89c2f924567672c4df341dff
|
7
|
+
data.tar.gz: 34fafc2e4c3d257e4a34854384e31b3260a5232caf50fc9b329c535003c90112188368d376536ecbaceaa73b7f25985b1004089ccb8624b12fad31fc60584071
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/RELEASE_NOTES.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# Beefcake Release Notes
|
2
2
|
|
3
|
-
#
|
3
|
+
# 1.1.0 - 2015-05-26
|
4
|
+
|
5
|
+
Release 1.1.0 includes improvements and bug fixes.
|
6
|
+
|
7
|
+
* Correct message-hash conversion behavior, fixed by Peter "kybu" Vrabel.
|
8
|
+
* Remove trailing whitespace in generator output without package name.
|
9
|
+
* Allow a Hash instead of an Array<Hash> when assigning a repeated field that's
|
10
|
+
only repeated once.
|
11
|
+
* Ensure object identities are persisted through message initialization,
|
12
|
+
reported by Peter Neubauer.
|
13
|
+
|
14
|
+
# 1.0.0 - 2014-09-05
|
4
15
|
|
5
16
|
Release 1.0.0 includes changes and improvements.
|
6
17
|
|
@@ -21,7 +32,7 @@ Release 0.5.0 corrects a few behaviors.
|
|
21
32
|
* Don't crash when attempting to reencode frozen strings,
|
22
33
|
found thanks to Kyle "Aphyr" Kingsbury
|
23
34
|
* Return `nil` instead of raising a generic Ruby error when trying to
|
24
|
-
decode a zero-length buffer, fixed by Tobias "grobie" Schmidt
|
35
|
+
decode a zero-length buffer, fixed by Tobias "grobie" Schmidt
|
25
36
|
|
26
37
|
# 0.4.0 - 2013-10-10
|
27
38
|
|
data/lib/beefcake.rb
CHANGED
@@ -38,6 +38,10 @@ module Beefcake
|
|
38
38
|
type == obj
|
39
39
|
end
|
40
40
|
|
41
|
+
def matches_type?(obj)
|
42
|
+
obj.is_a? type
|
43
|
+
end
|
44
|
+
|
41
45
|
def is_protobuf?
|
42
46
|
type.is_a?(Class) and type.include?(Beefcake::Message)
|
43
47
|
end
|
@@ -284,12 +288,12 @@ module Beefcake
|
|
284
288
|
|
285
289
|
if fld.repeated?
|
286
290
|
self[fld.name] = attribute.map do |i|
|
287
|
-
fld.
|
291
|
+
fld.matches_type?(i) ? i : fld.type.new(i)
|
288
292
|
end
|
289
293
|
next
|
290
294
|
end
|
291
295
|
|
292
|
-
if fld.
|
296
|
+
if fld.matches_type? attribute
|
293
297
|
self[fld.name] = attribute
|
294
298
|
next
|
295
299
|
end
|
data/lib/beefcake/generator.rb
CHANGED
@@ -269,7 +269,8 @@ module Beefcake
|
|
269
269
|
end
|
270
270
|
|
271
271
|
def compile(ns, file)
|
272
|
-
|
272
|
+
package_part = file.package ? "for #{file.package}" : ''
|
273
|
+
puts "## Generated from #{file.name} #{package_part}".strip
|
273
274
|
puts "require \"beefcake\""
|
274
275
|
puts
|
275
276
|
|
data/lib/beefcake/version.rb
CHANGED
data/test/message_test.rb
CHANGED
@@ -471,6 +471,13 @@ class MessageTest < Minitest::Test
|
|
471
471
|
refute_equal :symbol, d
|
472
472
|
end
|
473
473
|
|
474
|
+
def test_object_identity
|
475
|
+
inside = [SimpleMessage.new(a: 12345)]
|
476
|
+
outside = RepeatedNestedMessage.new simple: inside
|
477
|
+
|
478
|
+
assert_equal outside.simple.first.object_id, inside.first.object_id
|
479
|
+
end
|
480
|
+
|
474
481
|
def test_inspect
|
475
482
|
msg = SimpleMessage.new :a => 1
|
476
483
|
assert_equal "<SimpleMessage a: 1>", msg.inspect
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beefcake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -89,12 +89,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: 1.9.3
|
90
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- - "
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
94
|
+
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.4.
|
97
|
+
rubygems_version: 2.4.6
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: A sane protobuf library for Ruby
|