paramore 3.6.4 → 3.8.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: f25798a2596838cff8c3355c05286e6c8c6c0493226fed24f93d6d27271a10a5
4
- data.tar.gz: 9a1bff5d5e92b3fab7045b2ad8904d97b7de7c814f37e9d0535028648db46bc1
3
+ metadata.gz: fb9cb65dc81c466a739cc7a64b97c0a4cefcc34e3307b045344146b03311538e
4
+ data.tar.gz: 8705b38d4a047d8fd8bde08f3109419452f752a404a076a90fc4a53fcef3eee8
5
5
  SHA512:
6
- metadata.gz: 2a21bf0e45a727fa73473d6d011f6650e0894843962d0c9b493e01093792fd87add7ba1462e66440155b8269ff03d2d49780453f220d847ccafaf22e2a642a03
7
- data.tar.gz: 9b6d06d90120343be0cd44665c4642c461f02e76a053e694f87e51447e0285eb741d32caa53d888d39ad4000e5fd9bc9e83400f9f07066f6fa78cc77ea8ccc1f
6
+ metadata.gz: d881d9275da96cbb82100c3e2b3e3928631e2255068950c1d6f7fcddaf5bf01c96eee0d75781a27c2253200551a9c75d9497c420ab653ce1ae28738f3aa83a29
7
+ data.tar.gz: 62ce73d067d64d61e244295b03cd93385e4235d85066cb57652946b70e6df28ed2f310f0f5d5c4a5ba53c980cc706677d49ed6516bad93f183e36f6b1ffef162
@@ -22,8 +22,14 @@ module Paramore
22
22
  when Array
23
23
  typecast_array(field, value, name)
24
24
  else
25
- if value == '' && !field.allow_empty? && field.nullable?
26
- nil
25
+ if value == '' && !field.allow_empty?
26
+ if field.default?
27
+ field.default
28
+ elsif field.nullable?
29
+ nil
30
+ else
31
+ raise Paramore::NilParameter, name
32
+ end
27
33
  else
28
34
  typecast_value(field.type, value, name)
29
35
  end
@@ -6,7 +6,7 @@ module Paramore
6
6
  null: false,
7
7
  compact: false,
8
8
  default: nil,
9
- empty: false,
9
+ empty: true,
10
10
  required: true,
11
11
  }.freeze
12
12
 
@@ -56,4 +56,20 @@ module Paramore
56
56
  ::Date.parse(input)
57
57
  end
58
58
  end
59
+
60
+ module File
61
+ VALID_CLASSES = [
62
+ File,
63
+ StringIO,
64
+ Rack::Test::UploadedFile,
65
+ ActionDispatch::Http::UploadedFile,
66
+ ].freeze
67
+
68
+ module_function
69
+ def [](input)
70
+ raise "#{input.class} is not a file!" unless input.class.in?(VALID_CLASSES)
71
+
72
+ input
73
+ end
74
+ end
59
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paramore
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.4
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Kairevičius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -115,7 +115,7 @@ licenses:
115
115
  - MIT
116
116
  metadata: {}
117
117
  post_install_message: |
118
- Thank you for installing Paramore 3.6.4 !
118
+ Thank you for installing Paramore 3.8.1 !
119
119
  From the command line you can run `paramore` to generate a configuration file
120
120
 
121
121
  More details here : https://github.com/lumzdas/paramore/blob/master/README.md