README.md in bencodr-2.0.0 vs README.md in bencodr-2.0.1

- old
+ new

@@ -1,15 +1,17 @@ # BEncodr * **Author** Allen Madsen (blatyo) * **My Site** http://www.allenmadsen.com * **Gem** http://gemcutter.org/gems/bencodr * **Source** http://github.com/blatyo/bencodr -* **Issue Tracker** http://github.com/blatyo/bencodr/issues +* **Issue Tracker** http://github.com/blatyo/bencodr/issues ## Synopsis This gem provides a way to encode and parse bencodings used by the Bit Torrent protocol. +_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._ + ## Installation Install the gem: ``` bash @@ -35,11 +37,11 @@ # you can work directly with files too BEncodr.bencode_file("my_awesome.torrent", {:announce => "http://www.sometracker.com/announce:80"}) BEncodr.bdecode_file("my_awesome.torrent") #=> {:announce => "http://www.sometracker.com/announce:80"} ``` - + ### Monkey Patching In order to get this functionality on the objects described below, you can call: ``` ruby BEncodr.include! @@ -49,10 +51,15 @@ * BEncodr::String * String * Symbol * URI::Generic + * URI::FTP + * URI::HTTP + * URI::HTTPS + * URI::LDAP + * URI::LDAPS * BEncodr::Integer * Numeric * Time * BEncodr::List * Array @@ -144,11 +151,11 @@ IO.bencode(1, "string") #=> "6:string" to stdout $stdout.bencode("string") #=> "6:string" to stdout # write to file File.bencode("a.bencode", "string") #=> "6:string" to a.bencode - + file = File.open("a.bencode", "wb") file.bencode("string") #=> "6:string" to a.bencode # read from standard in IO.bdecode(0) #=> "string" @@ -178,10 +185,10 @@ (1..2).bencode #=> "li1ei2ee" #register dictionary type MyClass = Class.new do include BEncodr::Dictionary - + def to_h {:a => "a", :b => "b"} end end