hey-you 1.4.1 → 1.4.2

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: 8ff8d80c94827be9c828c5be13e40a7a00168af78da71b0d9f45f661ea7e9077
4
- data.tar.gz: 2722f48830d9c5dcba439630b7bd3a94925a8f45308d90754407bb0a5cb603f2
3
+ metadata.gz: 3679941e8f2ff22ed129c4fdbb90c8d8c27f860e2aa1f8514855afec34c86852
4
+ data.tar.gz: 6a1b5bb70850f69a7a017ac5c29125138ba22ec722d192666360daf9bbb2b1ad
5
5
  SHA512:
6
- metadata.gz: 1e28d3c2be0df2136d905cb0bf1cfafaa080032cc01a7f0653e87d4eaa42691f10ff9d83daf7bc6dcc959f5a7a39350619d90ed533913fe513938c3caba1512e
7
- data.tar.gz: 33b895c3264b71c87a2c5647f265be8ce34f46f6ecf0ab2e718eb8635c5b5d25591d90fc32ae12b2924f74d664fc7ddb30fcc363c60f61efcc14e03610a60e2e
6
+ metadata.gz: a6a8430acbcc2c0399c87b899cd61e42915c2d7a5b9d06fac81df719b55bfa59716245ce6c50d12056d4707ceb6c4881017d06d1f444e728df2be6e71b504d02
7
+ data.tar.gz: 52412155756eaed0bd09aed322cbf34ce933d9a99965327264096834bcf1f70b7c6e5eb2d2d7f36cc8653d7183b0c7d893e94866cd5a2481ba3e0d1696e043a1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog for hey-you gem
2
2
 
3
- # 1.4.0
3
+ ## 1.4.2
4
+ - Improvement: Freeze loaded collection to prevent changes notification templates in memory
5
+
6
+ ## 1.4.1
7
+ - Improvement: custom complex classes in Sender
8
+
9
+ ## 1.4.0
4
10
  - Improvement: configs validations for custom classes
5
11
  - Improvement: allow custom classes with '_' in name
6
12
 
@@ -50,11 +50,11 @@ module HeyYou
50
50
  end
51
51
 
52
52
  def collection
53
- @collection ||= load_collection
53
+ @collection ||= deep_freeze(load_collection)
54
54
  end
55
55
 
56
56
  def env_collection
57
- @env_collection ||= load_env_collection
57
+ @env_collection ||= deep_freeze(load_env_collection)
58
58
  end
59
59
 
60
60
  def registrate_receiver(receiver_class)
@@ -109,5 +109,13 @@ module HeyYou
109
109
  def load_collection
110
110
  data_source.load_data
111
111
  end
112
+
113
+ def deep_freeze(val)
114
+ if val.respond_to? :each
115
+ val.class == Hash ? val.each { |_, val| deep_freeze(val) } : val.each { |val| deep_freeze(val) }
116
+ end
117
+
118
+ val.freeze unless val.frozen?
119
+ end
112
120
  end
113
121
  end
@@ -1,3 +1,3 @@
1
1
  module HeyYou
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hey-you
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Nesterov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2021-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fcm