ruby-lzws 1.1.0 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -13
- data/ext/extconf.rb +35 -27
- data/ext/lzws_ext/buffer.c +17 -5
- data/ext/lzws_ext/buffer.h +12 -0
- data/ext/lzws_ext/common.h +3 -0
- data/ext/lzws_ext/error.c +2 -3
- data/ext/lzws_ext/error.h +1 -1
- data/ext/lzws_ext/io.c +3 -5
- data/ext/lzws_ext/main.c +0 -1
- data/ext/lzws_ext/option.c +10 -3
- data/ext/lzws_ext/option.h +17 -11
- data/ext/lzws_ext/stream/compressor.c +18 -18
- data/ext/lzws_ext/stream/compressor.h +3 -3
- data/ext/lzws_ext/stream/decompressor.c +18 -18
- data/ext/lzws_ext/stream/decompressor.h +3 -3
- data/ext/lzws_ext/string.c +52 -67
- data/lib/lzws.rb +1 -0
- data/lib/lzws/file.rb +4 -0
- data/lib/lzws/option.rb +3 -2
- data/lib/lzws/stream/abstract.rb +9 -12
- data/lib/lzws/stream/raw/abstract.rb +4 -2
- data/lib/lzws/stream/raw/compressor.rb +4 -4
- data/lib/lzws/stream/raw/decompressor.rb +1 -3
- data/lib/lzws/stream/reader.rb +71 -52
- data/lib/lzws/stream/reader_helpers.rb +2 -0
- data/lib/lzws/stream/writer.rb +10 -5
- data/lib/lzws/stream/writer_helpers.rb +8 -10
- data/lib/lzws/validation.rb +15 -2
- data/lib/lzws/version.rb +1 -1
- metadata +61 -19
data/lib/lzws/validation.rb
CHANGED
@@ -5,12 +5,25 @@ require_relative "error"
|
|
5
5
|
|
6
6
|
module LZWS
|
7
7
|
module Validation
|
8
|
+
IO_METHODS = %i[
|
9
|
+
read
|
10
|
+
write
|
11
|
+
readpartial
|
12
|
+
read_nonblock
|
13
|
+
write_nonblock
|
14
|
+
eof?
|
15
|
+
flush
|
16
|
+
close
|
17
|
+
closed?
|
18
|
+
]
|
19
|
+
.freeze
|
20
|
+
|
8
21
|
def self.validate_bool(value)
|
9
22
|
raise ValidateError, "invalid bool" unless value.is_a?(::TrueClass) || value.is_a?(::FalseClass)
|
10
23
|
end
|
11
24
|
|
12
25
|
def self.validate_positive_integer(value)
|
13
|
-
raise ValidateError, "invalid positive integer" unless value.is_a?(::Integer) && value
|
26
|
+
raise ValidateError, "invalid positive integer" unless value.is_a?(::Integer) && value.positive?
|
14
27
|
end
|
15
28
|
|
16
29
|
def self.validate_not_negative_integer(value)
|
@@ -22,7 +35,7 @@ module LZWS
|
|
22
35
|
end
|
23
36
|
|
24
37
|
def self.validate_io(value)
|
25
|
-
raise ValidateError, "invalid io" unless value.
|
38
|
+
raise ValidateError, "invalid io" unless IO_METHODS.all? { |method| value.respond_to? method }
|
26
39
|
end
|
27
40
|
|
28
41
|
def self.validate_hash(value)
|
data/lib/lzws/version.rb
CHANGED
metadata
CHANGED
@@ -1,99 +1,141 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lzws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Aladjev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: codecov
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: minitar
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
33
|
+
version: '0.9'
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
40
|
+
version: '0.9'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: minitest
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
47
|
+
version: '5.12'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5.
|
54
|
+
version: '5.12'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: ocg
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
61
|
+
version: '1.1'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
68
|
+
version: '1.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake-compiler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: rubocop
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
101
|
- - "~>"
|
60
102
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
103
|
+
version: '0.75'
|
62
104
|
type: :development
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
108
|
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
110
|
+
version: '0.75'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: rubocop-performance
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - "~>"
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
117
|
+
version: '1.5'
|
76
118
|
type: :development
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
122
|
- - "~>"
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
124
|
+
version: '1.5'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
126
|
+
name: simplecov
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
|
-
- - "
|
129
|
+
- - ">="
|
88
130
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
131
|
+
version: '0'
|
90
132
|
type: :development
|
91
133
|
prerelease: false
|
92
134
|
version_requirements: !ruby/object:Gem::Requirement
|
93
135
|
requirements:
|
94
|
-
- - "
|
136
|
+
- - ">="
|
95
137
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
138
|
+
version: '0'
|
97
139
|
description:
|
98
140
|
email: aladjev.andrew@gmail.com
|
99
141
|
executables: []
|
@@ -158,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
200
|
- !ruby/object:Gem::Version
|
159
201
|
version: '0'
|
160
202
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
203
|
+
rubygems_version: 3.1.2
|
162
204
|
signing_key:
|
163
205
|
specification_version: 4
|
164
206
|
summary: Ruby bindings for lzws library.
|