slz 0.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitmodules +3 -0
- data/LICENSE +7 -0
- data/README.md +20 -0
- data/ext/libslz/src/slz.c +1324 -0
- data/ext/libslz/src/slz.h +173 -0
- data/ext/libslz/src/tables.h +4625 -0
- data/ext/rbslz.cpp +80 -0
- data/extconf.rb +12 -0
- data/slz.gemspec +29 -0
- data/spec/10000SalesRecords.csv +10001 -0
- data/spec/slz_spec.rb +20 -0
- data/spec/spec_helper.rb +4 -0
- metadata +88 -0
data/spec/slz_spec.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__)+'/spec_helper')
|
2
|
+
|
3
|
+
describe "slz" do
|
4
|
+
it "generates proper deflate stream" do
|
5
|
+
io = StringIO.new
|
6
|
+
dfl = Slz::Deflate.new
|
7
|
+
content = nil
|
8
|
+
File.open(File.dirname(__FILE__)+'/10000SalesRecords.csv'){|f|
|
9
|
+
content = f.read
|
10
|
+
f.rewind
|
11
|
+
l = content.size
|
12
|
+
siz = 1024
|
13
|
+
cnt = (l+siz-1)/siz
|
14
|
+
cnt.times{ io.write dfl.deflate(f.read(siz)) }
|
15
|
+
io.write dfl.flush
|
16
|
+
}
|
17
|
+
io.rewind
|
18
|
+
Zlib::Inflate.new(-15).inflate(io.read).should eq content
|
19
|
+
end
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: slz
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- cielavenir
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rice
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
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: rspec
|
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
|
+
description: slz
|
42
|
+
email:
|
43
|
+
- cielartisan@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions:
|
46
|
+
- extconf.rb
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitmodules"
|
50
|
+
- LICENSE
|
51
|
+
- README.md
|
52
|
+
- ext/libslz/src/slz.c
|
53
|
+
- ext/libslz/src/slz.h
|
54
|
+
- ext/libslz/src/tables.h
|
55
|
+
- ext/rbslz.cpp
|
56
|
+
- extconf.rb
|
57
|
+
- slz.gemspec
|
58
|
+
- spec/10000SalesRecords.csv
|
59
|
+
- spec/slz_spec.rb
|
60
|
+
- spec/spec_helper.rb
|
61
|
+
homepage: http://github.com/cielavenir/ruby-slz
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
metadata: {}
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 2.5.2.3
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: slz
|
85
|
+
test_files:
|
86
|
+
- spec/10000SalesRecords.csv
|
87
|
+
- spec/slz_spec.rb
|
88
|
+
- spec/spec_helper.rb
|