$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) require 'stringio' require 'open-uri' module Bencoding def self.load!(io) Parser.load(io) end def self.load(io) return load!(io) rescue nil end def self.dump(object) object.to_bencoding end 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/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 Numeric.send :include, Bencoding::Numeric String.send :include, Bencoding::String Symbol.send :include, Bencoding::Symbol