feh-bin 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b1192b0d08d2e5e744017670cdf9150336f200cad3f737296eb8d4b64a2d519
4
- data.tar.gz: 39922afca016513a3eb2abf02516e4f48e8ac5253757330ca262a5e86611cb22
3
+ metadata.gz: c6ae7f744caaaea5469cdccc2df546cc75ecc47113065e1dd23f683e55bcd929
4
+ data.tar.gz: 23d4587f451147c72a4612b9b259ea308e05bedc747b16fc6fc11b63f5161e15
5
5
  SHA512:
6
- metadata.gz: 4a2ef24ab21d7b3ae3ddd0463ef633f71980e9eca9cdc1b7b8f66f0d0a35ff8f0f07278fe77727a736cca2ce07bf0730e42cd42d5b317964eb7b00fc9ca4dd5f
7
- data.tar.gz: 1085fcd820135ebcfc7ea0b3a750fcdc3ff564d19f2f8b892d003d211b6cb21a1d607f65b11fcf5c764436a2e27cf1ff3595e48bdffed66a369472b485c4744c
6
+ metadata.gz: 8bb752115f14ba7815a8faadc7bedb7772501f2ec4bb66270cf14fd2850a6646cf519df407ab60b21e4fa34fa0e41f086873e7abf79f4d831fd1e762bdbfd429
7
+ data.tar.gz: ba17da68e9538d5a094fc50e7801b35c5b983d4449bbec9cc78245d107e298c77e04af094f826b8503a1a6b8c89ae7a4c1ee85acfd616bf1338a735aa41e3905
data/README.md CHANGED
@@ -2,20 +2,30 @@
2
2
 
3
3
  Conversion routines for Fire Emblem Heroes asset files.
4
4
 
5
- ## Example
5
+ ## Installation
6
+
7
+ ```
8
+ $ gem install feh-bin
9
+ ```
10
+
11
+ ## Command line usage
12
+
13
+ To convert `a.bin` to `a.bin.lz`, and `b.bin.lz` to `b.bin`:
14
+
15
+ ```
16
+ $ feh_bin_lz a.bin b.bin.lz
17
+ ```
18
+
19
+ ## Library example
6
20
 
7
21
  ```ruby
8
- require 'feh-bin'
22
+ require 'feh/bin'
9
23
 
10
24
  Dir.glob('assets/Common/SRPGMap/*.bin.lz').each do |fname|
11
25
  IO.binwrite(fname.sub(/.lz$/, ''), Feh::Bin.decompress(IO.binread(fname)).pack('c*'))
12
26
  end
13
27
  ```
14
28
 
15
- ## Testing
16
-
17
- A fuzz test is available at `fuzz/fuzz_feh_bin.rb` that tests the compression-decompression round trip using [FuzzBert](https://rubygems.org/gems/fuzzbert).
18
-
19
29
  ## License
20
30
 
21
31
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,20 @@
1
+ #1/usr/bin/env ruby
2
+
3
+ require 'feh/bin'
4
+ require 'fuzzbert'
5
+
6
+ fuzz 'Feh::Bin' do
7
+ deploy do |data|
8
+ data2 = Feh::Bin.compress(data)
9
+ data3 = Feh::Bin.decompress(data)
10
+ raise StandardError unless data3 == data
11
+ end
12
+
13
+ data 'random' do
14
+ r = FuzzBert::Generators.random(16384)
15
+ ->() do
16
+ a = r.().unpack('C*')
17
+ # a += [0] * ((-a.size) % 4)
18
+ end
19
+ end
20
+ end
@@ -1,6 +1,6 @@
1
1
  module Feh
2
2
  module Bin
3
3
  # Version number.
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feh-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quinton Miller
@@ -70,6 +70,7 @@ files:
70
70
  - Rakefile
71
71
  - bin/feh_bin_lz
72
72
  - feh-bin.gemspec
73
+ - fuzz/fuzz_feh_bin.rb
73
74
  - lib/feh/bin.rb
74
75
  - lib/feh/bin/array_istream.rb
75
76
  - lib/feh/bin/array_ostream.rb