partoo 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c31afedd9393225ff157f75075328594991c7bb3
4
- data.tar.gz: 448a0eb5b0b3accbe7e4fb7bc123c1bd7496a439
3
+ metadata.gz: 428a35d1fa17e7c661ce09ddfe56be18f579ef30
4
+ data.tar.gz: 96c5636221521e99322a128cdfeba97e82b2e9ff
5
5
  SHA512:
6
- metadata.gz: 2e3d1debd91dbd5b4be1d8d406a9d88d4c2005897df23318434b1605f23af2cbb61a3d8bd6e82b671be535c4dffe2446be790e3c354bc05e6f213326279a7089
7
- data.tar.gz: 03d58683a7de71e270ad30b632dcab5b0de5302076b21259f623c7a2d5608f3067479da6d4fe7c8ae61f79aec9c4bc8eba5851127fdf0072e5875db76e7885aa
6
+ metadata.gz: 5bbc58b212bc8916a95b855cc62288785e96c78dad4b43a0db4ccd2e94157762e8415be174ca7f397c20845092e8ded4770ca04fce76713ea864d33bfbb3f5df
7
+ data.tar.gz: 8df76e6aeebe3766034c7c535ffe339fe495244662a994970c9ac8404114d6106454558205c07c515cbd7f9479d3115351d23a79b9fdfb7834d427fcd5586ffc
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  [![Version ](https://img.shields.io/gem/v/partoo.svg?style=flat)](https://rubygems.org/gems/partoo)
2
+ [![Build Status](https://img.shields.io/travis/werekraken/partoo/master.svg?style=flat)](https://travis-ci.org/werekraken/partoo)
2
3
 
3
4
  # Partoo
4
5
 
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
- task :default => :spec
9
+ desc 'Run spec and features'
10
+ task :test => [
11
+ :spec,
12
+ :features,
13
+ ]
14
+
15
+ task :default => :test
@@ -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
 
@@ -16,9 +16,7 @@ module Partoo
16
16
  end
17
17
 
18
18
  def to_md5
19
- file_ids.sort_by do |id|
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.sort_by do |id|
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
@@ -1,3 +1,3 @@
1
1
  module Partoo
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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 programatic access."
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.2.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-02 00:00:00.000000000 Z
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 programatic access.
111
+ description: Partoo parses data from par2 files allowing programmatic access.
112
112
  email:
113
113
  - werekraken@gmail.com
114
114
  executables: