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.
@@ -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 > 0
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.is_a? ::IO
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)
@@ -2,5 +2,5 @@
2
2
  # Copyright (c) 2019 AUTHORS, MIT License.
3
3
 
4
4
  module LZWS
5
- VERSION = "1.1.0".freeze
5
+ VERSION = "1.1.5".freeze
6
6
  end
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.0
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: 2019-10-12 00:00:00.000000000 Z
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.8'
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.8'
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.11'
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.11'
54
+ version: '5.12'
41
55
  - !ruby/object:Gem::Dependency
42
- name: rake-compiler
56
+ name: ocg
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.0'
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.0'
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.74'
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.74'
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.4'
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.4'
124
+ version: '1.5'
83
125
  - !ruby/object:Gem::Dependency
84
- name: rubocop-rails
126
+ name: simplecov
85
127
  requirement: !ruby/object:Gem::Requirement
86
128
  requirements:
87
- - - "~>"
129
+ - - ">="
88
130
  - !ruby/object:Gem::Version
89
- version: '2.2'
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: '2.2'
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.0.6
203
+ rubygems_version: 3.1.2
162
204
  signing_key:
163
205
  specification_version: 4
164
206
  summary: Ruby bindings for lzws library.