partoo 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/Rakefile +10 -1
- data/lib/partoo/crc32.rb +8 -0
- data/lib/partoo/par2_file.rb +5 -7
- data/lib/partoo/version.rb +1 -1
- data/partoo.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 428a35d1fa17e7c661ce09ddfe56be18f579ef30
|
4
|
+
data.tar.gz: 96c5636221521e99322a128cdfeba97e82b2e9ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bbc58b212bc8916a95b855cc62288785e96c78dad4b43a0db4ccd2e94157762e8415be174ca7f397c20845092e8ded4770ca04fce76713ea864d33bfbb3f5df
|
7
|
+
data.tar.gz: 8df76e6aeebe3766034c7c535ffe339fe495244662a994970c9ac8404114d6106454558205c07c515cbd7f9479d3115351d23a79b9fdfb7834d427fcd5586ffc
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require 'cucumber/rake/task'
|
2
3
|
require "rspec/core/rake_task"
|
3
4
|
|
5
|
+
Cucumber::Rake::Task.new(:features)
|
6
|
+
|
4
7
|
RSpec::Core::RakeTask.new(:spec)
|
5
8
|
|
6
|
-
|
9
|
+
desc 'Run spec and features'
|
10
|
+
task :test => [
|
11
|
+
:spec,
|
12
|
+
:features,
|
13
|
+
]
|
14
|
+
|
15
|
+
task :default => :test
|
data/lib/partoo/crc32.rb
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
module Partoo
|
2
2
|
module CRC32
|
3
|
+
# This code is a ruby port of crc32trim.c.
|
4
|
+
# https://github.com/werekraken/libcrc32trim
|
5
|
+
#
|
6
|
+
# crc32trim.c borrows heavily from crc32.c found in zlib version 1.2.8, but
|
7
|
+
# has been altered.
|
8
|
+
#
|
9
|
+
# Thanks to Mark Adler <madler@alumni.caltech.edu> for writing zlib's crc32.c,
|
10
|
+
# his posts about crc32_combine(), and answering questions of the community.
|
3
11
|
|
4
12
|
GF2_DIM = 32;
|
5
13
|
|
data/lib/partoo/par2_file.rb
CHANGED
@@ -16,9 +16,7 @@ module Partoo
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def to_md5
|
19
|
-
file_ids.
|
20
|
-
file_description_packet_by_id(id)[0]['body']['file_name']
|
21
|
-
end.map do |id|
|
19
|
+
file_ids.map do |id|
|
22
20
|
file_description_packet_by_id(id)[0]['body']['file_md5'].to_hex
|
23
21
|
.concat(' ')
|
24
22
|
.concat(file_description_packet_by_id(id)[0]['body']['file_name'])
|
@@ -26,9 +24,7 @@ module Partoo
|
|
26
24
|
end
|
27
25
|
|
28
26
|
def to_sfv
|
29
|
-
file_ids.
|
30
|
-
file_description_packet_by_id(id)[0]['body']['file_name']
|
31
|
-
end.map do |id|
|
27
|
+
file_ids.map do |id|
|
32
28
|
file_description_packet_by_id(id)[0]['body']['file_name']
|
33
29
|
.concat(' ')
|
34
30
|
.concat(crc32_by_id(id).to_s(16).rjust(8, '0'))
|
@@ -55,7 +51,9 @@ module Partoo
|
|
55
51
|
end
|
56
52
|
|
57
53
|
def file_ids
|
58
|
-
main_packet[0]['body']['file_ids']
|
54
|
+
main_packet[0]['body']['file_ids'].sort_by do |id|
|
55
|
+
file_description_packet_by_id(id)[0]['body']['file_name']
|
56
|
+
end
|
59
57
|
end
|
60
58
|
|
61
59
|
def slice_size
|
data/lib/partoo/version.rb
CHANGED
data/partoo.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ["werekraken@gmail.com"]
|
11
11
|
|
12
12
|
s.summary = "Do cool things with par2 files."
|
13
|
-
s.description = "Partoo parses data from par2 files allowing
|
13
|
+
s.description = "Partoo parses data from par2 files allowing programmatic access."
|
14
14
|
s.homepage = "https://github.com/werekraken/partoo"
|
15
15
|
s.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: partoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- matt.cover
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.0'
|
111
|
-
description: Partoo parses data from par2 files allowing
|
111
|
+
description: Partoo parses data from par2 files allowing programmatic access.
|
112
112
|
email:
|
113
113
|
- werekraken@gmail.com
|
114
114
|
executables:
|