formeze 4.2.0 → 4.2.1

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: 959c1584612e08ca4e490f77a71bef8e2f2be9c1db827dc2903335a7f8a340b2
4
- data.tar.gz: 60d9b150269c308824e72282e5ea55b5bdb369f04cfe7120dec8f9a7764157bd
3
+ metadata.gz: 39b1043817638b51294f4ca2da81e2e2fa1829f7209eb0026bedffca84c7b430
4
+ data.tar.gz: 0e4d59c83e428005f01522430e740795accb24831dcc226cd1ce30eda28afada
5
5
  SHA512:
6
- metadata.gz: d19f682f89a2222e8043d9a4a3569ef8e977cf33070723e655a4e6268b2bce45e5b410608db0a8648731a4be55774fe7d89ca15d63da2ac7c7247bdba23c4e9d
7
- data.tar.gz: fe373bbd667d964054c625e7d188721222f02d384de318184296a3fef6ed85da96443c1834649349792f33a6320e69ac29ad933b2b6e3d1a013233f6a067b30d
6
+ metadata.gz: 865f278fd2c8456a1def21e04d2150d6487727eceda9bc6d1ce375cba906f4a177e76cb158eea0cbe40d1cd1c6da785efb512c301647ebbcc8155d2aae8a7061
7
+ data.tar.gz: e20a37f37ebbb28932174a148cedd37fd251f97fa05986b0302ddf4e7f7897638d3f722af071060fca0704d0f97265e273478cd01721a1383b72feabb1279896
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 4.2.1
2
+
3
+ * Fixed regression in v4.2.0 when mime-types gem is not loaded
4
+
1
5
  # 4.2.0
2
6
 
3
7
  * Fixed file validation for e.g. `.md` files sent as application/octet-stream
data/formeze.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'formeze'
3
- s.version = '4.2.0'
3
+ s.version = '4.2.1'
4
4
  s.license = 'LGPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
data/lib/formeze/field.rb CHANGED
@@ -59,16 +59,14 @@ class Formeze::Field
59
59
  form.send(:"#{name}=", object)
60
60
  end
61
61
 
62
- BINARY = MIME::Types['application/octet-stream'].first
63
-
64
62
  def acceptable_file?(object)
65
- type = MIME::Types[object.content_type].first
66
-
67
63
  types = MIME::Types.type_for(object.original_filename)
68
64
 
69
- if type == BINARY
65
+ if object.content_type == 'application/octet-stream'
70
66
  types.any? { |type| accept.include?(type) }
71
67
  else
68
+ type = MIME::Types[object.content_type].first
69
+
72
70
  accept.include?(type) && types.include?(type)
73
71
  end
74
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formeze
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-07 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby gem for validating form data
14
14
  email: