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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30ed4bf45f17475a8deb5a11bf4b53cecae450b8
4
- data.tar.gz: bd1faca7f9bb8691ef60b3c0a1b7ae0b4d08ec98
3
+ metadata.gz: ed744b9caa6b57789377796034a56352d1e00021
4
+ data.tar.gz: fecc18649eff37cd0d8fb136d96c8c7293269d5c
5
5
  SHA512:
6
- metadata.gz: 21fa7ab6f0d1dc688bda21ca235ccf4cafdcf642431923944661b591f336105f349ac52d06fe98d95cdbf5acb4582b7804dc79606c731e6366797f286fe8415a
7
- data.tar.gz: 2c3e38af30b33354952d1fc7897db4a1bcc105e12e92ac73ec4fc8c5e70dcf4602959c8e6046bdbc31cc924621aa488683ed62a7d55c7160745f776d6899bd00
6
+ metadata.gz: 50f43b7f70831ee864940dde83a2cc995d809cfe5a7e3b71dc1cf86aa98ccb000655765a47c797aa5c4e7c2a3f5d433734a6b99b89c2f924567672c4df341dff
7
+ data.tar.gz: 34fafc2e4c3d257e4a34854384e31b3260a5232caf50fc9b329c535003c90112188368d376536ecbaceaa73b7f25985b1004089ccb8624b12fad31fc60584071
@@ -3,10 +3,13 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.0
6
- - 2.1.5
6
+ - 2.1.6
7
7
  - 2.2.0
8
+ - 2.2.1
9
+ - 2.2.2
8
10
  - jruby-19mode
9
11
  - rbx-2.2.7
12
+ - jruby-9.0.0.0.pre2
10
13
  - ruby-head
11
14
  - jruby-head
12
15
  matrix:
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Beefcake
2
2
 
3
- A sane Google Protocol Buffers library for Ruby. It's all about being Buf;
4
- ProtoBuf.
3
+ A pure-Ruby Google Protocol Buffers library. It's all about being Buf; ProtoBuf.
5
4
 
6
5
  ## Installation
7
6
 
@@ -1,6 +1,17 @@
1
1
  # Beefcake Release Notes
2
2
 
3
- # 0.1.0 - 2014-09-05
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
 
@@ -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.same_type?(i) ? i : fld.type.new(i)
291
+ fld.matches_type?(i) ? i : fld.type.new(i)
288
292
  end
289
293
  next
290
294
  end
291
295
 
292
- if fld.same_type? attribute
296
+ if fld.matches_type? attribute
293
297
  self[fld.name] = attribute
294
298
  next
295
299
  end
@@ -269,7 +269,8 @@ module Beefcake
269
269
  end
270
270
 
271
271
  def compile(ns, file)
272
- puts "## Generated from #{file.name} for #{file.package}"
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
 
@@ -1,3 +1,3 @@
1
1
  module Beefcake
2
- VERSION = "1.1.0.pre1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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.pre1
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-01-23 00:00:00.000000000 Z
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: 1.3.1
94
+ version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.4.5
97
+ rubygems_version: 2.4.6
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: A sane protobuf library for Ruby