wallaby-core 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utils/wallaby/utils.rb +4 -2
- data/lib/wallaby/core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0d88e52f518d36150436506a1aabb09b893bd9cfd8d63714d43885a3996d6c1
|
4
|
+
data.tar.gz: bf0b36a51ff84c21af190e403ef4cd97f7ebe3081859a92dbde1ed2dc078791d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6beae8bb92548901e4ef9cffd91d29c71b5357ec7b6b092439c09ca561fc67b35d950c5f3d439971dd17b8fcacbd77b6bfe6b79b533c720b3e70b5a49628a73c
|
7
|
+
data.tar.gz: 4fb24f6c6dc2a1a6efe58607e8da3fb4fcb96bc7fe359130fbf952e695c38cbd7bb7a668f1b3ed3a5b4ce235449263557b76d1739cfd67809c0f37dda266789d
|
data/lib/utils/wallaby/utils.rb
CHANGED
@@ -7,11 +7,13 @@ module Wallaby
|
|
7
7
|
# @param object [Object]
|
8
8
|
# @return [Object] a clone object
|
9
9
|
def self.clone(object)
|
10
|
-
# NOTE: Neither marshal/deep_dup/dup
|
10
|
+
# NOTE: Neither marshal/deep_dup/dup are able to achieve real and correct deep copy,
|
11
11
|
# so here we need a custom solution below:
|
12
12
|
case object
|
13
13
|
when Hash
|
14
|
-
object.each_with_object(
|
14
|
+
object.each_with_object(
|
15
|
+
object.class.new(object.default)
|
16
|
+
) { |(key, value), hash| hash[key] = clone(value) }
|
15
17
|
when Array
|
16
18
|
object.each_with_object(object.class.new) { |value, array| array << clone(value) }
|
17
19
|
when Class
|
data/lib/wallaby/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wallaby-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tian Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
241
|
- !ruby/object:Gem::Version
|
242
242
|
version: '0'
|
243
243
|
requirements: []
|
244
|
-
rubygems_version: 3.
|
244
|
+
rubygems_version: 3.0.3
|
245
245
|
signing_key:
|
246
246
|
specification_version: 4
|
247
247
|
summary: The core of Wallaby
|