foobara 0.0.137 → 0.0.138

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: 4c5acf1ac653d427d77720c273fa25651b6865482733f8b0a382a6cf5af9a2cd
4
- data.tar.gz: ea8cf9b48ecc319a63d2d373339b729de4ee28763a85d30a31d8e1faf50faf08
3
+ metadata.gz: 6b67d70479dbaf49e1fb2c7fc255e96fefb41b1952c245baf75c3e677a451604
4
+ data.tar.gz: 618030d55da35eb987e63473a4cf50effa7aac62fed0d617a70758099dd40f50
5
5
  SHA512:
6
- metadata.gz: ab129e2a8bcaca2e72aa7c1208197586af9563c4540c3ba6b7925e0ae1fafb20a31fa9ea523b4906215b779aab265736b46f3c13ced24a74a63ff6466502ed0e
7
- data.tar.gz: e2fcb02c9a104085488983a3e4755557696b83a5bd6353ffd35b562132e93a3f58871a175c2e8d126ba119ded2bc5eb36a4a0098fffc979632fc7bef84c08290
6
+ metadata.gz: 9645d95fdcf186a9a1575af9d7d637e0703db3fc80cab9e58a293cc97a2bb37d21f655120057dba2dc533841d5a4836cec904da8f488a22ec182266ad8cc3137
7
+ data.tar.gz: d72777452ea575fcb2420e8edc41240eed16e46b603d3896be84c0a9568774a12aba385bef69a15f552f9540e1c3e54be5f37d98e3791cb6f990f85711b71a16
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.0.138] - 2025-07-23
2
+
3
+ - Allow #foobara_unregister by symbol, string, or array path
4
+
1
5
  # [0.0.137] - 2025-07-22
2
6
 
3
7
  - Fix bug where update_children_with_new_parent processes a scoped with itself
@@ -63,6 +63,8 @@ module Foobara
63
63
  attr_writer :foobara_domain_name, :foobara_full_domain_name
64
64
 
65
65
  def foobara_unregister(scoped)
66
+ scoped = to_scoped(scoped)
67
+
66
68
  foobara_type_builder.clear_cache
67
69
 
68
70
  if scoped.is_a?(Foobara::Types::Type)
@@ -74,6 +74,20 @@ module Foobara
74
74
  foobara_parent_namespace.nil?
75
75
  end
76
76
 
77
+ def to_scoped(scopedish)
78
+ if scopedish.is_a?(::String) || scopedish.is_a?(::Symbol) || scopedish.is_a?(::Array)
79
+ scopedish = foobara_lookup(scopedish)
80
+
81
+ unless scopedish
82
+ # :nocov:
83
+ raise ArgumentError, "Cannot unregister non-existent #{scopedish}"
84
+ # :nocov:
85
+ end
86
+ end
87
+
88
+ scopedish
89
+ end
90
+
77
91
  def foobara_register(scoped)
78
92
  foobara_registry.register(scoped)
79
93
  # awkward??
@@ -89,6 +103,8 @@ module Foobara
89
103
  end
90
104
 
91
105
  def foobara_unregister(scoped)
106
+ scoped = to_scoped(scoped)
107
+
92
108
  foobara_registry.unregister(scoped)
93
109
  foobara_children.delete(scoped)
94
110
  scoped.scoped_namespace = nil
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.137
4
+ version: 0.0.138
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal
@@ -535,7 +535,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
535
535
  - !ruby/object:Gem::Version
536
536
  version: '0'
537
537
  requirements: []
538
- rubygems_version: 3.6.2
538
+ rubygems_version: 3.6.9
539
539
  specification_version: 4
540
540
  summary: A command-centric and discoverable software framework with a focus on domain
541
541
  concepts and abstracting away integration code