paramore 3.2.0 → 3.3.0

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: b8620a326873694bcc720cd186b9f4998fde3ab3fc102e2cb81b55822accc1e1
4
- data.tar.gz: '07288ff15f31bb8480fc30662da17cd6aba34617afff96cd488c205b2c4c4660'
3
+ metadata.gz: 58abb01856e9f20f59b4bf4608e8c5444973970ac6845b96b7c12c117a0596bc
4
+ data.tar.gz: 5ed6febf9385fe094736e3e2f8b29dd8a0db845a1e3837474daf64f2a06c7bc7
5
5
  SHA512:
6
- metadata.gz: 753ede1706d8dc9563bfa8cfad77683586ac319aefd4f84f80b6247d0daa7054710809a4ae24f812196402a83628d0760992ba8f281de79197e9b69cd39f9570
7
- data.tar.gz: '078b73a5da242dc7fb75d1175232af4d52928d1cd5db1af9366ca2e95fec990c7ec0e37eaf48c3560e8f27f47a351d03bd448589354bd1f335cc3951763702f5'
6
+ metadata.gz: f21c1603f15ac94639370a7fdeaa8bbaac55c0b56e5693409ebf404272bf03df1bcbae1799888728d72b15aaf25e7c1384ab34190c38fe9c9de8de7fb2e36c85
7
+ data.tar.gz: d064f814eeccc3692a8cf7ed5502096c47657ce30b4d12300f9d57b3cf31a58724b6e576098e30a9d40a13e44793c7544006e1ead13eaef0dcf83d6b1ed053d8
@@ -9,7 +9,7 @@ module Paramore
9
9
 
10
10
  def cast(field, value, name = nil)
11
11
  if value.nil?
12
- if field.nullable? || field.default
12
+ if field.nullable? || field.default?
13
13
  return field.default
14
14
  else
15
15
  raise Paramore::NilParameter, name
@@ -19,8 +19,12 @@ module Paramore
19
19
  @allow_empty
20
20
  end
21
21
 
22
+ def default?
23
+ !@default.nil?
24
+ end
25
+
22
26
  def default
23
- @default
27
+ @default.is_a?(Proc) ? @default.call : @default
24
28
  end
25
29
 
26
30
  def compact?
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.2.0
4
+ version: 3.3.0
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-20 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -101,7 +101,7 @@ licenses:
101
101
  - MIT
102
102
  metadata: {}
103
103
  post_install_message: |
104
- Thank you for installing Paramore 3.2.0 !
104
+ Thank you for installing Paramore 3.3.0 !
105
105
  From the command line you can run `paramore` to generate a configuration file
106
106
 
107
107
  More details here : https://github.com/lumzdas/paramore/blob/master/README.md