libis-tools 0.9.51 → 0.9.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22a6505236d99f66a0a0f256bd487bca6037be5c
4
- data.tar.gz: fa81725c403fb924bee58811d5e9444df990de45
3
+ metadata.gz: d26ba26b0236fcafb2b5ab2b10421792f205b47d
4
+ data.tar.gz: 333d870d81440b647f102e3694d93809d42e1ff6
5
5
  SHA512:
6
- metadata.gz: 02ff95dad22e9461b3d28bec2b37eafb56ca06b7fed6a2a1292b7eb03eea152cf8447f26d5dbe120e0cf3cdb21dcf428a77f708b3c832232a13bb4a597aabbd1
7
- data.tar.gz: cad24b04aeb638cfc2aed59d2e7fd3f5038b6081215c89be378503e6b9a39bcdcd2bf106bf951565f34bd0234450916607e0dd9076a3fcbf1677d456f6839f21
6
+ metadata.gz: eaf7b60225b008e68814c5422e4f042d0566f24bf0429967120d5910320b252a45d23c7209736fbe91a41f4d5b08eeff7b450f60cdd4837d6bf3818157a7c0b3
7
+ data.tar.gz: c96520df9442e1d9e4aac52c466bdcaa49f55c6e0acc19024bba44d4995c45f84fd88bbdf3fb4a7fe0f7e4763b2a6c8fd701ab354c452ebfd2675957787a2ef4
@@ -49,6 +49,16 @@ class Hash
49
49
  self.merge!(other_hash) {|_,v, _| v}
50
50
  end unless method_defined? :reverse_merge!
51
51
 
52
+ # Apply other hash values if current value is blank
53
+ def apply_defaults(other_hash)
54
+ self.merge(other_hash) {|_,v, w| v.blank? ? w : v}
55
+ end unless method_defined? :apply_defaults
56
+
57
+ # Apply in-place other hash values if current value is blank
58
+ def apply_defaults!(other_hash)
59
+ self.merge!(other_hash) {|_,v, w| v.blank? ? w : v}
60
+ end unless method_defined? :apply_defaults!
61
+
52
62
  # Convert all keys to symbols. In-place operation.
53
63
  # @param (see #key_strings_to_symbols)
54
64
  def key_strings_to_symbols!(options = {})
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Tools
3
- VERSION = '0.9.51'
3
+ VERSION = '0.9.52'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.51
4
+ version: 0.9.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser