deepsort 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/deepmerge.rb +19 -0
  3. metadata +4 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23e571235ea1a193b9b9422c54737953c98ad6532e8bc4746809b7d6218e983e
4
- data.tar.gz: 7d588e0eb3e3349c625265c6bd7ed4b9395e04f8a75962b7d82268b8f8750676
3
+ metadata.gz: d3633b2fe06354fbeca49e84aa30c5bd8f4eb0241f66312ffd69c3557d68eff0
4
+ data.tar.gz: acce48e1c11283f03aa48f6df3db56453c92179498c2177e5b474252e51f74b3
5
5
  SHA512:
6
- metadata.gz: 59da11e2131a53305385cf64be3a269e5efeded5e3adc8af26540248ee121b491843d21c7ff295c705ecf8b4d2501469f775d0f1630507f666f53665a4e98216
7
- data.tar.gz: cdb1d3aefd23c09655b6082fa43ee1d0f9a6c082f2bfb1e7001fa019e9633373f634408ec3f6b216c47964bd905c41e25a45b55bfb75fbfeb0833933f86c4c57
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.4
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: 2020-03-02 00:00:00.000000000 Z
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.2.0
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
- rubyforge_project:
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.