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 +4 -4
- data/README.md +16 -6
- data/fuzz/fuzz_feh_bin.rb +20 -0
- data/lib/feh/bin/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6ae7f744caaaea5469cdccc2df546cc75ecc47113065e1dd23f683e55bcd929
|
|
4
|
+
data.tar.gz: 23d4587f451147c72a4612b9b259ea308e05bedc747b16fc6fc11b63f5161e15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
##
|
|
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
|
|
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
|
data/lib/feh/bin/version.rb
CHANGED
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.
|
|
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
|