bencode_ext 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bencode_ext.gemspec +2 -2
- data/ext/bencode_ext/bencode.c +1 -1
- data/test/test_bencode_ext.rb +1 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/bencode_ext.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bencode_ext}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["naquad"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-19}
|
13
13
|
s.description = %q{BEncodeExt is implementation of Bencode reader/writer (BitTorent encoding) in C.}
|
14
14
|
s.email = %q{naquad@gmail.com}
|
15
15
|
s.extensions = ["ext/bencode_ext/extconf.rb"]
|
data/ext/bencode_ext/bencode.c
CHANGED
@@ -156,7 +156,7 @@ static VALUE decode(VALUE self, VALUE encoded){
|
|
156
156
|
}
|
157
157
|
|
158
158
|
if(len)
|
159
|
-
rb_raise(DecodeError, "String has garbage on the end (starts at %d
|
159
|
+
rb_raise(DecodeError, "String has garbage on the end (starts at %d).", rlen - len);
|
160
160
|
|
161
161
|
return ret;
|
162
162
|
}
|
data/test/test_bencode_ext.rb
CHANGED
@@ -26,6 +26,7 @@ class TestBencodeExt < Test::Unit::TestCase
|
|
26
26
|
assert_raises(BEncode::DecodeError) { 'i1ei2e'.bdecode }
|
27
27
|
assert_raises(BEncode::DecodeError) {'33:unpexpected_end'.bdecode }
|
28
28
|
assert_raises(BEncode::DecodeError) { 'i1x'.bdecode }
|
29
|
+
assert_raises(BEncode::DecodeError) { '2:asd'.bdecode }
|
29
30
|
assert_raises(ArgumentError) { BEncode.max_depth = 1.1 }
|
30
31
|
assert_raises(ArgumentError) { BEncode.max_depth = -5 }
|
31
32
|
assert_raises(BEncode::DecodeError) do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 5
|
9
|
+
version: 0.2.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- naquad
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-19 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|