isomorfeus-transport 23.6.0.rc3 → 23.6.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fb29b2a57a30431960848b37227abb8f031836908dfd2f2e90039a7aff8be22
4
- data.tar.gz: a8911affe98af8b1546df6a25dd1156845485bd1236c2682af04fa1b2d98acb0
3
+ metadata.gz: 9d5a337a47da0a199bc987865edf18f97858288f7dfe7901b6bad0dbc40d3f1e
4
+ data.tar.gz: c564283dff2e184318a3617c290cb15675a42d56689069b01555667a62b1ce6a
5
5
  SHA512:
6
- metadata.gz: 5f85cdf6a4c04573c0b4e1aca212379f83d7ac035a94d2ebfedce483c207c73e6a6a860e2410ec73d80e4172f6f31cbadb9845c72eb2de8dfbd222c9bd8f2f22
7
- data.tar.gz: 72cc495665d26d6c07591ba79113e7a388f66ff8852e8e85b56069f7e40b62c89598a437334d4508cbbb85e5a9530a867c9657c827301cf6e7667a4c47583ad6
6
+ metadata.gz: 1ca77316e1285cfe7c9fbc409ca31e0fd0879610398e9ce3e37594c63ea02df2e9835eb78945f2a18538d7cbc574e5b7d113ca25894d99e1103356b340410d4d
7
+ data.tar.gz: 903c65c56b7f4d621ed12edbc35094333a0cbdcf12d3843cf388e1802065534837331ad52aa03c60ff19295bfbb19620159e19a043c02bf53a5dcc67ad063be0
@@ -1,77 +1,77 @@
1
- class Hash
2
- def deep_freeze
3
- each_value do |value|
4
- value.deep_freeze if value.is_a?(Hash)
5
- end
6
- self
7
- end
8
-
9
- if RUBY_ENGINE == 'opal'
10
- def self.recursive_new(obj)
11
- %x{
12
- var key, val;
13
- for (var key in obj) {
14
- val = obj[key];
15
- if (val !== null && typeof val === "object" && !val.$$is_array && !val.$$is_hash && !Array.isArray(val)) {
16
- obj[key] = #{Hash.recursive_new(`val`)};
17
- }
18
- }
19
- return Opal.hash(obj);
20
- }
21
- end
22
- end
23
-
24
- # originally taken from: https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/object/deep_dup.rb
25
- # Returns a deep copy of hash.
26
- #
27
- # hash = { a: { b: 'b' } }
28
- # dup = hash.deep_dup
29
- # dup[:a][:c] = 'c'
30
- #
31
- # hash[:a][:c] # => nil
32
- # dup[:a][:c] # => "c"
33
- def deep_dup
34
- hash = dup
35
- each_pair do |key, value|
36
- if ::String === key || ::Symbol === key
37
- hash[key] = value.deep_dup
38
- else
39
- hash.delete(key)
40
- hash[key.deep_dup] = value.deep_dup
41
- end
42
- end
43
- hash
44
- end
45
-
46
- # originally taken from: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/deep_merge.rb
47
- # Returns a new hash with +self+ and +other_hash+ merged recursively.
48
- #
49
- # h1 = { a: true, b: { c: [1, 2, 3] } }
50
- # h2 = { a: false, b: { x: [3, 4, 5] } }
51
- #
52
- # h1.deep_merge(h2) # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }
53
- #
54
- # Like with Hash#merge in the standard library, a block can be provided
55
- # to merge values:
56
- #
57
- # h1 = { a: 100, b: 200, c: { c1: 100 } }
58
- # h2 = { b: 250, c: { c1: 200 } }
59
- # h1.deep_merge(h2) { |key, this_val, other_val| this_val + other_val }
60
- # # => { a: 100, b: 450, c: { c1: 300 } }
61
- def deep_merge(other_hash, &block)
62
- dup.deep_merge!(other_hash, &block)
63
- end
64
-
65
- # Same as +deep_merge+, but modifies +self+.
66
- def deep_merge!(other_hash, &block)
67
- merge!(other_hash) do |key, this_val, other_val|
68
- if this_val.is_a?(Hash) && other_val.is_a?(Hash)
69
- this_val.deep_merge(other_val, &block)
70
- elsif block_given?
71
- block.call(key, this_val, other_val)
72
- else
73
- other_val
74
- end
75
- end
76
- end
77
- end
1
+ class Hash
2
+ def deep_freeze
3
+ each_value do |value|
4
+ value.deep_freeze if value.is_a?(Hash)
5
+ end
6
+ self
7
+ end
8
+
9
+ if RUBY_ENGINE == 'opal'
10
+ def self.recursive_new(obj)
11
+ %x{
12
+ var key, val;
13
+ for (var key in obj) {
14
+ val = obj[key];
15
+ if (val !== null && typeof val === "object" && !val.$$is_array && !val.$$is_hash && !Array.isArray(val)) {
16
+ obj[key] = #{Hash.recursive_new(`val`)};
17
+ }
18
+ }
19
+ return Opal.hash(obj);
20
+ }
21
+ end
22
+ end
23
+
24
+ # originally taken from: https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/object/deep_dup.rb
25
+ # Returns a deep copy of hash.
26
+ #
27
+ # hash = { a: { b: 'b' } }
28
+ # dup = hash.deep_dup
29
+ # dup[:a][:c] = 'c'
30
+ #
31
+ # hash[:a][:c] # => nil
32
+ # dup[:a][:c] # => "c"
33
+ def deep_dup
34
+ hash = dup
35
+ each_pair do |key, value|
36
+ if ::String === key || ::Symbol === key
37
+ hash[key] = value.deep_dup
38
+ else
39
+ hash.delete(key)
40
+ hash[key.deep_dup] = value.deep_dup
41
+ end
42
+ end
43
+ hash
44
+ end
45
+
46
+ # originally taken from: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/deep_merge.rb
47
+ # Returns a new hash with +self+ and +other_hash+ merged recursively.
48
+ #
49
+ # h1 = { a: true, b: { c: [1, 2, 3] } }
50
+ # h2 = { a: false, b: { x: [3, 4, 5] } }
51
+ #
52
+ # h1.deep_merge(h2) # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }
53
+ #
54
+ # Like with Hash#merge in the standard library, a block can be provided
55
+ # to merge values:
56
+ #
57
+ # h1 = { a: 100, b: 200, c: { c1: 100 } }
58
+ # h2 = { b: 250, c: { c1: 200 } }
59
+ # h1.deep_merge(h2) { |key, this_val, other_val| this_val + other_val }
60
+ # # => { a: 100, b: 450, c: { c1: 300 } }
61
+ def deep_merge(other_hash, &block)
62
+ dup.deep_merge!(other_hash, &block)
63
+ end
64
+
65
+ # Same as +deep_merge+, but modifies +self+.
66
+ def deep_merge!(other_hash, &block)
67
+ merge!(other_hash) do |key, this_val, other_val|
68
+ if this_val.is_a?(Hash) && other_val.is_a?(Hash)
69
+ this_val.deep_merge(other_val, &block)
70
+ elsif block_given?
71
+ block.call(key, this_val, other_val)
72
+ else
73
+ other_val
74
+ end
75
+ end
76
+ end
77
+ end
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Transport
3
- VERSION = '23.6.0.rc3'
3
+ VERSION = '23.6.0.rc4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.6.0.rc3
4
+ version: 23.6.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-18 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -190,14 +190,14 @@ dependencies:
190
190
  requirements:
191
191
  - - '='
192
192
  - !ruby/object:Gem::Version
193
- version: 23.6.0.rc3
193
+ version: 23.6.0.rc4
194
194
  type: :development
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - '='
199
199
  - !ruby/object:Gem::Version
200
- version: 23.6.0.rc3
200
+ version: 23.6.0.rc4
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: rake
203
203
  requirement: !ruby/object:Gem::Requirement