deepsort 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deepmerge.rb +19 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3633b2fe06354fbeca49e84aa30c5bd8f4eb0241f66312ffd69c3557d68eff0
|
4
|
+
data.tar.gz: acce48e1c11283f03aa48f6df3db56453c92179498c2177e5b474252e51f74b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc5ff1c4593471d81c3b9e22e570717c9b0ff5c7606dba65c670eb4fff871e3c36203a5bd6bbddb07c4bee89588705d5f86bb654cfced5c2d9291bd67758ec5
|
7
|
+
data.tar.gz: d9247a04dddbfb09366c5cfda62db2c94f87a253aa42a16d3d0141d6cc003ebd61e6daaa5e4650b750f1cb7cbc74d63ab80fe0b9fe904ff3ac4b02a341be1fc7
|
data/lib/deepmerge.rb
CHANGED
@@ -44,3 +44,22 @@ end
|
|
44
44
|
|
45
45
|
Array.send(:include, DeepMerge::DeepMergeArray)
|
46
46
|
Hash.send(:include, DeepMerge::DeepMergeHash)
|
47
|
+
|
48
|
+
|
49
|
+
# and if you don't like calling member methods on objects, these two functions do it for you.
|
50
|
+
def deep_merge(source, other)
|
51
|
+
if source.respond_to? :deep_merge
|
52
|
+
source.deep_merge(other)
|
53
|
+
else
|
54
|
+
other
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# similar to the deep_merge method, but performs the deep merge in place
|
59
|
+
def deep_merge!(source, other)
|
60
|
+
if source.respond_to? :deep_merge
|
61
|
+
source.deep_merge!(other)
|
62
|
+
else
|
63
|
+
other
|
64
|
+
end
|
65
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deepsort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Crossen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Recursively sort nested ruby Arrays and Hashes + deepmerge
|
14
14
|
email: markcrossen@studentbody.byu.edu
|
@@ -31,15 +31,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.
|
34
|
+
version: 2.3.0
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
|
-
|
42
|
-
rubygems_version: 2.7.7
|
41
|
+
rubygems_version: 3.0.3.1
|
43
42
|
signing_key:
|
44
43
|
specification_version: 4
|
45
44
|
summary: A utility to deep sort arrays and hashes.
|