foobara 0.0.27 → 0.0.28

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: 463e274d4eb6227cdf473fc12bab4a7519db226c07f458c7bd04e8a9f84f1440
4
- data.tar.gz: bfaaf65911fb2c87363ea619f58ea042b1236653797d11ab9c59793f83b26d34
3
+ metadata.gz: 8bfc7b95d3e92c97900136f5ddf441f5229f71d1884bc37a8439dc5e4e3e727a
4
+ data.tar.gz: fe04bd8fbc04cc7c8ec86aea2c4ce0390de2da79073d3f1236eaca00d63e6bb9
5
5
  SHA512:
6
- metadata.gz: 34f1340468762419907715d77f6f98e13ee551b645bc94c258984458dd2120ed5e607f8ea6148f5fdda3f53ceae1ad981bf82a522060bae948869119b309fa45
7
- data.tar.gz: 945c3807af1fdf55aab4e87bc635abfc8ee1bec12ff5458ee5c4336a71174f5671f768e87daa72bfc97178ad10a9ebefc3b93757a9afd8d276ee50f5bc2202b8
6
+ metadata.gz: 04ce017d39e5fa817da0f37402eee57a1c7cfc858ac9c88c9cda3bbf8d8515a489d7f3771d3df0ed038aa88bdfed34f3bb34ef7cb0fb56e28940fa7a7d130967
7
+ data.tar.gz: 5dc2e9c070253ead42dcdda5dd95100ac21a0ecd069c2b4bf8705f00b754275bb2aa87cece6473e453b4be25c918683b0e7115d9d605d33f05ad45f85bf7f5fa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.28] - 2024-12-05
2
+
3
+ - Make Domain#foobara_depends_on? give a more intuitive answer
4
+
1
5
  ## [0.0.27] - 2024-12-04
2
6
 
3
7
  - Add some Error DSL convenience methods (symbol/message/context)
@@ -20,7 +20,7 @@ module Foobara
20
20
  domain = self.class.domain
21
21
  sub_domain = subcommand_class.domain
22
22
 
23
- unless domain.foobara_depends_on?(sub_domain)
23
+ unless domain.foobara_can_call_subcommands_from?(sub_domain)
24
24
  raise CannotAccessDomain,
25
25
  "Cannot access #{sub_domain} or its commands because #{domain} does not depend on it"
26
26
  end
@@ -353,16 +353,14 @@ module Foobara
353
353
  nil
354
354
  end
355
355
 
356
- def foobara_depends_on?(other_domain)
356
+ def foobara_can_call_subcommands_from?(other_domain)
357
357
  other_domain = Domain.to_domain(other_domain)
358
+ other_domain == self || self == GlobalDomain || foobara_depends_on?(other_domain)
359
+ end
358
360
 
359
- # TODO: Feels awkward to have to check if we're the global domain or not here.
360
- # Also awkward to check if the other domain is global.
361
- # Unclear what the solution is. To fix other domain check could just automatically call
362
- # depends_on with the global domain in .foobara_domain! but not as clear how to fix the check
363
- # against self.
364
- self == GlobalDomain || other_domain == self || other_domain == GlobalDomain ||
365
- foobara_depends_on.include?(other_domain.foobara_full_domain_name)
361
+ def foobara_depends_on?(other_domain)
362
+ other_domain = Domain.to_domain(other_domain)
363
+ other_domain == GlobalDomain || foobara_depends_on.include?(other_domain.foobara_full_domain_name)
366
364
  end
367
365
 
368
366
  def foobara_depends_on(*domains)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-04 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foobara-util