nub 0.0.65 → 0.0.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nub/hash.rb +38 -0
  3. data/lib/nub.rb +1 -0
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8a6bc1396062829fa734eaf735c935e6a7cda5cecf90c72dbdc5d65f482110f
4
- data.tar.gz: 27ef79fa291579d0e27472e3bf093255af62d5d5aa1be8b54fb08700fe32201e
3
+ metadata.gz: 3df7ecdb78ebe134cdc50b183cd9c70ffd0ac21e9ebfed9a6b0b315a93ce2089
4
+ data.tar.gz: 5066c0edf1c3bae95d7d38c07ba215de19123bce35b0b833e1202953e4afbe1b
5
5
  SHA512:
6
- metadata.gz: 9d0f14440f01add99f363f1d5b5dc0ad334fda3be284e74229bdd54a150f9e5e49dc58a4aa411a61aa92ab598c19fa60bb21344610599586cc9804ae762f6187
7
- data.tar.gz: fcdf68fe617a5a5cddee5d1687083fdef0795885d35dc48490134ed53e82e3828ef90180c5aee4eac3d9ae09bb8052ea21d3fa769bcd180561eddf0f6e0402b2
6
+ metadata.gz: 37715e0e876c66e1cb081f05a111dbb814e00571017fa970664703c38a2e734a4fadf7a1f87bc27b3c7aa5f9522f12085121b6e5abd292770c71df1d0ccc8c53
7
+ data.tar.gz: f4376f093fc3d1b7ab3e9b35119346a859331e40a66567ac0f32aa72048bcfb91cc7178c47decd338314ac6025b8ce965658aab92929222e4d287a1c54268f98
data/lib/nub/hash.rb ADDED
@@ -0,0 +1,38 @@
1
+ #MIT License
2
+ #Copyright (c) 2018 phR0ze
3
+ #
4
+ #Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ #of this software and associated documentation files (the "Software"), to deal
6
+ #in the Software without restriction, including without limitation the rights
7
+ #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ #copies of the Software, and to permit persons to whom the Software is
9
+ #furnished to do so, subject to the following conditions:
10
+ #
11
+ #The above copyright notice and this permission notice shall be included in all
12
+ #copies or substantial portions of the Software.
13
+ #
14
+ #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ #SOFTWARE.
21
+
22
+ # Monkey patch string with some useful methods
23
+ class Hash
24
+
25
+ # Deep merge hash with other
26
+ # @param other [Hash] other hash to merge with
27
+ def deep_merge(other)
28
+ merge(other){|k, av, bv|
29
+ if av.is_a?(Hash) && bv.is_a?(Hash)
30
+ av.deep_merge(bv)
31
+ else
32
+ bv
33
+ end
34
+ }
35
+ end
36
+ end
37
+
38
+ # vim: ft=ruby:ts=2:sw=2:sts=2
data/lib/nub.rb CHANGED
@@ -25,6 +25,7 @@ module Nub
25
25
  require 'nub/commander'
26
26
  require 'nub/config'
27
27
  require 'nub/fileutils'
28
+ require 'nub/hash'
28
29
  require 'nub/log'
29
30
  require 'nub/module'
30
31
  require 'nub/net'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.65
4
+ version: 0.0.67
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Crummett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2018-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -92,6 +92,7 @@ files:
92
92
  - lib/nub/commander.rb
93
93
  - lib/nub/config.rb
94
94
  - lib/nub/fileutils.rb
95
+ - lib/nub/hash.rb
95
96
  - lib/nub/log.rb
96
97
  - lib/nub/module.rb
97
98
  - lib/nub/net.rb