file_validators 3.0.0.beta2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7536b453f528e82937d43e4349c6cb99f990832023a5567d125b817b59f3b71a
4
- data.tar.gz: e33270b079d15c08aed6a2b3e1f2aab9f61d39fc222f9c42e15a0a9a34f82885
3
+ metadata.gz: 3a55a08bc74303b69e964f61e3726e8ee00278c4cd0cd6fc217691c85114bcfb
4
+ data.tar.gz: be3b6d628de09d262a97abf3099ff66fd2e89dd27eec3030523a7f36c82e17df
5
5
  SHA512:
6
- metadata.gz: 2c47e7fe802dc65553c2dfa5a72c2d05d97d4d14dcdf2c6826f7ae18e586a8754b1b4dc07c20abec2038b55c6d1766df96c19f968217630270586c92bab4101f
7
- data.tar.gz: b8b0c693d4314614c2cd8f72a699b48c666487c4b44221f25daf9f70cc0d27d1b09766b9ef8e035ed14690ea9d24aac10cdbcc62d1e89bf2a683e46a7e39fec0
6
+ metadata.gz: cf5b75fb78eaf84f42abef75255572b1917012fbdbdd70d771da14c366619677fb69f4c45d688b8851d5b99dbba44ccd08da6c7025c3819c40259e23502f5c61
7
+ data.tar.gz: 92e9c49f94d8cbc1c2f8aa7425527e84555e94d25c12b6ca1b51e4d5e51f765defb274264996174e6757d8606270f5513232be64d234717075abab8680d8f7c9
@@ -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/activemodel_5.2.gemfile
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
- - rvm: 2.5.0
24
- gemfile: gemfiles/activemodel_4.2.gemfile
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
- - rvm: jruby-9.0.4.0
36
- gemfile: gemfiles/activemodel_5.2.gemfile
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-5.2' do
28
- gem 'activemodel', '5.2.1'
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
@@ -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
  [![Gem Version](https://badge.fury.io/rb/file_validators.svg)](http://badge.fury.io/rb/file_validators)
4
4
  [![Build Status](https://travis-ci.org/musaffa/file_validators.svg)](https://travis-ci.org/musaffa/file_validators)
5
- [![Dependency Status](https://gemnasium.com/musaffa/file_validators.svg)](https://gemnasium.com/musaffa/file_validators)
6
5
  [![Coverage Status](https://coveralls.io/repos/musaffa/file_validators/badge.png)](https://coveralls.io/r/musaffa/file_validators)
7
6
  [![Code Climate](https://codeclimate.com/github/musaffa/file_validators/badges/gpa.svg)](https://codeclimate.com/github/musaffa/file_validators)
8
7
  [![Inline docs](http://inch-ci.org/github/musaffa/file_validators.svg)](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 5.
16
- * Rails versions: 3.2, 4 and 5.
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` model. `:relaxed` mode uses file name to detect
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`.
@@ -3,6 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "activemodel", "5.2.1"
6
+ gem "activemodel", "6.0.3"
7
7
 
8
8
  gemspec :path => "../"
@@ -3,7 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "activemodel", "4.1.6"
7
- gem "rack", "1.6.5"
6
+ gem "activemodel", "6.1.0"
8
7
 
9
8
  gemspec :path => "../"
@@ -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
@@ -67,7 +67,7 @@ module ActiveModel
67
67
  record.errors.add(
68
68
  attribute,
69
69
  "file_size_is_#{option}".to_sym,
70
- filtered_options(values).merge!(detect_error_options(option_value))
70
+ **filtered_options(values).merge!(detect_error_options(option_value))
71
71
  )
72
72
  end
73
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FileValidators
4
- VERSION = '3.0.0.beta2'
4
+ VERSION = '3.0.0'
5
5
  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.beta2
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-06 00:00:00.000000000 Z
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/activemodel_5.2.gemfile
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: 1.3.1
233
+ version: '0'
235
234
  requirements: []
236
235
  rubygems_version: 3.1.2
237
236
  signing_key:
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "activemodel", "4.2.7.1"
7
- gem "rack", "1.6.5"
8
-
9
- gemspec :path => "../"