foobara 0.0.137 → 0.0.139

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: d8006a38d251e55d5412171c8b420ef424bc93bf6ec6a9bc40b4dac34c6d71fe
4
+ data.tar.gz: ed9d0a5a764be0a8c51f4a88f311207c18be2186721c0bea5476e3f87b51fd21
5
5
  SHA512:
6
- metadata.gz: ab129e2a8bcaca2e72aa7c1208197586af9563c4540c3ba6b7925e0ae1fafb20a31fa9ea523b4906215b779aab265736b46f3c13ced24a74a63ff6466502ed0e
7
- data.tar.gz: e2fcb02c9a104085488983a3e4755557696b83a5bd6353ffd35b562132e93a3f58871a175c2e8d126ba119ded2bc5eb36a4a0098fffc979632fc7bef84c08290
6
+ metadata.gz: 79d0287f4d63260543b050bf6122ed66f339b981726aae6917731e19467364c3e4a2542546d574e591cac6e464a14379dbaa729dababf0bb9a67eac1488a51be
7
+ data.tar.gz: 2deb90d284941caddbdab98a9adf48273d84d9d56ac791ef98907ab8ddaaa6072712f66425387e66e09d4a1ad330179a57ebaa0ac5c73a263af2cbb48d4b0385
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [0.0.139] - 2025-07-23
2
+
3
+ - Add back an ErrorCollection method that some external projects depend on
4
+ - Allow reset_all to be called when it's part of install!'s implementation
5
+
6
+ # [0.0.138] - 2025-07-23
7
+
8
+ - Allow #foobara_unregister by symbol, string, or array path
9
+
1
10
  # [0.0.137] - 2025-07-22
2
11
 
3
12
  - Fix bug where update_children_with_new_parent processes a scoped with itself
@@ -25,6 +25,13 @@ module Foobara
25
25
  # :nocov:
26
26
  end
27
27
 
28
+ def error_array
29
+ # :nocov:
30
+ warn "DEPRECATED: Do not call ErrorCollection#errors instead just use the collection directly."
31
+ self
32
+ # :nocov:
33
+ end
34
+
28
35
  def each_error(&)
29
36
  # :nocov:
30
37
  warn "DEPRECATED: This method will be deprecated in the coming version"
@@ -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
@@ -1,8 +1,11 @@
1
1
  module Foobara
2
2
  module TypeDeclarations
3
3
  class << self
4
- def reset_all
5
- Foobara.raise_if_production!("reset_all")
4
+ def reset_all(skip_check: nil)
5
+ unless skip_check
6
+ Foobara.raise_if_production!("reset_all")
7
+ end
8
+
6
9
  # TODO: this doesn't really belong here. I think we need to maybe call reset in reverse order?
7
10
  Foobara::Domain::DomainModuleExtension.all.each do |domain|
8
11
  var = "@foobara_type_builder"
@@ -82,7 +85,7 @@ module Foobara
82
85
  def install!
83
86
  capture_current_namespaces
84
87
 
85
- reset_all
88
+ reset_all(skip_check: true)
86
89
 
87
90
  Foobara::Error.include(ErrorExtension)
88
91
 
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.139
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