activestorage-validator 0.4.0 → 0.5.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/.github/workflows/rspec.yml +17 -3
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/gemfiles/rails61.gemfile +2 -1
- data/gemfiles/rails70.gemfile +2 -1
- data/gemfiles/rails71.gemfile +6 -0
- data/gemfiles/rails72.gemfile +6 -0
- data/gemfiles/rails80.gemfile +6 -0
- data/lib/activestorage/validator/blob.rb +3 -3
- data/lib/activestorage/validator/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb2851d4b64cc39176ceaba155c80ac8989930899110e55f471c67df9d78a1bc
|
4
|
+
data.tar.gz: ea620cd996d2b50cf53e058fb43acc89652c5edaaa754de8f333855bab4f177e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9288e28946a1e1fb38691329eae86807c4d781116b2f64b389a6bc4e8b3c8e87c0cff3342c1bf716693126d84d64d553a0abddd2ae7a99e4fd28855f9940f0db
|
7
|
+
data.tar.gz: 6098588122be931263ae237cd6e486c1a975e446578502179f6b2064ed54ef1397431e3a23ce9aa1c086ecddc3fc49e42a2d402ed725472b57587ca8cc42d975
|
data/.github/workflows/rspec.yml
CHANGED
@@ -22,15 +22,29 @@ jobs:
|
|
22
22
|
strategy:
|
23
23
|
fail-fast: false
|
24
24
|
matrix:
|
25
|
-
|
26
|
-
|
25
|
+
include:
|
26
|
+
- { ruby: "3.0", gemfile: "rails61" }
|
27
|
+
- { ruby: "3.1", gemfile: "rails61" }
|
28
|
+
- { ruby: "3.2", gemfile: "rails61" }
|
29
|
+
- { ruby: "3.0", gemfile: "rails70" }
|
30
|
+
- { ruby: "3.1", gemfile: "rails70" }
|
31
|
+
- { ruby: "3.2", gemfile: "rails70" }
|
32
|
+
- { ruby: "3.0", gemfile: "rails71" }
|
33
|
+
- { ruby: "3.1", gemfile: "rails71" }
|
34
|
+
- { ruby: "3.2", gemfile: "rails71" }
|
35
|
+
- { ruby: "3.2", gemfile: "rails72" }
|
36
|
+
- { ruby: "3.3", gemfile: "rails72" }
|
37
|
+
- { ruby: "3.4", gemfile: "rails72" }
|
38
|
+
- { ruby: "3.2", gemfile: "rails80" }
|
39
|
+
- { ruby: "3.3", gemfile: "rails80" }
|
40
|
+
- { ruby: "3.4", gemfile: "rails80" }
|
27
41
|
steps:
|
28
42
|
- name: Install packages
|
29
43
|
run: |
|
30
44
|
sudo apt update -y
|
31
45
|
sudo apt install -y libsqlite3-dev
|
32
46
|
|
33
|
-
- uses: actions/checkout@
|
47
|
+
- uses: actions/checkout@v4
|
34
48
|
|
35
49
|
- name: Set up Ruby
|
36
50
|
uses: ruby/setup-ruby@v1
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/gemfiles/rails61.gemfile
CHANGED
data/gemfiles/rails70.gemfile
CHANGED
@@ -7,14 +7,14 @@ module ActiveRecord
|
|
7
7
|
Array(values).each do |value|
|
8
8
|
if options[:size_range].present?
|
9
9
|
if options[:size_range].min > value.blob.byte_size
|
10
|
-
record.errors.add(attribute, :min_size_error, min_size: ActiveSupport::NumberHelper.number_to_human_size(options[:size_range].min))
|
10
|
+
record.errors.add(attribute, :min_size_error, min_size: ActiveSupport::NumberHelper.number_to_human_size(options[:size_range].min), filename: value.blob.filename.to_s)
|
11
11
|
elsif options[:size_range].max < value.blob.byte_size
|
12
|
-
record.errors.add(attribute, :max_size_error, max_size: ActiveSupport::NumberHelper.number_to_human_size(options[:size_range].max))
|
12
|
+
record.errors.add(attribute, :max_size_error, max_size: ActiveSupport::NumberHelper.number_to_human_size(options[:size_range].max), filename: value.blob.filename.to_s)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
unless valid_content_type?(value.blob)
|
17
|
-
record.errors.add(attribute, :content_type)
|
17
|
+
record.errors.add(attribute, :content_type, filename: value.blob.filename.to_s)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage-validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-06-15 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rails
|
@@ -110,6 +109,9 @@ files:
|
|
110
109
|
- config/locales/pt-br.yml
|
111
110
|
- gemfiles/rails61.gemfile
|
112
111
|
- gemfiles/rails70.gemfile
|
112
|
+
- gemfiles/rails71.gemfile
|
113
|
+
- gemfiles/rails72.gemfile
|
114
|
+
- gemfiles/rails80.gemfile
|
113
115
|
- lib/activestorage/validator.rb
|
114
116
|
- lib/activestorage/validator/blob.rb
|
115
117
|
- lib/activestorage/validator/version.rb
|
@@ -117,7 +119,6 @@ homepage: https://github.com/aki77/activestorage-validator
|
|
117
119
|
licenses:
|
118
120
|
- MIT
|
119
121
|
metadata: {}
|
120
|
-
post_install_message:
|
121
122
|
rdoc_options: []
|
122
123
|
require_paths:
|
123
124
|
- lib
|
@@ -132,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
133
|
- !ruby/object:Gem::Version
|
133
134
|
version: '0'
|
134
135
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
136
|
-
signing_key:
|
136
|
+
rubygems_version: 3.6.2
|
137
137
|
specification_version: 4
|
138
138
|
summary: ActiveStorage blob validator.
|
139
139
|
test_files: []
|