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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c09a9b8ded80c3fe2be9547622aa8408fbdd9c7cd4a1beee2ab1425809f62ba9
4
- data.tar.gz: 841c661ce228726b1fa7c28adcabe006bb561c50122e317b9fb628b8ebfc6630
3
+ metadata.gz: eb2851d4b64cc39176ceaba155c80ac8989930899110e55f471c67df9d78a1bc
4
+ data.tar.gz: ea620cd996d2b50cf53e058fb43acc89652c5edaaa754de8f333855bab4f177e
5
5
  SHA512:
6
- metadata.gz: 5ec8362922c900e8ace6185e8c23a40a8a366c671a341397189e6035eeda0c1ca8826d49ae0d244bcbcaa655d2dbe6df367640914bb5e0edf54d143be03ecb5c
7
- data.tar.gz: 3528baa631ad61e40c0a04785dd92bbc60af1b442d843be91956a64c9db082085aa6ea15024ee4f37e026aeb88bfcee8e05c2a8561be422a6768a427831bc48d
6
+ metadata.gz: 9288e28946a1e1fb38691329eae86807c4d781116b2f64b389a6bc4e8b3c8e87c0cff3342c1bf716693126d84d64d553a0abddd2ae7a99e4fd28855f9940f0db
7
+ data.tar.gz: 6098588122be931263ae237cd6e486c1a975e446578502179f6b2064ed54ef1397431e3a23ce9aa1c086ecddc3fc49e42a2d402ed725472b57587ca8cc42d975
@@ -22,15 +22,29 @@ jobs:
22
22
  strategy:
23
23
  fail-fast: false
24
24
  matrix:
25
- ruby: ["3.0", 3.1, 3.2]
26
- gemfile: [rails61, rails70]
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@v3
47
+ - uses: actions/checkout@v4
34
48
 
35
49
  - name: Set up Ruby
36
50
  uses: ruby/setup-ruby@v1
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /.bundle/
2
+ /vendor/bundle/
2
3
  /.yardoc
3
4
  /_yardoc/
4
5
  /coverage/
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Changelog
2
+
3
+ For changelogs from version 0.5.0 onwards, please see the [GitHub Releases page](https://github.com/aki77/activestorage-validator/releases).
4
+
1
5
  ## [Unreleased]
2
6
 
3
7
  ## 0.4.0
@@ -1,6 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'rails', '6.1.4'
4
- gem 'sqlite3'
4
+ gem 'sqlite3', '~> 1.4'
5
+ gem 'concurrent-ruby', '< 1.3.5'
5
6
 
6
7
  gemspec path: '../'
@@ -1,6 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'rails', '~> 7.0.0'
4
- gem 'sqlite3'
4
+ gem 'sqlite3', '~> 1.4'
5
+ gem 'concurrent-ruby', '< 1.3.5'
5
6
 
6
7
  gemspec path: '../'
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails', '~> 7.1.0'
4
+ gem 'sqlite3'
5
+
6
+ gemspec path: '../'
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails', '~> 7.2.0'
4
+ gem 'sqlite3'
5
+
6
+ gemspec path: '../'
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails', '~> 8.0.0'
4
+ gem 'sqlite3'
5
+
6
+ gemspec path: '../'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module ActiveStorage
2
2
  module Validator
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  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.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: 2023-04-15 00:00:00.000000000 Z
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.3.7
136
- signing_key:
136
+ rubygems_version: 3.6.2
137
137
  specification_version: 4
138
138
  summary: ActiveStorage blob validator.
139
139
  test_files: []