lib/bencoding.rb in simonmenke-bencoding-0.0.1 vs lib/bencoding.rb in simonmenke-bencoding-0.0.2
- old
+ new
@@ -1,8 +1,10 @@
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
+require "stringio"
+
module Bencoding
def self.load(io)
Parser.load(io)
end
def self.dump(object)
@@ -11,13 +13,16 @@
end
require File.join(File.dirname(__FILE__), "bencoding/parser")
require File.join(File.dirname(__FILE__), "bencoding/array")
require File.join(File.dirname(__FILE__), "bencoding/hash")
-require File.join(File.dirname(__FILE__), "bencoding/integer")
+require File.join(File.dirname(__FILE__), "bencoding/numeric")
require File.join(File.dirname(__FILE__), "bencoding/string")
+require File.join(File.dirname(__FILE__), "bencoding/symbol")
+require File.join(File.dirname(__FILE__), "bencoding/object")
+Object.send :include, Bencoding::Object
Array.send :include, Bencoding::Array
Hash.send :include, Bencoding::Hash
-Integer.send :include, Bencoding::Integer
+Numeric.send :include, Bencoding::Numeric
String.send :include, Bencoding::String
-
+Symbol.send :include, Bencoding::Symbol