bencode 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile +3 -4
- data/README.md +17 -6
- data/Rakefile +122 -21
- data/bencode.gemspec +63 -0
- data/lib/bencode.rb +2 -0
- data/lib/bencode/core_ext/io.rb +3 -0
- data/lib/bencode/core_ext/stringio.rb +6 -0
- data/lib/bencode/decode.rb +2 -48
- data/lib/bencode/parseio.rb +9 -0
- data/lib/bencode/parser.rb +80 -0
- data/test/bittorrent_test.rb +1 -3
- data/test/decoding_test.rb +4 -2
- data/test/encoding_test.rb +1 -2
- data/test/environment.rb +2 -2
- data/test/utf8_decoding_test.rb +1 -2
- metadata +86 -47
- data/.yardopts +0 -5
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzJhZTUzNzVhM2ZmMzNjOTJhYTkwNGJhOWU4NTFjZTNhOTdjY2Y1Ng==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YWQzMDg5NmM2ODYwY2M1Y2JhZTU4NzA0ZmE5MWRmN2QwODEwNTIxNA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjM1ODBjMmNmMjU1YmY3ZGViNDZiMmE5OTlkZTg4NWZjZGFkZGQ0NzEyNmQ3
|
10
|
+
NjEzOTI2NmVjMDEwNGYwNTI0NTAyNGU5YmE3ZWU5ODg4MWExMGJjZGY1MTll
|
11
|
+
YmE2MzljNTg1YzYzYTdhYjljMGQzOWQxYWYwOWQ2NTllM2M1NGQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZmQ4ODY3NDM3NDZiYThjZDc5MTYzOTNiOTdlOGRhMDJmNjhhNDAxY2Q2OTM2
|
14
|
+
NWUwZmFhMWVkNGI0ZGI5ZWZlM2UzMTJmYWIxNDVmOWMzNzliY2RmMWUwMGVj
|
15
|
+
YjdlMDVhN2YxYzQwZWFiNjA1ZDY2OTI1MmU2YTU3OTYwZWZjZjM=
|
data/Gemfile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
end
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem "shoulda", :git => "git://github.com/dasch/shoulda.git", :branch => "minitest"
|
data/README.md
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
Ruby bencode binding
|
3
2
|
====================
|
4
3
|
|
@@ -24,14 +23,25 @@ Examples
|
|
24
23
|
|
25
24
|
Encoding objects is as simple as calling `#bencode` on them:
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
```ruby
|
27
|
+
"foo bar".bencode # => "7:foo bar"
|
28
|
+
42.bencode # => "i42e"
|
29
|
+
[1, 2, 3].bencode # => "li1ei2ei3ee"
|
30
|
+
{"foo" => 1, "bar" => -10}.bencode # => "d3:bari-10e3:fooi1ee"
|
31
|
+
```
|
31
32
|
|
33
|
+
Decoding a complete data stream is as easy as calling `BEncode.load(data)`.
|
32
34
|
|
33
|
-
Decoding a data stream
|
35
|
+
Decoding a data stream in chunks works as follows:
|
34
36
|
|
37
|
+
```ruby
|
38
|
+
irb(main):007:0> stream = BEncode::Parser.new(StringIO.new "d3:foo3:bared3:baz3:quxe")
|
39
|
+
=> #<BEncode::Parser:0x007fbe6b008c88 @stream=#<StringIO:0x007fbe6b008cd8>>
|
40
|
+
irb(main):008:0> stream.parse!
|
41
|
+
=> {"foo"=>"bar"}
|
42
|
+
irb(main):009:0> stream.parse!
|
43
|
+
=> {"baz"=>"qux"}
|
44
|
+
```
|
35
45
|
|
36
46
|
License
|
37
47
|
-------
|
@@ -48,3 +58,4 @@ Contributors
|
|
48
58
|
- Eric Himmelreich
|
49
59
|
- Allen Madsen ([blatyo](https://github.com/blatyo))
|
50
60
|
- Ian Levesque ([ianlevesque](https://github.com/ianlevesque))
|
61
|
+
- Dirk Geurs ([Dirklectisch](https://github.com/Dirklectisch))
|
data/Rakefile
CHANGED
@@ -1,22 +1,58 @@
|
|
1
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'date'
|
2
4
|
require 'rake/testtask'
|
3
|
-
require '
|
5
|
+
require 'rdoc/task'
|
6
|
+
|
7
|
+
#############################################################################
|
8
|
+
#
|
9
|
+
# Helper functions
|
10
|
+
#
|
11
|
+
#############################################################################
|
12
|
+
|
13
|
+
def name
|
14
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
15
|
+
end
|
16
|
+
|
17
|
+
def version
|
18
|
+
line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
19
|
+
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
20
|
+
end
|
21
|
+
|
22
|
+
def date
|
23
|
+
Date.today.to_s
|
24
|
+
end
|
25
|
+
|
26
|
+
def rubyforge_project
|
27
|
+
name
|
28
|
+
end
|
29
|
+
|
30
|
+
def gemspec_file
|
31
|
+
"#{name}.gemspec"
|
32
|
+
end
|
33
|
+
|
34
|
+
def gem_file
|
35
|
+
"#{name}-#{version}.gem"
|
36
|
+
end
|
37
|
+
|
38
|
+
def replace_header(head, header_name)
|
39
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
40
|
+
end
|
41
|
+
|
42
|
+
#############################################################################
|
43
|
+
#
|
44
|
+
# Standard tasks
|
45
|
+
#
|
46
|
+
#############################################################################
|
4
47
|
|
5
48
|
task :default => :test
|
6
49
|
|
7
|
-
desc "Run all unit tests"
|
8
50
|
Rake::TestTask.new(:test) do |test|
|
9
51
|
test.libs << 'lib' << 'test'
|
10
52
|
test.pattern = 'test/**/*_test.rb'
|
11
53
|
test.verbose = false
|
12
54
|
end
|
13
55
|
|
14
|
-
|
15
|
-
desc "Generate RDoc documentation"
|
16
|
-
Rake::RDocTask.new :doc do |rdoc|
|
17
|
-
rdoc.rdoc_dir = 'doc'
|
18
|
-
end
|
19
|
-
|
20
56
|
desc "Run all the benchmarks"
|
21
57
|
task :benchmark do
|
22
58
|
Dir["test/benchmark/*.rb"].each do |file|
|
@@ -26,17 +62,82 @@ task :benchmark do
|
|
26
62
|
end
|
27
63
|
end
|
28
64
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
65
|
+
Rake::RDocTask.new do |rdoc|
|
66
|
+
rdoc.rdoc_dir = 'rdoc'
|
67
|
+
rdoc.title = "#{name} #{version}"
|
68
|
+
rdoc.rdoc_files.include('README*')
|
69
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
70
|
+
end
|
71
|
+
|
72
|
+
desc "Open an irb session preloaded with this library"
|
73
|
+
task :console do
|
74
|
+
sh "irb -rubygems -r ./lib/#{name}.rb"
|
75
|
+
end
|
76
|
+
|
77
|
+
#############################################################################
|
78
|
+
#
|
79
|
+
# Packaging tasks
|
80
|
+
#
|
81
|
+
#############################################################################
|
82
|
+
|
83
|
+
desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
|
84
|
+
task :release => :build do
|
85
|
+
unless `git branch` =~ /^\* master$/
|
86
|
+
puts "You must be on the master branch to release!"
|
87
|
+
exit!
|
88
|
+
end
|
89
|
+
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
90
|
+
sh "git tag v#{version}"
|
91
|
+
sh "git push origin master"
|
92
|
+
sh "git push origin v#{version}"
|
93
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
94
|
+
end
|
95
|
+
|
96
|
+
desc "Build #{gem_file} into the pkg directory"
|
97
|
+
task :build => :gemspec do
|
98
|
+
sh "mkdir -p pkg"
|
99
|
+
sh "gem build #{gemspec_file}"
|
100
|
+
sh "mv #{gem_file} pkg"
|
101
|
+
end
|
102
|
+
|
103
|
+
desc "Generate #{gemspec_file}"
|
104
|
+
task :gemspec => :validate do
|
105
|
+
# read spec file and split out manifest section
|
106
|
+
spec = File.read(gemspec_file)
|
107
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
108
|
+
|
109
|
+
# replace name version and date
|
110
|
+
replace_header(head, :name)
|
111
|
+
replace_header(head, :version)
|
112
|
+
replace_header(head, :date)
|
113
|
+
#comment this out if your rubyforge_project has a different name
|
114
|
+
replace_header(head, :rubyforge_project)
|
115
|
+
|
116
|
+
# determine file list from git ls-files
|
117
|
+
files = `git ls-files`.
|
118
|
+
split("\n").
|
119
|
+
sort.
|
120
|
+
reject { |file| file =~ /^\./ }.
|
121
|
+
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
122
|
+
map { |file| " #{file}" }.
|
123
|
+
join("\n")
|
124
|
+
|
125
|
+
# piece file back together and write
|
126
|
+
manifest = " s.files = %w[\n#{files}\n ]\n"
|
127
|
+
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
128
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
129
|
+
puts "Updated #{gemspec_file}"
|
130
|
+
end
|
131
|
+
|
132
|
+
desc "Validate #{gemspec_file}"
|
133
|
+
task :validate do
|
134
|
+
libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
|
135
|
+
unless libfiles.empty?
|
136
|
+
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
137
|
+
exit!
|
138
|
+
end
|
139
|
+
unless Dir['VERSION*'].empty?
|
140
|
+
puts "A `VERSION` file at root level violates Gem best practices."
|
141
|
+
exit!
|
38
142
|
end
|
39
|
-
Jeweler::GemcutterTasks.new
|
40
|
-
rescue LoadError
|
41
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
42
143
|
end
|
data/bencode.gemspec
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
3
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
|
+
s.rubygems_version = '1.3.5'
|
5
|
+
|
6
|
+
## Leave these as is they will be modified for you by the rake gemspec task.
|
7
|
+
## If your rubyforge_project name is different, then edit it and comment out
|
8
|
+
## the sub! line in the Rakefile
|
9
|
+
s.name = 'bencode'
|
10
|
+
s.version = '0.8.0'
|
11
|
+
s.date = '2013-03-15'
|
12
|
+
|
13
|
+
s.summary = "Encode and decode bencoded data"
|
14
|
+
s.description = "A simple encoder and decoder for the BitTorrent serialization format."
|
15
|
+
|
16
|
+
s.authors = ["Daniel Schierbeck"]
|
17
|
+
s.email = "daniel.schierbeck@gmail.com"
|
18
|
+
s.homepage = "http://github.com/dasch/ruby-bencode"
|
19
|
+
|
20
|
+
s.require_paths = %w[lib]
|
21
|
+
|
22
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
23
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
24
|
+
|
25
|
+
s.add_development_dependency('rdoc')
|
26
|
+
s.add_development_dependency('rake')
|
27
|
+
s.add_development_dependency('minitest')
|
28
|
+
s.add_development_dependency('shoulda')
|
29
|
+
|
30
|
+
# = MANIFEST =
|
31
|
+
s.files = %w[
|
32
|
+
Gemfile
|
33
|
+
LICENSE
|
34
|
+
README.md
|
35
|
+
Rakefile
|
36
|
+
bencode.gemspec
|
37
|
+
lib/bencode.rb
|
38
|
+
lib/bencode/core_ext/array.rb
|
39
|
+
lib/bencode/core_ext/hash.rb
|
40
|
+
lib/bencode/core_ext/integer.rb
|
41
|
+
lib/bencode/core_ext/io.rb
|
42
|
+
lib/bencode/core_ext/object.rb
|
43
|
+
lib/bencode/core_ext/string.rb
|
44
|
+
lib/bencode/core_ext/stringio.rb
|
45
|
+
lib/bencode/decode.rb
|
46
|
+
lib/bencode/parseio.rb
|
47
|
+
lib/bencode/parser.rb
|
48
|
+
test/benchmark/decoding.rb
|
49
|
+
test/benchmark/encoding.rb
|
50
|
+
test/bittorrent_test.rb
|
51
|
+
test/decoding_test.rb
|
52
|
+
test/encoding_test.rb
|
53
|
+
test/environment.rb
|
54
|
+
test/fixtures/python.torrent
|
55
|
+
test/fixtures/test.torrent
|
56
|
+
test/shoulda_macros/decoding.rb
|
57
|
+
test/shoulda_macros/encoding.rb
|
58
|
+
test/utf8_decoding_test.rb
|
59
|
+
]
|
60
|
+
# = MANIFEST =
|
61
|
+
|
62
|
+
s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
|
63
|
+
end
|
data/lib/bencode.rb
CHANGED
data/lib/bencode/core_ext/io.rb
CHANGED
data/lib/bencode/decode.rb
CHANGED
@@ -19,8 +19,8 @@ module BEncode
|
|
19
19
|
# @return [Object] a Ruby object
|
20
20
|
# @raise [DecodeError] if +str+ is malformed
|
21
21
|
def self.load(str, opts = {})
|
22
|
-
scanner =
|
23
|
-
obj = parse
|
22
|
+
scanner = BEncode::Parser.new(str)
|
23
|
+
obj = scanner.parse!
|
24
24
|
raise BEncode::DecodeError unless (opts[:ignore_trailing_junk] || scanner.eos?)
|
25
25
|
return obj
|
26
26
|
end
|
@@ -33,52 +33,6 @@ module BEncode
|
|
33
33
|
def self.load_file(path, opts = {})
|
34
34
|
load(File.open(path, 'rb').read, opts)
|
35
35
|
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
def self.parse(scanner) # :nodoc:
|
40
|
-
val = case scanner.peek(1)[0]
|
41
|
-
when ?i
|
42
|
-
scanner.pos += 1
|
43
|
-
num = scanner.scan_until(/e/) or raise BEncode::DecodeError
|
44
|
-
num.chop.to_i
|
45
|
-
when ?l
|
46
|
-
scanner.pos += 1
|
47
|
-
ary = []
|
48
|
-
ary.push(parse(scanner)) until scanner.scan(/e/)
|
49
|
-
ary
|
50
|
-
when ?d
|
51
|
-
scanner.pos += 1
|
52
|
-
hsh = {}
|
53
|
-
until scanner.scan(/e/)
|
54
|
-
key = parse(scanner)
|
55
|
-
|
56
|
-
unless key.is_a? String or key.is_a? Fixnum
|
57
|
-
raise BEncode::DecodeError, "key must be a string or number"
|
58
|
-
end
|
59
|
-
|
60
|
-
hsh.store(key.to_s, parse(scanner))
|
61
|
-
end
|
62
|
-
hsh
|
63
|
-
when ?0 .. ?9
|
64
|
-
num = scanner.scan_until(/:/) or
|
65
|
-
raise BEncode::DecodeError, "invalid string length (no colon)"
|
66
|
-
|
67
|
-
begin
|
68
|
-
length = num.chop.to_i
|
69
|
-
str = scanner.peek(length)
|
70
|
-
scanner.pos += num.chop.to_i
|
71
|
-
rescue
|
72
|
-
raise BEncode::DecodeError, "invalid string length"
|
73
|
-
end
|
74
|
-
|
75
|
-
str
|
76
|
-
end
|
77
|
-
|
78
|
-
raise BEncode::DecodeError if val.nil?
|
79
|
-
val
|
80
|
-
end
|
81
|
-
|
82
36
|
end
|
83
37
|
|
84
38
|
class String
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
require 'bencode/parseio'
|
3
|
+
|
4
|
+
module BEncode
|
5
|
+
class Parser
|
6
|
+
attr_reader :stream
|
7
|
+
|
8
|
+
def initialize(stream)
|
9
|
+
if stream.kind_of? BEncode::ParseIO
|
10
|
+
@stream = stream
|
11
|
+
elsif stream.respond_to? :string
|
12
|
+
@stream = StringIO.new stream.string
|
13
|
+
elsif stream.respond_to? :to_s
|
14
|
+
@stream = StringIO.new stream.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def parse!
|
19
|
+
case stream.peek
|
20
|
+
when ?i then parse_integer!
|
21
|
+
when ?l then parse_list!
|
22
|
+
when ?d then parse_dict!
|
23
|
+
when ?0 .. ?9 then parse_string!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def eos?
|
28
|
+
stream.eof?
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def parse_integer!
|
34
|
+
stream.getc
|
35
|
+
num = stream.gets("e") or raise BEncode::DecodeError
|
36
|
+
num.chop.to_i
|
37
|
+
end
|
38
|
+
|
39
|
+
def parse_list!
|
40
|
+
stream.getc
|
41
|
+
ary = []
|
42
|
+
ary.push(parse!) until stream.peek == ?e
|
43
|
+
stream.getc
|
44
|
+
ary
|
45
|
+
end
|
46
|
+
|
47
|
+
def parse_dict!
|
48
|
+
stream.getc
|
49
|
+
hsh = {}
|
50
|
+
until stream.peek == ?e
|
51
|
+
key = parse!
|
52
|
+
|
53
|
+
unless key.is_a? String or key.is_a? Fixnum
|
54
|
+
raise BEncode::DecodeError, "key must be a string or number"
|
55
|
+
end
|
56
|
+
|
57
|
+
val = parse!
|
58
|
+
|
59
|
+
hsh.store(key.to_s, val)
|
60
|
+
end
|
61
|
+
stream.getc
|
62
|
+
hsh
|
63
|
+
end
|
64
|
+
|
65
|
+
def parse_string!
|
66
|
+
num = stream.gets(":") or
|
67
|
+
raise BEncode::DecodeError, "invalid string length (no colon)"
|
68
|
+
|
69
|
+
begin
|
70
|
+
length = num.chop.to_i
|
71
|
+
return "" if length == 0 # Workaround for Rubinius bug
|
72
|
+
str = stream.read(length)
|
73
|
+
rescue
|
74
|
+
raise BEncode::DecodeError, "invalid string length"
|
75
|
+
end
|
76
|
+
|
77
|
+
str
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/test/bittorrent_test.rb
CHANGED
data/test/decoding_test.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'test/environment'
|
1
|
+
require 'environment'
|
3
2
|
|
4
3
|
class DecodingTest < MiniTest::Unit::TestCase
|
5
4
|
context "The BEncode decoder" do
|
@@ -12,6 +11,9 @@ class DecodingTest < MiniTest::Unit::TestCase
|
|
12
11
|
|
13
12
|
should_decode [1, 2, 3], "li1ei2ei3ee"
|
14
13
|
|
14
|
+
hsh = {"foo" => "bar", "baz" => "qux"}
|
15
|
+
should_decode hsh, "d3:foo3:bar3:baz3:quxe"
|
16
|
+
|
15
17
|
should_decode 42, "i42eBOGUS", :ignore_trailing_junk => true
|
16
18
|
end
|
17
19
|
end
|
data/test/encoding_test.rb
CHANGED
data/test/environment.rb
CHANGED
data/test/utf8_decoding_test.rb
CHANGED
metadata
CHANGED
@@ -1,39 +1,84 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bencode
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 7
|
9
|
-
- 0
|
10
|
-
version: 0.7.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Daniel Schierbeck
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
date: 2013-03-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rdoc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
21
69
|
description: A simple encoder and decoder for the BitTorrent serialization format.
|
22
70
|
email: daniel.schierbeck@gmail.com
|
23
71
|
executables: []
|
24
|
-
|
25
72
|
extensions: []
|
26
|
-
|
27
|
-
extra_rdoc_files:
|
28
|
-
- LICENSE
|
73
|
+
extra_rdoc_files:
|
29
74
|
- README.md
|
30
|
-
|
31
|
-
|
75
|
+
- LICENSE
|
76
|
+
files:
|
32
77
|
- Gemfile
|
33
78
|
- LICENSE
|
34
79
|
- README.md
|
35
80
|
- Rakefile
|
36
|
-
-
|
81
|
+
- bencode.gemspec
|
37
82
|
- lib/bencode.rb
|
38
83
|
- lib/bencode/core_ext/array.rb
|
39
84
|
- lib/bencode/core_ext/hash.rb
|
@@ -41,7 +86,10 @@ files:
|
|
41
86
|
- lib/bencode/core_ext/io.rb
|
42
87
|
- lib/bencode/core_ext/object.rb
|
43
88
|
- lib/bencode/core_ext/string.rb
|
89
|
+
- lib/bencode/core_ext/stringio.rb
|
44
90
|
- lib/bencode/decode.rb
|
91
|
+
- lib/bencode/parseio.rb
|
92
|
+
- lib/bencode/parser.rb
|
45
93
|
- test/benchmark/decoding.rb
|
46
94
|
- test/benchmark/encoding.rb
|
47
95
|
- test/bittorrent_test.rb
|
@@ -55,36 +103,27 @@ files:
|
|
55
103
|
- test/utf8_decoding_test.rb
|
56
104
|
homepage: http://github.com/dasch/ruby-bencode
|
57
105
|
licenses: []
|
58
|
-
|
106
|
+
metadata: {}
|
59
107
|
post_install_message:
|
60
|
-
rdoc_options:
|
61
|
-
|
62
|
-
require_paths:
|
108
|
+
rdoc_options:
|
109
|
+
- --charset=UTF-8
|
110
|
+
require_paths:
|
63
111
|
- lib
|
64
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
none: false
|
75
|
-
requirements:
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
hash: 3
|
79
|
-
segments:
|
80
|
-
- 0
|
81
|
-
version: "0"
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
82
122
|
requirements: []
|
83
|
-
|
84
123
|
rubyforge_project:
|
85
|
-
rubygems_version:
|
124
|
+
rubygems_version: 2.0.3
|
86
125
|
signing_key:
|
87
|
-
specification_version:
|
126
|
+
specification_version: 2
|
88
127
|
summary: Encode and decode bencoded data
|
89
128
|
test_files: []
|
90
|
-
|
129
|
+
has_rdoc:
|
data/.yardopts
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.7.0
|