lib/bencodr/io.rb in bencodr-3.0.0 vs lib/bencodr/io.rb in bencodr-3.0.1

- old
+ new

@@ -4,24 +4,24 @@ module IO module ClassMethods def bencode(fd, object) open(fd, "wb") {|file| file.bencode(object)} end - + def bdecode(fd) open(fd, "rb") {|file| file.bdecode} end end - + def bencode(object) write(Object.bencode(object)) end - + def bdecode - Object.bdecode(read.force_encoding('UTF-8')) + Object.bdecode(read) end - + def self.included(base) base.extend ClassMethods end end -end \ No newline at end of file +end