foobara 0.5.8 → 0.5.9

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: 7f3a7dee25a0ab1d7598ec72bbd71ec8807113d417cc758842cf4edd7b214d2a
4
- data.tar.gz: f81bd84c70a9d41a8db414ee9424d5c2e2d9533887cfaa1ea0b436094873bc9a
3
+ metadata.gz: c97d7f81b121b86084fb6305b3327cdb82500828a1e4f87fc308c11390c46045
4
+ data.tar.gz: 7a48863a2c118156769df85217057309a680207af1af989d2465676c6cf012bc
5
5
  SHA512:
6
- metadata.gz: 8819827dfdffb0ae2bef29f3bbbeb944cd3270cfd1a7938037d487373123ce50e2a8f832c5687c6b75ef8fd6e2ebd2016689e4b7208752a1f4a15bafa6eac10d
7
- data.tar.gz: ba81595289f961c7c5f639d85fb16f7d05fe5b3d0aa3fcbeec1499030b7e56bbab75afc1cef58b6eafd5e6f115c3f2c4dbfb15ab29de8bc081095ccb4a8bd089
6
+ metadata.gz: 25ea5d0c8f87d7f77c0d6f8feecf93aac2940161eceebd3b8935013b7e06b617e12d8e003826f439f5685027b96121e795765a9b4376e2f08038f682f7860601
7
+ data.tar.gz: 8b7796124e4e7d553f895c46913a693aa3f42666712a8100404bf68bcdaf80f25ec201177894c72efc6d7b53aac1565be8fe4c795f3a762ab4127d0da9b344fa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.5.9] - 2026-03-06
2
+
3
+ - Do not require an allowed rule for builtin-in commands when using requires_allowed_rule: true
4
+
1
5
  # [0.5.8] - 2026-03-04
2
6
 
3
7
  - Provide a way for allowed rules to be declared independently of connecting commands
@@ -413,8 +413,6 @@ module Foobara
413
413
  raise NoCommandFoundError.new(message: "Could not find command registered for #{full_command_name}")
414
414
  # :nocov:
415
415
  end
416
-
417
- transformed_command_class
418
416
  else
419
417
  action = case action
420
418
  when "describe_type", "manifest", "describe_command"
@@ -433,8 +431,15 @@ module Foobara
433
431
  command_class = find_builtin_command_class(command_name)
434
432
  full_command_name = command_class.full_command_name
435
433
 
436
- transformed_command_from_name(full_command_name) || transform_command_class(command_class)
434
+ transformed_command_class = transformed_command_from_name(full_command_name) ||
435
+ transform_command_class(command_class)
436
+
437
+ if transformed_command_class < TransformedCommand
438
+ transformed_command_class.builtin = true
439
+ end
437
440
  end
441
+
442
+ transformed_command_class
438
443
  end
439
444
 
440
445
  def request_to_command_inputs(request)
@@ -640,8 +645,14 @@ module Foobara
640
645
 
641
646
  def run_command(request)
642
647
  command = request.command
648
+ command_class = request.command_class
643
649
 
644
- if requires_allowed_rule && command.is_a?(TransformedCommand) && command.class.requires_authentication != false
650
+ if requires_allowed_rule &&
651
+ command.is_a?(TransformedCommand) &&
652
+ # The != false looks odd and must be that we want to distinguish between the default (nil)
653
+ # and explicitly not requiring auth
654
+ command.class.requires_authentication != false &&
655
+ !command_class.builtin?
645
656
  unless command.allowed_rule
646
657
  raise NoAllowedRuleGivenError,
647
658
  "Must connect #{command.full_command_name} with an `allowed_if:` " \
@@ -21,7 +21,8 @@ module Foobara
21
21
  :requires_authentication,
22
22
  :authenticator,
23
23
  :subclassed_in_namespace,
24
- :suffix
24
+ :suffix,
25
+ :builtin
25
26
 
26
27
  def subclass(
27
28
  command_class,
@@ -546,6 +547,10 @@ module Foobara
546
547
  end
547
548
  end
548
549
 
550
+ def builtin?
551
+ builtin
552
+ end
553
+
549
554
  private
550
555
 
551
556
  def processors_to_manifest_symbols(processors)
@@ -12,7 +12,7 @@ module Foobara
12
12
  map = map.merge(possible_error.key.to_s => possible_error)
13
13
  end
14
14
 
15
- if transformed_command.allowed_rule
15
+ if transformed_command.allowed_rule && transformed_command.allowed_rule.symbol != :always
16
16
  possible_error = PossibleError.new(CommandConnector::NotAllowedError)
17
17
  map = map.merge(possible_error.key.to_s => possible_error)
18
18
  end
data/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Foobara
2
2
  module Version
3
- VERSION = "0.5.8".freeze
3
+ VERSION = "0.5.9".freeze
4
4
  MINIMUM_RUBY_VERSION = ">= 3.4.0".freeze
5
5
  end
6
6
  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.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi