erlectricity 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -1
- data/VERSION.yml +1 -1
- data/ext/decoder.c +1 -1
- data/test/decode_spec.rb +1 -0
- data/test/encode_spec.rb +1 -0
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
==
|
1
|
+
== 1.0.1 / 2009-05-03
|
2
|
+
* Bug Fixes
|
3
|
+
* Fix premature null byte termination on binary decode
|
4
|
+
|
5
|
+
== 1.0.0 / 2009-04-29
|
2
6
|
* Backward Incompatible Changes
|
3
7
|
* Implicit array call for f.when(:echo, String) must now be called as
|
4
8
|
f.when([:echo, String]) to eliminate ambiguity
|
data/VERSION.yml
CHANGED
data/ext/decoder.c
CHANGED
@@ -146,7 +146,7 @@ VALUE read_bin(unsigned char **pData) {
|
|
146
146
|
unsigned char buf[length + 1];
|
147
147
|
read_string_raw(buf, pData, length);
|
148
148
|
|
149
|
-
return
|
149
|
+
return rb_str_new((char *) buf, length);
|
150
150
|
}
|
151
151
|
|
152
152
|
VALUE read_string(unsigned char **pData) {
|
data/test/decode_spec.rb
CHANGED
@@ -107,6 +107,7 @@ context "When unpacking from a binary stream" do
|
|
107
107
|
specify "an erlang binary should decode to a string" do
|
108
108
|
get("<< 3,4,255 >>").should == "\003\004\377"
|
109
109
|
get("<< \"whatup\" >>").should == "whatup"
|
110
|
+
get("<< 99,0,99 >>").should == "c\000c"
|
110
111
|
end
|
111
112
|
|
112
113
|
specify "erlang atomic booleans should decode to ruby booleans" do
|
data/test/encode_spec.rb
CHANGED
@@ -112,6 +112,7 @@ context "When packing to a binary stream" do
|
|
112
112
|
specify "a string should be encoded as a erlang binary would be" do
|
113
113
|
get{@encoder.write_binary "hey who"}.should == get_erl("<< \"hey who\" >>")
|
114
114
|
get{@encoder.write_binary ""}.should == get_erl("<< \"\" >>")
|
115
|
+
get{@encoder.write_binary "c\000c"}.should == get_erl("<< 99,0,99 >>")
|
115
116
|
|
116
117
|
write_any("hey who").should == get_erl_with_magic("<< \"hey who\" >>")
|
117
118
|
write_any("").should == get_erl_with_magic("<< \"\" >>")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erlectricity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Fleckenstein
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-05-03 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|