file_validators 2.1.0 → 3.0.0
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 +5 -5
- data/.gitignore +2 -0
- data/.rubocop.yml +32 -0
- data/.tool-versions +1 -0
- data/.travis.yml +43 -7
- data/Appraisals +13 -13
- data/CHANGELOG.md +31 -0
- data/Gemfile +2 -0
- data/README.md +26 -18
- data/Rakefile +3 -1
- data/file_validators.gemspec +13 -7
- data/gemfiles/activemodel_3.2.gemfile +2 -1
- data/gemfiles/activemodel_4.0.gemfile +2 -1
- data/gemfiles/{activemodel_4.2.gemfile → activemodel_5.0.gemfile} +1 -1
- data/gemfiles/{activemodel_4.1.gemfile → activemodel_6.0.gemfile} +1 -1
- data/gemfiles/{activemodel_3.0.gemfile → activemodel_6.1.gemfile} +1 -1
- data/lib/file_validators.rb +6 -7
- data/lib/file_validators/error.rb +6 -0
- data/lib/file_validators/mime_type_analyzer.rb +106 -0
- data/lib/file_validators/validators/file_content_type_validator.rb +37 -33
- data/lib/file_validators/validators/file_size_validator.rb +62 -19
- data/lib/file_validators/version.rb +3 -1
- data/spec/integration/combined_validators_integration_spec.rb +3 -1
- data/spec/integration/file_content_type_validation_integration_spec.rb +117 -11
- data/spec/integration/file_size_validator_integration_spec.rb +100 -10
- data/spec/lib/file_validators/mime_type_analyzer_spec.rb +139 -0
- data/spec/lib/file_validators/validators/file_content_type_validator_spec.rb +90 -32
- data/spec/lib/file_validators/validators/file_size_validator_spec.rb +84 -30
- data/spec/spec_helper.rb +5 -0
- data/spec/support/fakeio.rb +17 -0
- data/spec/support/helpers.rb +7 -0
- data/spec/support/matchers/allow_content_type.rb +2 -0
- data/spec/support/matchers/allow_file_size.rb +2 -0
- metadata +86 -28
- data/CHANGELOG.mod +0 -6
- data/gemfiles/activemodel_3.1.gemfile +0 -8
- data/lib/file_validators/utils/content_type_detector.rb +0 -64
- data/lib/file_validators/utils/media_type_spoof_detector.rb +0 -46
- data/spec/lib/file_validators/utils/content_type_detector_spec.rb +0 -27
- data/spec/lib/file_validators/utils/media_type_spoof_detector_spec.rb +0 -31
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe ActiveModel::Validations::FileSizeValidator do
|
@@ -7,9 +9,9 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
7
9
|
|
8
10
|
def storage_units
|
9
11
|
if defined?(ActiveSupport::NumberHelper) # Rails 4.0+
|
10
|
-
{ 5120 => '5 KB',
|
12
|
+
{ 5120 => '5 KB', 10_240 => '10 KB' }
|
11
13
|
else
|
12
|
-
{ 5120 => '5120 Bytes',
|
14
|
+
{ 5120 => '5120 Bytes', 10_240 => '10240 Bytes' }
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
@@ -33,7 +35,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
33
35
|
end
|
34
36
|
|
35
37
|
context 'as a proc' do
|
36
|
-
before { build_validator in:
|
38
|
+
before { build_validator in: ->(_record) { (5.kilobytes..10.kilobytes) } }
|
37
39
|
|
38
40
|
it { is_expected.to allow_file_size(7.kilobytes, @validator) }
|
39
41
|
it { is_expected.not_to allow_file_size(4.kilobytes, @validator) }
|
@@ -51,7 +53,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
51
53
|
end
|
52
54
|
|
53
55
|
context 'as a proc' do
|
54
|
-
before { build_validator greater_than_or_equal_to:
|
56
|
+
before { build_validator greater_than_or_equal_to: ->(_record) { 10.kilobytes } }
|
55
57
|
|
56
58
|
it { is_expected.to allow_file_size(11.kilobytes, @validator) }
|
57
59
|
it { is_expected.to allow_file_size(10.kilobytes, @validator) }
|
@@ -69,7 +71,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
69
71
|
end
|
70
72
|
|
71
73
|
context 'as a proc' do
|
72
|
-
before { build_validator less_than_or_equal_to:
|
74
|
+
before { build_validator less_than_or_equal_to: ->(_record) { 10.kilobytes } }
|
73
75
|
|
74
76
|
it { is_expected.to allow_file_size(9.kilobytes, @validator) }
|
75
77
|
it { is_expected.to allow_file_size(10.kilobytes, @validator) }
|
@@ -86,7 +88,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
86
88
|
end
|
87
89
|
|
88
90
|
context 'as a proc' do
|
89
|
-
before { build_validator greater_than:
|
91
|
+
before { build_validator greater_than: ->(_record) { 10.kilobytes } }
|
90
92
|
|
91
93
|
it { is_expected.to allow_file_size(11.kilobytes, @validator) }
|
92
94
|
it { is_expected.not_to allow_file_size(10.kilobytes, @validator) }
|
@@ -102,7 +104,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
102
104
|
end
|
103
105
|
|
104
106
|
context 'as a proc' do
|
105
|
-
before { build_validator less_than:
|
107
|
+
before { build_validator less_than: ->(_record) { 10.kilobytes } }
|
106
108
|
|
107
109
|
it { is_expected.to allow_file_size(9.kilobytes, @validator) }
|
108
110
|
it { is_expected.not_to allow_file_size(10.kilobytes, @validator) }
|
@@ -119,8 +121,10 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
119
121
|
end
|
120
122
|
|
121
123
|
context 'as a proc' do
|
122
|
-
before
|
123
|
-
|
124
|
+
before do
|
125
|
+
build_validator greater_than: ->(_record) { 5.kilobytes },
|
126
|
+
less_than: ->(_record) { 10.kilobytes }
|
127
|
+
end
|
124
128
|
|
125
129
|
it { is_expected.to allow_file_size(7.kilobytes, @validator) }
|
126
130
|
it { is_expected.not_to allow_file_size(5.kilobytes, @validator) }
|
@@ -129,45 +133,95 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
129
133
|
end
|
130
134
|
|
131
135
|
context 'with :message option' do
|
132
|
-
before
|
133
|
-
|
136
|
+
before do
|
137
|
+
build_validator in: (5.kilobytes..10.kilobytes),
|
138
|
+
message: 'is invalid. (Between %{min} and %{max} please.)'
|
139
|
+
end
|
134
140
|
|
135
|
-
it
|
136
|
-
|
141
|
+
it do
|
142
|
+
is_expected.not_to allow_file_size(
|
143
|
+
11.kilobytes, @validator,
|
144
|
+
message: "Avatar is invalid. (Between #{@storage_units[5120]}" \
|
145
|
+
" and #{@storage_units[10_240]} please.)"
|
146
|
+
)
|
147
|
+
end
|
137
148
|
|
138
|
-
it
|
139
|
-
|
149
|
+
it do
|
150
|
+
is_expected.to allow_file_size(
|
151
|
+
7.kilobytes, @validator,
|
152
|
+
message: "Avatar is invalid. (Between #{@storage_units[5120]}" \
|
153
|
+
" and #{@storage_units[10_240]} please.)"
|
154
|
+
)
|
155
|
+
end
|
140
156
|
end
|
141
157
|
|
142
158
|
context 'default error message' do
|
143
159
|
context 'given :in options' do
|
144
160
|
before { build_validator in: 5.kilobytes..10.kilobytes }
|
145
161
|
|
146
|
-
it
|
147
|
-
|
148
|
-
|
149
|
-
|
162
|
+
it do
|
163
|
+
is_expected.not_to allow_file_size(
|
164
|
+
11.kilobytes, @validator,
|
165
|
+
message: "Avatar file size must be between #{@storage_units[5120]}" \
|
166
|
+
" and #{@storage_units[10_240]}"
|
167
|
+
)
|
168
|
+
end
|
169
|
+
|
170
|
+
it do
|
171
|
+
is_expected.not_to allow_file_size(
|
172
|
+
4.kilobytes, @validator,
|
173
|
+
message: "Avatar file size must be between #{@storage_units[5120]}" \
|
174
|
+
" and #{@storage_units[10_240]}"
|
175
|
+
)
|
176
|
+
end
|
150
177
|
end
|
151
178
|
|
152
179
|
context 'given :greater_than and :less_than options' do
|
153
180
|
before { build_validator greater_than: 5.kilobytes, less_than: 10.kilobytes }
|
154
181
|
|
155
|
-
it
|
156
|
-
|
157
|
-
|
158
|
-
|
182
|
+
it do
|
183
|
+
is_expected.not_to allow_file_size(
|
184
|
+
11.kilobytes, @validator,
|
185
|
+
message: "Avatar file size must be less than #{@storage_units[10_240]}"
|
186
|
+
)
|
187
|
+
end
|
188
|
+
|
189
|
+
it do
|
190
|
+
is_expected.not_to allow_file_size(
|
191
|
+
4.kilobytes, @validator,
|
192
|
+
message: "Avatar file size must be greater than #{@storage_units[5120]}"
|
193
|
+
)
|
194
|
+
end
|
159
195
|
end
|
160
196
|
|
161
197
|
context 'given :greater_than_or_equal_to and :less_than_or_equal_to options' do
|
162
|
-
before
|
198
|
+
before do
|
199
|
+
build_validator greater_than_or_equal_to: 5.kilobytes,
|
200
|
+
less_than_or_equal_to: 10.kilobytes
|
201
|
+
end
|
202
|
+
|
203
|
+
it do
|
204
|
+
is_expected.not_to allow_file_size(
|
205
|
+
11.kilobytes, @validator,
|
206
|
+
message: "Avatar file size must be less than or equal to #{@storage_units[10_240]}"
|
207
|
+
)
|
208
|
+
end
|
163
209
|
|
164
|
-
it
|
165
|
-
|
166
|
-
|
167
|
-
|
210
|
+
it do
|
211
|
+
is_expected.not_to allow_file_size(
|
212
|
+
4.kilobytes, @validator,
|
213
|
+
message: "Avatar file size must be greater than or equal to #{@storage_units[5120]}"
|
214
|
+
)
|
215
|
+
end
|
168
216
|
end
|
169
217
|
end
|
170
218
|
|
219
|
+
context 'exceptional file size' do
|
220
|
+
before { build_validator less_than: 3.kilobytes }
|
221
|
+
|
222
|
+
it { is_expected.to allow_file_size(0, @validator) } # zero-byte file
|
223
|
+
it { is_expected.not_to allow_file_size(nil, @validator) }
|
224
|
+
end
|
171
225
|
|
172
226
|
context 'using the helper' do
|
173
227
|
before { Dummy.validates_file_size :avatar, in: (5.kilobytes..10.kilobytes) }
|
@@ -185,7 +239,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
185
239
|
(described_class::CHECKS.keys - [:in]).each do |argument|
|
186
240
|
it "does not raise argument error if :#{argument} is numeric or a proc" do
|
187
241
|
expect { build_validator argument => 5.kilobytes }.not_to raise_error
|
188
|
-
expect { build_validator argument =>
|
242
|
+
expect { build_validator argument => ->(_record) { 5.kilobytes } }.not_to raise_error
|
189
243
|
end
|
190
244
|
|
191
245
|
it "raises error if :#{argument} is neither a number nor a proc" do
|
@@ -195,7 +249,7 @@ describe ActiveModel::Validations::FileSizeValidator do
|
|
195
249
|
|
196
250
|
it 'does not raise argument error if :in is a range or a proc' do
|
197
251
|
expect { build_validator in: 5.kilobytes..10.kilobytes }.not_to raise_error
|
198
|
-
expect { build_validator in:
|
252
|
+
expect { build_validator in: ->(_record) { 5.kilobytes..10.kilobytes } }.not_to raise_error
|
199
253
|
end
|
200
254
|
|
201
255
|
it 'raises error if :in is neither a range nor a proc' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
ENV['RAILS_ENV'] ||= 'test'
|
2
4
|
|
3
5
|
require 'active_support'
|
6
|
+
require 'active_support/deprecation'
|
4
7
|
require 'active_support/core_ext'
|
5
8
|
require 'file_validators'
|
6
9
|
require 'rspec'
|
@@ -15,6 +18,8 @@ I18n.enforce_available_locales = false
|
|
15
18
|
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
16
19
|
|
17
20
|
RSpec.configure do |config|
|
21
|
+
config.include Helpers
|
22
|
+
|
18
23
|
# Suppress stdout in the console
|
19
24
|
config.before { allow($stdout).to receive(:write) }
|
20
25
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'forwardable'
|
4
|
+
require 'stringio'
|
5
|
+
|
6
|
+
class FakeIO
|
7
|
+
attr_reader :original_filename, :content_type
|
8
|
+
|
9
|
+
def initialize(content, filename: nil, content_type: nil)
|
10
|
+
@io = StringIO.new(content)
|
11
|
+
@original_filename = filename
|
12
|
+
@content_type = content_type
|
13
|
+
end
|
14
|
+
|
15
|
+
extend Forwardable
|
16
|
+
delegate %i[read rewind eof? close size] => :@io
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmad Musaffa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mime-types
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,21 +39,21 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: coveralls
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: fastimage
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,21 +67,49 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: marcel
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3
|
75
|
+
version: '0.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3
|
82
|
+
version: '0.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: mimemagic
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.3.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.3.2
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mini_mime
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rack-test
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
86
114
|
requirements:
|
87
115
|
- - ">="
|
@@ -95,7 +123,7 @@ dependencies:
|
|
95
123
|
- !ruby/object:Gem::Version
|
96
124
|
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
126
|
+
name: rake
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
100
128
|
requirements:
|
101
129
|
- - ">="
|
@@ -108,6 +136,34 @@ dependencies:
|
|
108
136
|
- - ">="
|
109
137
|
- !ruby/object:Gem::Version
|
110
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 3.5.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 3.5.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.58.2
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.58.2
|
111
167
|
description: Adds file validators to ActiveModel
|
112
168
|
email:
|
113
169
|
- musaffa_csemm@yahoo.com
|
@@ -117,25 +173,26 @@ extra_rdoc_files: []
|
|
117
173
|
files:
|
118
174
|
- ".gitignore"
|
119
175
|
- ".rspec"
|
176
|
+
- ".rubocop.yml"
|
177
|
+
- ".tool-versions"
|
120
178
|
- ".travis.yml"
|
121
179
|
- Appraisals
|
122
|
-
- CHANGELOG.
|
180
|
+
- CHANGELOG.md
|
123
181
|
- Gemfile
|
124
182
|
- MIT-LICENSE
|
125
183
|
- README.md
|
126
184
|
- README.rdoc
|
127
185
|
- Rakefile
|
128
186
|
- file_validators.gemspec
|
129
|
-
- gemfiles/activemodel_3.0.gemfile
|
130
|
-
- gemfiles/activemodel_3.1.gemfile
|
131
187
|
- gemfiles/activemodel_3.2.gemfile
|
132
188
|
- gemfiles/activemodel_4.0.gemfile
|
133
|
-
- gemfiles/
|
134
|
-
- gemfiles/
|
189
|
+
- gemfiles/activemodel_5.0.gemfile
|
190
|
+
- gemfiles/activemodel_6.0.gemfile
|
191
|
+
- gemfiles/activemodel_6.1.gemfile
|
135
192
|
- lib/file_validators.rb
|
193
|
+
- lib/file_validators/error.rb
|
136
194
|
- lib/file_validators/locale/en.yml
|
137
|
-
- lib/file_validators/
|
138
|
-
- lib/file_validators/utils/media_type_spoof_detector.rb
|
195
|
+
- lib/file_validators/mime_type_analyzer.rb
|
139
196
|
- lib/file_validators/validators/file_content_type_validator.rb
|
140
197
|
- lib/file_validators/validators/file_size_validator.rb
|
141
198
|
- lib/file_validators/version.rb
|
@@ -147,12 +204,13 @@ files:
|
|
147
204
|
- spec/integration/combined_validators_integration_spec.rb
|
148
205
|
- spec/integration/file_content_type_validation_integration_spec.rb
|
149
206
|
- spec/integration/file_size_validator_integration_spec.rb
|
150
|
-
- spec/lib/file_validators/
|
151
|
-
- spec/lib/file_validators/utils/media_type_spoof_detector_spec.rb
|
207
|
+
- spec/lib/file_validators/mime_type_analyzer_spec.rb
|
152
208
|
- spec/lib/file_validators/validators/file_content_type_validator_spec.rb
|
153
209
|
- spec/lib/file_validators/validators/file_size_validator_spec.rb
|
154
210
|
- spec/locale/en.yml
|
155
211
|
- spec/spec_helper.rb
|
212
|
+
- spec/support/fakeio.rb
|
213
|
+
- spec/support/helpers.rb
|
156
214
|
- spec/support/matchers/allow_content_type.rb
|
157
215
|
- spec/support/matchers/allow_file_size.rb
|
158
216
|
homepage: https://github.com/musaffa/file_validators
|
@@ -174,8 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
232
|
- !ruby/object:Gem::Version
|
175
233
|
version: '0'
|
176
234
|
requirements: []
|
177
|
-
|
178
|
-
rubygems_version: 2.5.1
|
235
|
+
rubygems_version: 3.1.2
|
179
236
|
signing_key:
|
180
237
|
specification_version: 4
|
181
238
|
summary: ActiveModel file validators
|
@@ -188,11 +245,12 @@ test_files:
|
|
188
245
|
- spec/integration/combined_validators_integration_spec.rb
|
189
246
|
- spec/integration/file_content_type_validation_integration_spec.rb
|
190
247
|
- spec/integration/file_size_validator_integration_spec.rb
|
191
|
-
- spec/lib/file_validators/
|
192
|
-
- spec/lib/file_validators/utils/media_type_spoof_detector_spec.rb
|
248
|
+
- spec/lib/file_validators/mime_type_analyzer_spec.rb
|
193
249
|
- spec/lib/file_validators/validators/file_content_type_validator_spec.rb
|
194
250
|
- spec/lib/file_validators/validators/file_size_validator_spec.rb
|
195
251
|
- spec/locale/en.yml
|
196
252
|
- spec/spec_helper.rb
|
253
|
+
- spec/support/fakeio.rb
|
254
|
+
- spec/support/helpers.rb
|
197
255
|
- spec/support/matchers/allow_content_type.rb
|
198
256
|
- spec/support/matchers/allow_file_size.rb
|