dry-system 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6e2bd6b5eeb03f260f1bf95def5a6dd7b1a419aa2e57301805fc37f43ffa08c
4
- data.tar.gz: 18d1e11ad33a6e725b3eb049662957652120edcc2ce5da31847d13f511df65d8
3
+ metadata.gz: 50e5806c40214b3e9ff685ad2e03db08f0bd48f6e387c498416afb1f5df6a75f
4
+ data.tar.gz: 4fed59b7b9fce5e7ddc7d7bd3f67cf630bc2dbbc2a7cb08270b4ccd8f36d4b70
5
5
  SHA512:
6
- metadata.gz: b80e0a016030c542c963155140f30d15eb62c463c29ed1ba94d79378371fd11d2f2a7c4ea13cd0c11bbea3210cda2262cacde67ce9f8c50412e25a98c292a3a7
7
- data.tar.gz: 35473d55c1434e8427c1d297868d65d2a31c2ebf559c50618712e97293f0d1c8ecd726945a94e4bde6bcbcfd7ef50837590f5e36c4a3a8396d52bce99a988e80
6
+ metadata.gz: 3d1509f09e2ebb38eef08f07ab159520ef09193aaebee42c7ffa1aeeadeca19d0ff88b1709f6fddf1a5ebe3d5d5a554ef2388fd94416c951b2359cc533de3155
7
+ data.tar.gz: dce6d5a5bde02a78602ce14abc4f8ebc6a1194dc250162a49aa49cceb01e610aa96a470bc2b7cebd8b16a7da3a7a88c24c4c2174ab0fcfdf92042c269402273f
data/CHANGELOG.md CHANGED
@@ -1,13 +1,31 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 1.2.4 2025-08-14
4
+
5
+
6
+ ### Fixed
7
+
8
+ - Allow imported components to be lazy loaded when both strings and symbols are given as the
9
+ namespace to `Container.import` (@timriley in #287)
10
+
11
+
12
+ [Compare v1.2.3...v1.2.4](https://github.com/dry-rb/dry-system/compare/v1.2.3...v1.2.4)
13
+
3
14
  ## 1.2.3 2025-07-29
4
15
 
5
16
 
17
+ ### Added
18
+
19
+ - Add :register after-hook to detect container key registration dynamically. (via #274, @alassek)
20
+
6
21
  ### Fixed
7
22
 
8
23
  - Re-register components from manifest registrars in apps that reload the container (e.g. when
9
24
  using dry-rails and Rails development mode) (via #286, @alassek)
10
25
 
26
+ ### Changed
27
+
28
+ - :finalize after-hook now executes before container freeze to allow mutation. (via #274, @alassek)
11
29
 
12
30
  [Compare v1.2.2...v1.2.3](https://github.com/dry-rb/dry-system/compare/v1.2.2...v1.2.3)
13
31
 
@@ -36,7 +36,7 @@ module Dry
36
36
 
37
37
  # @api private
38
38
  def register(namespace:, container:, keys: nil)
39
- registry[namespace] = Item.new(
39
+ registry[namespace_key(namespace)] = Item.new(
40
40
  namespace: namespace,
41
41
  container: container,
42
42
  import_keys: keys
@@ -45,12 +45,12 @@ module Dry
45
45
 
46
46
  # @api private
47
47
  def [](name)
48
- registry.fetch(name)
48
+ registry.fetch(namespace_key(name))
49
49
  end
50
50
 
51
51
  # @api private
52
52
  def key?(name)
53
- registry.key?(name)
53
+ registry.key?(namespace_key(name))
54
54
  end
55
55
  alias_method :namespace?, :key?
56
56
 
@@ -76,6 +76,17 @@ module Dry
76
76
 
77
77
  private
78
78
 
79
+ # Returns nil if given a nil (i.e. root) namespace. Otherwise, converts the namespace to a
80
+ # string.
81
+ #
82
+ # This ensures imported components are found when either symbols or strings to given as the
83
+ # namespace in {Container.import}.
84
+ def namespace_key(namespace)
85
+ return nil if namespace.nil?
86
+
87
+ namespace.to_s
88
+ end
89
+
79
90
  def keys_to_import(keys, item)
80
91
  keys
81
92
  .then { (arr = item.import_keys) ? _1 & arr : _1 }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module System
5
- VERSION = "1.2.3"
5
+ VERSION = "1.2.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-system
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-29 00:00:00.000000000 Z
11
+ date: 2025-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-auto_inject