beefcake 0.1.0 → 0.1.1
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.
- data/README.md +9 -7
- data/lib/beefcake/buffer/base.rb +3 -1
- data/lib/beefcake/buffer/encode.rb +6 -6
- data/test/message_test.rb +6 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -95,22 +95,24 @@ Source:
|
|
95
95
|
|
96
96
|
$ git clone git://github.com/bmizerany/beefcake
|
97
97
|
|
98
|
-
Testing:
|
98
|
+
## Testing:
|
99
99
|
|
100
100
|
$ gem install turn
|
101
101
|
$ cd /path/to/beefcake
|
102
102
|
$ turn
|
103
103
|
|
104
|
-
VMs:
|
104
|
+
## VMs:
|
105
105
|
|
106
106
|
Currently Beefcake is tested and working on:
|
107
107
|
|
108
|
-
|
109
|
-
|
110
|
-
|
108
|
+
* Ruby 1.8.7
|
109
|
+
* Ruby 1.9.2
|
110
|
+
* JRuby 1.5.6
|
111
111
|
|
112
|
-
|
113
|
-
|
112
|
+
There is a bug in Rubinius preventing proper ZigZag encoding.
|
113
|
+
The team is aware and I'm sure they're working on a fix.
|
114
|
+
|
115
|
+
## Future
|
114
116
|
|
115
117
|
Nice to have:
|
116
118
|
|
data/lib/beefcake/buffer/base.rb
CHANGED
@@ -14,7 +14,7 @@ module Beefcake
|
|
14
14
|
|
15
15
|
def self.wire_for(type)
|
16
16
|
case type
|
17
|
-
when :int32, :uint32, :sint32, :int64, :uint64, :sint64, :bool
|
17
|
+
when :int32, :uint32, :sint32, :int64, :uint64, :sint64, :bool, Module
|
18
18
|
0
|
19
19
|
when :fixed64, :sfixed64, :double
|
20
20
|
1
|
@@ -82,6 +82,8 @@ module Beefcake
|
|
82
82
|
case n
|
83
83
|
when Symbol
|
84
84
|
__send__("read_#{n}")
|
85
|
+
when Module
|
86
|
+
read_uint64
|
85
87
|
else
|
86
88
|
buf.slice!(0, n)
|
87
89
|
end
|
@@ -18,7 +18,7 @@ module Beefcake
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def append_fixed32(n, tag=false)
|
21
|
-
if n < MinUint32
|
21
|
+
if n < MinUint32 || n > MaxUint32
|
22
22
|
raise OutOfRangeError, n
|
23
23
|
end
|
24
24
|
|
@@ -26,7 +26,7 @@ module Beefcake
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def append_fixed64(n)
|
29
|
-
if n < MinUint64
|
29
|
+
if n < MinUint64 || n > MaxUint64
|
30
30
|
raise OutOfRangeError, n
|
31
31
|
end
|
32
32
|
|
@@ -34,7 +34,7 @@ module Beefcake
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def append_int32(n)
|
37
|
-
if n < MinInt32
|
37
|
+
if n < MinInt32 || n > MaxInt32
|
38
38
|
raise OutOfRangeError, n
|
39
39
|
end
|
40
40
|
|
@@ -42,7 +42,7 @@ module Beefcake
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def append_uint32(n)
|
45
|
-
if n < MinUint32
|
45
|
+
if n < MinUint32 || n > MaxUint32
|
46
46
|
raise OutOfRangeError, n
|
47
47
|
end
|
48
48
|
|
@@ -50,7 +50,7 @@ module Beefcake
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def append_int64(n)
|
53
|
-
if n < MinInt64
|
53
|
+
if n < MinInt64 || n > MaxInt64
|
54
54
|
raise OutOfRangeError, n
|
55
55
|
end
|
56
56
|
|
@@ -78,7 +78,7 @@ module Beefcake
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def append_uint64(n)
|
81
|
-
if n < MinUint64
|
81
|
+
if n < MinUint64 || n > MaxUint64
|
82
82
|
raise OutOfRangeError, n
|
83
83
|
end
|
84
84
|
|
data/test/message_test.rb
CHANGED