nxt_registry 0.3.9 → 0.3.10

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: 9d8d5b1247dfc045e077ccf9d79cf3ea010c9c56434133f8210f3b77af439d0d
4
- data.tar.gz: 9bd0fc656681a64856f6f21996914ebdeca063ea7cd5585746c29840c4f9694e
3
+ metadata.gz: 3263cdc8c48171dfc6ecfe2bbe2eedb97d72e0ab8d367945ed04ec2480b2caa0
4
+ data.tar.gz: a7f48fa6c75182d1489cdcb28f19127892bd63b3de655e3e0db40e1b81204031
5
5
  SHA512:
6
- metadata.gz: c136e4279f1fe2907e43ff24f96a28bdec6cf3b095842831c6a1834b468d174e138a370ede137cd318f879c23579c5664a93c5820e7409b6985d4829f7905f30
7
- data.tar.gz: 2793ac826854219b0e5017e84264ce3908b28c1c9148cddef1dd37dc70b761445ab07d7bd7185f5f2cd58a220cdc1bcb065f6fe49e359a1716922db85fe4532f
6
+ metadata.gz: 672c5855be89793548452a157d5c196b7a79271269ff43d056b18a2711b2c6ce7fb7cccca11892e05161fcf682eed15b55d7194bc27968d0d99b1066ae8b5ecc
7
+ data.tar.gz: ae6e5c77734afc4d9f732e7179fa62ef1f4b96c5a1278632cb91ce79ea33b803bd22b83f4084711d674698b786f6749033349ed541b152c05b43532936d53df3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.3.10 2021-03-30
2
+ - Do not synchronize resolve with mutex
3
+
1
4
  # v0.3.9 2021-03-10
2
5
 
3
6
  - Synchronize access with Mutex
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_registry (0.3.9)
4
+ nxt_registry (0.3.10)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.1.3)
10
+ activesupport (6.1.3.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
@@ -16,11 +16,11 @@ GEM
16
16
  coderay (1.1.3)
17
17
  concurrent-ruby (1.1.8)
18
18
  diff-lcs (1.4.4)
19
- i18n (1.8.9)
19
+ i18n (1.8.10)
20
20
  concurrent-ruby (~> 1.0)
21
21
  method_source (1.0.0)
22
22
  minitest (5.14.4)
23
- pry (0.14.0)
23
+ pry (0.14.1)
24
24
  coderay (~> 1.1)
25
25
  method_source (~> 1.0)
26
26
  rake (12.3.3)
@@ -205,36 +205,35 @@ module NxtRegistry
205
205
  end
206
206
 
207
207
  def __resolve(key, raise_on_key_not_registered: true)
208
- mutex.synchronize do
209
- key = transformed_key(key)
210
208
 
211
- value = if is_leaf?
212
- resolved_key = key_resolver.call(key)
209
+ key = transformed_key(key)
213
210
 
214
- if store.key?(resolved_key)
215
- store.fetch(resolved_key)
216
- elsif (pattern = matching_pattern(resolved_key))
217
- store.fetch(pattern)
218
- else
219
- if is_a_blank?(default)
220
- return unless raise_on_key_not_registered
211
+ value = if is_leaf?
212
+ resolved_key = key_resolver.call(key)
221
213
 
222
- on_key_not_registered && on_key_not_registered.call(key)
223
- else
224
- value = resolve_default(key)
225
- return value unless memoize
214
+ if store.key?(resolved_key)
215
+ store.fetch(resolved_key)
216
+ elsif (pattern = matching_pattern(resolved_key))
217
+ store.fetch(pattern)
218
+ else
219
+ if is_a_blank?(default)
220
+ return unless raise_on_key_not_registered
226
221
 
227
- store[key] ||= value
228
- end
222
+ on_key_not_registered && on_key_not_registered.call(key)
223
+ else
224
+ value = resolve_default(key)
225
+ return value unless memoize
226
+
227
+ store[key] ||= value
229
228
  end
230
- else
231
- store[key] ||= default.call
232
229
  end
230
+ else
231
+ store[key] ||= default.call
232
+ end
233
233
 
234
- value = call_or_value(value, key)
234
+ value = call_or_value(value, key)
235
235
 
236
- resolver.call(value)
237
- end
236
+ resolver.call(value)
238
237
  end
239
238
 
240
239
  def matching_key(key)
@@ -1,3 +1,3 @@
1
1
  module NxtRegistry
2
- VERSION = '0.3.9'
2
+ VERSION = '0.3.10'
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxt_registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Robecke
8
8
  - Nils Sommer
9
9
  - Raphael Kallensee
10
10
  - Lütfi Demirci
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-03-10 00:00:00.000000000 Z
14
+ date: 2021-06-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -83,7 +83,7 @@ dependencies:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
- description:
86
+ description:
87
87
  email:
88
88
  - a.robecke@hellogetsafe.com
89
89
  - andreas@robecke.de
@@ -121,7 +121,7 @@ metadata:
121
121
  allowed_push_host: https://rubygems.org
122
122
  homepage_uri: https://github.com/nxt-insurance
123
123
  source_code_uri: https://github.com/nxt-insurance/nxt_registry
124
- post_install_message:
124
+ post_install_message:
125
125
  rdoc_options: []
126
126
  require_paths:
127
127
  - lib
@@ -136,8 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.0.3
140
- signing_key:
139
+ rubygems_version: 3.2.15
140
+ signing_key:
141
141
  specification_version: 4
142
142
  summary: nxt_registry is a simple implementation of the container pattern
143
143
  test_files: []