foobara 0.0.76 → 0.0.78

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: 28b5b9f5d6b3a5653bc38a0dfb4dbf35510e692af15b290a7a5e4451e106e502
4
- data.tar.gz: 6ee408c54dddef46a85c6d0231540b3db7a72949b078bc20fab9586a60f30cb6
3
+ metadata.gz: 3c5ce6bf1f2bf6f67db74bbc811f5fe37218215b00876564b97e315ec3016c6d
4
+ data.tar.gz: a17df1d60eb6b77e162a799250df7d13c44bde9c4a387ed96d3c7c05f3819d26
5
5
  SHA512:
6
- metadata.gz: 22fb23408e9736ef8f9bef4f7331240e29be7eb23997af9b29ef7ebcc450eddce596a35310ac8e2fc1cd69004114eafb6e8abc756c125a0877b48023e4091e96
7
- data.tar.gz: 799835d961d601450e42fdbe727d8b2c02bd12001fcb4aec7a356d95f9a511e2bcedeab4748db85c85e5b549c9aa1c374485cabee29108dab9e1b469e57b29d6
6
+ metadata.gz: 4e1d33d80f67cfc49407079dfafe3c8fe7e0da904f4ece41021ce6a8df412c754ce2dfe09cc3a60fbee74c2d2784b65b05e5839370deb06afd632f23c9e479f1
7
+ data.tar.gz: 408920762e79e50dd77c568f75345f6a3b952f4b10a5d2c412e3efb1fa6244874921e98c0b942d0c599f560f4769684e3261dd487e07f5a3494352c8b8525f6b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [0.0.78] - 2025-03-17
2
+
3
+ - Include types that possible errors depend on in TransformedCommand#types_depdended_on
4
+
5
+ # [0.0.77] - 2025-03-17
6
+
7
+ - Patch up command connector manifest errors to have their domain be their parent if they're scoped
8
+ to a command that wasn't connected
9
+
1
10
  # [0.0.76] - 2025-03-17
2
11
 
3
12
  - Add ErrorCollection#clear
@@ -153,6 +153,11 @@ module Foobara
153
153
  end
154
154
  end
155
155
 
156
+ possible_errors.each do |possible_error|
157
+ error_class = possible_error.error_class
158
+ types |= error_class.types_depended_on
159
+ end
160
+
156
161
  types
157
162
  end
158
163
 
@@ -425,7 +425,9 @@ module Foobara
425
425
  end
426
426
  end
427
427
 
428
- normalize_manifest(h)
428
+ h = normalize_manifest(h)
429
+
430
+ patch_up_broken_parents_for_errors_with_missing_command_parents(h)
429
431
  end
430
432
 
431
433
  def normalize_manifest(manifest_hash)
@@ -434,6 +436,38 @@ module Foobara
434
436
  end.sort.to_h
435
437
  end
436
438
 
439
+ def patch_up_broken_parents_for_errors_with_missing_command_parents(manifest_hash)
440
+ root_manifest = Manifest::RootManifest.new(manifest_hash)
441
+
442
+ error_category = {}
443
+
444
+ root_manifest.errors.each do |error|
445
+ error_manifest = if error.parent_category == :command &&
446
+ !root_manifest.contains?(error.parent_name, error.parent_category)
447
+ domain = error.domain
448
+ index = domain.scoped_full_path.size
449
+
450
+ fixed_scoped_path = error.scoped_full_path[index..]
451
+ fixed_scoped_name = fixed_scoped_path.join("::")
452
+ fixed_scoped_prefix = fixed_scoped_path[..-2]
453
+ fixed_parent = [:domain, domain.full_domain_name]
454
+
455
+ error.relevant_manifest.merge(
456
+ parent: fixed_parent,
457
+ scoped_path: fixed_scoped_path,
458
+ scoped_name: fixed_scoped_name,
459
+ scoped_prefix: fixed_scoped_prefix
460
+ )
461
+ else
462
+ error.relevant_manifest
463
+ end
464
+
465
+ error_category[error.scoped_full_name.to_sym] = error_manifest
466
+ end
467
+
468
+ manifest_hash.merge(error: error_category)
469
+ end
470
+
437
471
  def all_exposed_commands
438
472
  process_delayed_connections
439
473
 
@@ -15,6 +15,10 @@ module Foobara
15
15
  scoped_name
16
16
  end
17
17
 
18
+ def short_error_name
19
+ scoped_short_name
20
+ end
21
+
18
22
  def full_error_name
19
23
  scoped_full_name
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.76
4
+ version: 0.0.78
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi