file_validators 3.0.0.beta2 → 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 +4 -4
- data/.travis.yml +26 -10
- data/Appraisals +6 -12
- data/CHANGELOG.md +6 -1
- data/README.md +3 -4
- data/gemfiles/{activemodel_5.2.gemfile → activemodel_6.0.gemfile} +1 -1
- data/gemfiles/{activemodel_4.1.gemfile → activemodel_6.1.gemfile} +1 -2
- data/lib/file_validators/validators/file_content_type_validator.rb +1 -1
- data/lib/file_validators/validators/file_size_validator.rb +1 -1
- data/lib/file_validators/version.rb +1 -1
- metadata +6 -7
- data/gemfiles/activemodel_4.2.gemfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a55a08bc74303b69e964f61e3726e8ee00278c4cd0cd6fc217691c85114bcfb
|
4
|
+
data.tar.gz: be3b6d628de09d262a97abf3099ff66fd2e89dd27eec3030523a7f36c82e17df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf5b75fb78eaf84f42abef75255572b1917012fbdbdd70d771da14c366619677fb69f4c45d688b8851d5b99dbba44ccd08da6c7025c3819c40259e23502f5c61
|
7
|
+
data.tar.gz: 92e9c49f94d8cbc1c2f8aa7425527e84555e94d25c12b6ca1b51e4d5e51f765defb274264996174e6757d8606270f5513232be64d234717075abab8680d8f7c9
|
data/.travis.yml
CHANGED
@@ -3,37 +3,53 @@ language: ruby
|
|
3
3
|
rvm:
|
4
4
|
- 2.2.3
|
5
5
|
- 2.5.0
|
6
|
+
- 3.0.0
|
6
7
|
- ruby-head
|
7
|
-
- jruby-9.0.4.0
|
8
8
|
- jruby-9.1.7.0
|
9
|
+
- jruby-9.2.13.0
|
9
10
|
|
10
11
|
gemfile:
|
11
|
-
- gemfiles/
|
12
|
+
- gemfiles/activemodel_6.1.gemfile
|
13
|
+
- gemfiles/activemodel_6.0.gemfile
|
12
14
|
- gemfiles/activemodel_5.0.gemfile
|
13
|
-
- gemfiles/activemodel_4.2.gemfile
|
14
15
|
- gemfiles/activemodel_4.0.gemfile
|
15
16
|
- gemfiles/activemodel_3.2.gemfile
|
16
17
|
|
17
18
|
matrix:
|
18
19
|
exclude:
|
20
|
+
- rvm: 2.2.3
|
21
|
+
gemfile: gemfiles/activemodel_6.0.gemfile
|
22
|
+
- rvm: 2.2.3
|
23
|
+
gemfile: gemfiles/activemodel_6.1.gemfile
|
24
|
+
|
19
25
|
- rvm: 2.5.0
|
20
26
|
gemfile: gemfiles/activemodel_3.2.gemfile
|
21
27
|
- rvm: 2.5.0
|
22
28
|
gemfile: gemfiles/activemodel_4.0.gemfile
|
23
|
-
|
24
|
-
|
29
|
+
|
30
|
+
- rvm: 3.0.0
|
31
|
+
gemfile: gemfiles/activemodel_3.2.gemfile
|
32
|
+
- rvm: 3.0.0
|
33
|
+
gemfile: gemfiles/activemodel_4.0.gemfile
|
34
|
+
- rvm: 3.0.0
|
35
|
+
gemfile: gemfiles/activemodel_5.0.gemfile
|
25
36
|
|
26
37
|
- rvm: ruby-head
|
27
38
|
gemfile: gemfiles/activemodel_3.2.gemfile
|
28
39
|
- rvm: ruby-head
|
29
40
|
gemfile: gemfiles/activemodel_4.0.gemfile
|
30
41
|
- rvm: ruby-head
|
31
|
-
gemfile: gemfiles/activemodel_4.2.gemfile
|
32
|
-
|
33
|
-
- rvm: jruby-9.0.4.0
|
34
42
|
gemfile: gemfiles/activemodel_5.0.gemfile
|
35
|
-
|
36
|
-
|
43
|
+
|
44
|
+
- rvm: jruby-9.1.7.0
|
45
|
+
gemfile: gemfiles/activemodel_6.0.gemfile
|
46
|
+
- rvm: jruby-9.1.7.0
|
47
|
+
gemfile: gemfiles/activemodel_6.1.gemfile
|
48
|
+
|
49
|
+
- rvm: jruby-9.2.13.0
|
50
|
+
gemfile: gemfiles/activemodel_3.2.gemfile
|
51
|
+
- rvm: jruby-9.2.13.0
|
52
|
+
gemfile: gemfiles/activemodel_4.0.gemfile
|
37
53
|
|
38
54
|
allow_failures:
|
39
55
|
- rvm: ruby-head
|
data/Appraisals
CHANGED
@@ -10,20 +10,14 @@ appraise 'activemodel-4.0' do
|
|
10
10
|
gem 'rack', '1.6.5'
|
11
11
|
end
|
12
12
|
|
13
|
-
appraise 'activemodel-4.1' do
|
14
|
-
gem 'activemodel', '4.1.6'
|
15
|
-
gem 'rack', '1.6.5'
|
16
|
-
end
|
17
|
-
|
18
|
-
appraise 'activemodel-4.2' do
|
19
|
-
gem 'activemodel', '4.2.7.1'
|
20
|
-
gem 'rack', '1.6.5'
|
21
|
-
end
|
22
|
-
|
23
13
|
appraise 'activemodel-5.0' do
|
24
14
|
gem 'activemodel', '5.0.1'
|
25
15
|
end
|
26
16
|
|
27
|
-
appraise 'activemodel-
|
28
|
-
gem 'activemodel', '
|
17
|
+
appraise 'activemodel-6.0' do
|
18
|
+
gem 'activemodel', '6.0.3'
|
19
|
+
end
|
20
|
+
|
21
|
+
appraise 'activemodel-6.1' do
|
22
|
+
gem 'activemodel', '6.1.0'
|
29
23
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
# 3.0.0
|
2
|
+
|
3
|
+
* [#32](https://github.com/musaffa/file_validators/pull/32) Removed cocaine/terrapin. Added options for choosing MIME type analyzers with `:tool` option.
|
4
|
+
* [#40](https://github.com/musaffa/file_validators/pull/40) Added Support for Ruby 3.
|
5
|
+
* Rubocop style guide
|
6
|
+
|
1
7
|
# 3.0.0.beta2
|
2
8
|
|
3
9
|
* [#32](https://github.com/musaffa/file_validators/pull/32) Removed terrapin. Added options for choosing MIME type analyzers with `:tool` option.
|
4
|
-
* Rubocop style guide
|
5
10
|
|
6
11
|
# 3.0.0.beta1
|
7
12
|
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/file_validators)
|
4
4
|
[](https://travis-ci.org/musaffa/file_validators)
|
5
|
-
[](https://gemnasium.com/musaffa/file_validators)
|
6
5
|
[](https://coveralls.io/r/musaffa/file_validators)
|
7
6
|
[](https://codeclimate.com/github/musaffa/file_validators)
|
8
7
|
[](http://inch-ci.org/github/musaffa/file_validators)
|
@@ -12,8 +11,8 @@ Any module that uses ActiveModel, for example ActiveRecord, can use these file v
|
|
12
11
|
|
13
12
|
## Support
|
14
13
|
|
15
|
-
* ActiveModel versions: 3.2, 4 and
|
16
|
-
* Rails versions: 3.2, 4 and
|
14
|
+
* ActiveModel versions: 3.2, 4, 5 and 6.
|
15
|
+
* Rails versions: 3.2, 4, 5 and 6.
|
17
16
|
|
18
17
|
As of version `2.2`, activemodel 3.0 and 3.1 will no longer be supported.
|
19
18
|
For activemodel 3.0 and 3.1, please use file_validators version `<= 2.1`.
|
@@ -142,7 +141,7 @@ validates :video, file_content_type: { allow: lambda { |record| record.content_t
|
|
142
141
|
can be a String or a Regexp. It also accepts `proc`. See `:allow` options examples.
|
143
142
|
* `mode`: `:strict` or `:relaxed`. `:strict` mode can detect content type based on the contents
|
144
143
|
of the files. It also detects media type spoofing (see more in [security](#security)).
|
145
|
-
`:file` analyzer is used in `:strict`
|
144
|
+
`:file` analyzer is used in `:strict` mode. `:relaxed` mode uses file name to detect
|
146
145
|
the content type. `mime_types` analyzer is used in `relaxed` mode. If mode option is not
|
147
146
|
set then the validator uses form supplied content type.
|
148
147
|
* `tool`: `:file`, `:fastimage`, `:filemagic`, `:mimemagic`, `:marcel`, `:mime_types`, `:mini_mime`.
|
@@ -87,7 +87,7 @@ module ActiveModel
|
|
87
87
|
def mark_invalid(record, attribute, error, option_types)
|
88
88
|
error_options = options.merge(types: option_types.join(', '))
|
89
89
|
unless record.errors.added?(attribute, error, error_options)
|
90
|
-
record.errors.add attribute, error, error_options
|
90
|
+
record.errors.add attribute, error, **error_options
|
91
91
|
end
|
92
92
|
end
|
93
93
|
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: 3.0.0
|
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: 2020-
|
11
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -186,10 +186,9 @@ files:
|
|
186
186
|
- file_validators.gemspec
|
187
187
|
- gemfiles/activemodel_3.2.gemfile
|
188
188
|
- gemfiles/activemodel_4.0.gemfile
|
189
|
-
- gemfiles/activemodel_4.1.gemfile
|
190
|
-
- gemfiles/activemodel_4.2.gemfile
|
191
189
|
- gemfiles/activemodel_5.0.gemfile
|
192
|
-
- gemfiles/
|
190
|
+
- gemfiles/activemodel_6.0.gemfile
|
191
|
+
- gemfiles/activemodel_6.1.gemfile
|
193
192
|
- lib/file_validators.rb
|
194
193
|
- lib/file_validators/error.rb
|
195
194
|
- lib/file_validators/locale/en.yml
|
@@ -229,9 +228,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
229
228
|
version: '0'
|
230
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
230
|
requirements:
|
232
|
-
- - "
|
231
|
+
- - ">="
|
233
232
|
- !ruby/object:Gem::Version
|
234
|
-
version:
|
233
|
+
version: '0'
|
235
234
|
requirements: []
|
236
235
|
rubygems_version: 3.1.2
|
237
236
|
signing_key:
|