mimi-core 1.1.1 → 1.2.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
  SHA1:
3
- metadata.gz: ed8ff7ca98a2f001f02b9b081222c923663685c4
4
- data.tar.gz: fbbedb5ad2985c5d7343c68e6c4fba2aa2c2ab9f
3
+ metadata.gz: 5c34c8dca865e034defa218ffbc461136650420a
4
+ data.tar.gz: 8bd4b5b12b7f258853145636870998df0f6669fb
5
5
  SHA512:
6
- metadata.gz: 64dbbc6a90c4434e2a0ec1fb7c364b31eb454aa349436e7808ffbf370c77bfd044da206ef8112489eaf26abe192b1c96bf3eb7473f20f019a10fd163983fd0fa
7
- data.tar.gz: 3f975d0834276f2bfae3de685bd5a2987e32fbbac8df9bbb1edb0992043576125a616c2dcd1097e198fa9557ce9be544292bd3eb7934d7106eae135516f744ad
6
+ metadata.gz: 2fd8235b0bef748a1db7974ed62050b6bba3acc285f837e803bb91d6eeca8948bf7b23ed9ec9481f32fd94a4457f0b9fb51e82b07507a924aef1f839c031a5e6
7
+ data.tar.gz: 48392a423929b3b4cc7ad56db1cde2da908e74e152ff747b91e091b098c705283dc2f133e787db9a484b74486aaff0a3e2a69c54153d24170d0c15af521ad826
@@ -226,7 +226,7 @@ module Mimi
226
226
  # ```
227
227
  #
228
228
  # If `:default` is specified for the parameter and the value is not provided,
229
- # the default value is returned as-is, bypassing validation and type coercion.
229
+ # the default value is returned, converted to corresponding type, if it is not nil
230
230
  #
231
231
  # ```ruby
232
232
  # manifest = Mimi::Core::Manifest.new(var1: { default: nil })
@@ -514,7 +514,9 @@ module Mimi
514
514
  #
515
515
  def process_single_value(value, properties)
516
516
  if properties[:const] || value.nil?
517
- return properties[:default].is_a?(Proc) ? properties[:default].call : properties[:default]
517
+ return properties[:default].call if properties[:default].is_a?(Proc)
518
+ return nil if properties[:default].nil?
519
+ value = properties[:default]
518
520
  end
519
521
  case properties[:type]
520
522
  when :string
@@ -1,5 +1,5 @@
1
1
  module Mimi
2
2
  module Core
3
- VERSION = '1.1.1'.freeze
3
+ VERSION = '1.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mimi-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kukushkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-30 00:00:00.000000000 Z
11
+ date: 2019-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler