Sha256: 84bd59f517f2306204e6e4cf1fa25f1a656644caa0ab63448ad760e83fe9fd61

Contents?: true

Size: 763 Bytes

Versions: 5

Compression:

Stored size: 763 Bytes

Contents

# encoding: UTF-8

path = File.expand_path(File.dirname(__FILE__)) + "/bencodr/"

require path + "string"
require path + "integer"
require path + "list"
require path + "dictionary"
require path + "object"
require path + "parser"
require path + "io"
require path + "ext"
require path + "version"

module BEncodr
  class BEncodeError < StandardError; end

  class << self
    def bdecode(object)
      BEncodr::Object.bdecode(object)
    end

    def bdecode_file(fd)
      ::File.open(fd, "rb") {|file| bdecode(file.read)}
    end

    def bencode(object)
      BEncodr::Object.bencode(object)
    end

    def bencode_file(fd, object)
      ::File.open(fd, "wb") {|file| file.write(bencode(object))}
    end

    def include!
      Ext.include!
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bencodr-3.0.2 lib/bencodr.rb
bencodr-3.0.1 lib/bencodr.rb
bencodr-2.0.1 lib/bencodr.rb
bencodr-3.0.0 lib/bencodr.rb
bencodr-2.0.0 lib/bencodr.rb