foobara 0.0.75 → 0.0.77

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: 7f84e9712a618f872f8ae8a367282d409c6712a400912be08ab6662b9c78c8f3
4
- data.tar.gz: 42fa80ddadda0b06e797a745dbcbcb4f6bd04e08ad7232c5462398396c86fc92
3
+ metadata.gz: 0d8328e6e32b886f4ab2c9f26d0f73e807f4824670901f6209ca95764d5fd1e1
4
+ data.tar.gz: b4bd0a4a496d95dfd82628141b1748a015175e9a8dcad984fdfa06aa083179ba
5
5
  SHA512:
6
- metadata.gz: 6257579e92b66549ceaeaf4fe7edd8b91f341f4fb487b5d7bfdc974ca9ebdf7e6648efa8a55fa8305ce1470874bd4c3af526f98b50791c6b718e171a1f002b33
7
- data.tar.gz: 38beb4463a136f1c47e4e57b4ad513f6867562792fb0847328ec9e694da1f75b9d2eb7286318cffa54ffb2d8a28a0067ac016c8f5924fa966aa85ad902120fd8
6
+ metadata.gz: e0f0d359032d5fea384357170e857dccab11cd3ddbf4fd371adf26e12924780eba37d7a72223da4de9ca6d3139d8a043157980d7187975ec9b6d9a0b2facd78e
7
+ data.tar.gz: 47b0a82a02bd4c802014eadfd253f02133853da8da71d005e0d704567dbfb2e497c69796deb9e1baa2baa0f1dc36e35bfeadde9d3dfa753a5a718ae2a887e09c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [0.0.77] - 2025-03-17
2
+
3
+ - Patch up command connector manifest errors to have their domain be their parent if they're scoped
4
+ to a command that wasn't connected
5
+
6
+ # [0.0.76] - 2025-03-17
7
+
8
+ - Add ErrorCollection#clear
9
+
1
10
  # [0.0.75] - 2025-03-15
2
11
 
3
12
  - Maybe a bad idea, but... add some convenience behavior to casting attributes to records:
@@ -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
 
@@ -25,7 +25,7 @@ module Foobara
25
25
  !empty?
26
26
  end
27
27
 
28
- foobara_delegate :empty?, :partition, :size, to: :error_array
28
+ foobara_delegate :empty?, :partition, :size, :clear, to: :error_array
29
29
 
30
30
  def errors
31
31
  error_array
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.75
4
+ version: 0.0.77
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-16 00:00:00.000000000 Z
10
+ date: 2025-03-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal