bencodr 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -4
- data/lib/bencodr/string.rb +1 -1
- data/lib/bencodr/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -3,11 +3,13 @@
|
|
3
3
|
* **My Site** http://www.allenmadsen.com
|
4
4
|
* **Gem** http://gemcutter.org/gems/bencodr
|
5
5
|
* **Source** http://github.com/blatyo/bencodr
|
6
|
-
* **Issue Tracker** http://github.com/blatyo/bencodr/issues
|
6
|
+
* **Issue Tracker** http://github.com/blatyo/bencodr/issues
|
7
7
|
|
8
8
|
## Synopsis
|
9
9
|
This gem provides a way to encode and parse bencodings used by the Bit Torrent protocol.
|
10
10
|
|
11
|
+
_Note: If using ruby 1.9.x, use a bencodr version >= 3.0.0 as it takes advantage of 1.9.x's encoding features._
|
12
|
+
|
11
13
|
## Installation
|
12
14
|
|
13
15
|
Install the gem:
|
@@ -37,7 +39,7 @@ Most of the functionality of this library can be accessed directly on the BEncod
|
|
37
39
|
BEncodr.bencode_file("my_awesome.torrent", {:announce => "http://www.sometracker.com/announce:80"})
|
38
40
|
BEncodr.bdecode_file("my_awesome.torrent") #=> {:announce => "http://www.sometracker.com/announce:80"}
|
39
41
|
```
|
40
|
-
|
42
|
+
|
41
43
|
### Monkey Patching
|
42
44
|
In order to get this functionality on the objects described below, you can call:
|
43
45
|
|
@@ -51,6 +53,11 @@ This will extend:
|
|
51
53
|
* String
|
52
54
|
* Symbol
|
53
55
|
* URI::Generic
|
56
|
+
* URI::FTP
|
57
|
+
* URI::HTTP
|
58
|
+
* URI::HTTPS
|
59
|
+
* URI::LDAP
|
60
|
+
* URI::LDAPS
|
54
61
|
* BEncodr::Integer
|
55
62
|
* Numeric
|
56
63
|
* Time
|
@@ -146,7 +153,7 @@ You can also write and read bencodings.
|
|
146
153
|
|
147
154
|
# write to file
|
148
155
|
File.bencode("a.bencode", "string") #=> "6:string" to a.bencode
|
149
|
-
|
156
|
+
|
150
157
|
file = File.open("a.bencode", "wb")
|
151
158
|
file.bencode("string") #=> "6:string" to a.bencode
|
152
159
|
|
@@ -180,7 +187,7 @@ When using bencodings it may be useful to translate your own objects into bencod
|
|
180
187
|
#register dictionary type
|
181
188
|
MyClass = Class.new do
|
182
189
|
include BEncodr::Dictionary
|
183
|
-
|
190
|
+
|
184
191
|
def to_h
|
185
192
|
{:a => "a", :b => "b"}
|
186
193
|
end
|
data/lib/bencodr/string.rb
CHANGED
data/lib/bencodr/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: bencodr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.0.
|
5
|
+
version: 2.0.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Allen Madsen
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-24 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|