paramore 3.6.2 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paramore/cast_parameters.rb +3 -1
- data/lib/paramore/field.rb +1 -1
- data/lib/paramore/types.rb +17 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f4d632e13e525b85eacf0f3c67c7123d998d488785e484bb7ab200f436ba9dc
|
4
|
+
data.tar.gz: 9421b6ac0f62e255d00039ecefd5652c75a29bb740bf51695d543d635a9d3a6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65bcb1cf925f83ed2ceb4b3364451aa9ff2af396843427a09ece8e07beee85722420b69c651d7a52ae9c03b7a8aec7e03bca509f9cd8772c4aadded9550fec0f
|
7
|
+
data.tar.gz: 3b7ed7bd42edd6a700a41ed37670c3da207b4ab18455fc842beb374e59bbb9b403c2d26809e36be6272d475b5ce3707d930f390aa172fda4018d94fafd7b2766
|
@@ -54,9 +54,11 @@ module Paramore
|
|
54
54
|
def typecast_array(field, array, name)
|
55
55
|
raise Paramore::ArrayExpected.new(name, array) unless array.is_a?(Array)
|
56
56
|
|
57
|
-
array
|
57
|
+
result = array
|
58
58
|
.reject { |unit| unit.to_s == '' && field.compact? }
|
59
59
|
.map { |unit| cast(Paramore.field(field.type.first, null: true), unit) }
|
60
|
+
|
61
|
+
field.compact? ? result.compact : result
|
60
62
|
end
|
61
63
|
|
62
64
|
def typecast_value(type, value, name)
|
data/lib/paramore/field.rb
CHANGED
data/lib/paramore/types.rb
CHANGED
@@ -53,7 +53,23 @@ module Paramore
|
|
53
53
|
module Date
|
54
54
|
module_function
|
55
55
|
def [](input)
|
56
|
-
Date.parse(input)
|
56
|
+
::Date.parse(input)
|
57
|
+
end
|
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
|
57
73
|
end
|
58
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.
|
4
|
+
version: 3.7.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-
|
11
|
+
date: 2021-10-05 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.
|
118
|
+
Thank you for installing Paramore 3.7.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
|