foobara 0.0.72 → 0.0.74

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: 4f37230e03dfeded35416a8552cb0877017b3258cf994be9b223da77a833fc5a
4
- data.tar.gz: 8eeb368cb063d05208513067d39e353e43074abe54d40767867b593cbd9157b7
3
+ metadata.gz: 354b23b90ef7ec29ac1126a3ee0ddda231253be5e33731041f80d77414c64e66
4
+ data.tar.gz: 2270ba278df777156963416623bb69418b596490cdbda7d40a2464322c17afd0
5
5
  SHA512:
6
- metadata.gz: e6732b1d9abb5f2b9a8e738adf2db35cfaba3f8e0decd30de843ae09efb007a5ead774075390e8648030c3f52c17b2c124b1647614b56a6a22c2634eef8c5bdf
7
- data.tar.gz: 176d48303bb79763ef67b0485cd90ff657fa406f1727969ae5c674d3f3b874ca7e466d4190c48910d1b968666665cfe23cfbf36302d38d88ac3ec48b0a575721
6
+ metadata.gz: bed611a57a66223eeba89f046a2aefdcaaca8ba7afadcd2a77a63817104c7bb39c449148109f6d0d2a3061fa00fb4665c7c0ca06384ecb0cd81ca7738101d268
7
+ data.tar.gz: 7463d91432204996f68590e23d79ffba7d0b067d946a37462a5da7a50f4e726383075f0d4d15d6a8639ae8387b24d5d867ba7b8cf74e66705c02287978d2ca75
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [0.0.74] - 2025-03-15
2
+
3
+ - fix bug where a command connector won't expose the non-global domain of a type if the command it depends on
4
+ is in the global domain
5
+
6
+ # [0.0.73] - 2025-03-11
7
+
8
+ - Fix bug preventing false from being used as a default in the Attributes::Dsl
9
+
1
10
  # [0.0.72] - 2025-03-07
2
11
 
3
12
  - Fix bug in find_many_by when there are required attributes not present in the filter
data/README.md CHANGED
@@ -1052,7 +1052,7 @@ Let's install foobara-remote-imports:
1052
1052
  $ gem install foobara-remote-imports
1053
1053
  ```
1054
1054
 
1055
- And lLet's create a new script and import our various Capybara commands over HTTP:
1055
+ And let's create a new script and import our various Capybara commands over HTTP:
1056
1056
 
1057
1057
  ```ruby
1058
1058
  #!/usr/bin/env ruby
@@ -12,6 +12,7 @@ module Foobara
12
12
  false
13
13
  end
14
14
  end
15
+
15
16
  def applicable?(value)
16
17
  value.nil? && allow_nil?
17
18
  end
@@ -354,8 +354,6 @@ module Foobara
354
354
 
355
355
  # Drive all of this off of the list of exposed commands...
356
356
  to_include = Set.new
357
- to_include << command_registry.exposed_global_organization
358
- to_include << command_registry.exposed_global_domain
359
357
 
360
358
  command_registry.foobara_each do |exposed_whatever|
361
359
  to_include << exposed_whatever
@@ -94,7 +94,26 @@ module Foobara
94
94
  @full_command_symbol ||= Util.underscore_sym(full_command_name)
95
95
  end
96
96
 
97
+ def root_registry
98
+ parent = scoped_namespace
99
+ parent = parent.scoped_namespace while parent.scoped_namespace
100
+ parent
101
+ end
102
+
97
103
  def foobara_manifest(to_include: Set.new)
104
+ # A bit of a hack here. We don't have an exposed type class to encapsulate including exposed domains/orgs
105
+ # which leads to a bug when a global command is exposed that depends on a type in a non-global domain
106
+ # but there being no other reason to include that non-global domain.
107
+ transformed_command_class.types_depended_on.select(&:registered?).each do |type|
108
+ full_domain_name = type.foobara_domain.scoped_full_name
109
+
110
+ unless root_registry.foobara_lookup_domain(full_domain_name)
111
+ exposed_domain = root_registry.build_and_register_exposed_domain(full_domain_name)
112
+ to_include << exposed_domain
113
+ to_include << exposed_domain.foobara_organization
114
+ end
115
+ end
116
+
98
117
  transformed_command_class.foobara_manifest(to_include:).merge(super).merge(
99
118
  Util.remove_blank(
100
119
  scoped_category: :command,
@@ -15,6 +15,8 @@ module Foobara
15
15
 
16
16
  # TODO: unable to address types here so it is handled as a hack higher up...
17
17
  def foobara_manifest(to_include: Set.new)
18
+ to_include << foobara_organization
19
+
18
20
  domain_manifest = domain_module.foobara_manifest(to_include: Set.new)
19
21
  mode = Foobara::Namespace::LookupMode::DIRECT
20
22
  commands = foobara_all_command(mode:).map(&:foobara_manifest_reference).sort
@@ -22,6 +24,17 @@ module Foobara
22
24
  domain_manifest.merge(commands:)
23
25
  end
24
26
 
27
+ def foobara_organization
28
+ full_org_name = domain_module.foobara_organization.scoped_full_name
29
+ root_registry.foobara_lookup_organization(full_org_name)
30
+ end
31
+
32
+ def root_registry
33
+ parent = scoped_namespace
34
+ parent = parent.scoped_namespace while parent.scoped_namespace
35
+ parent
36
+ end
37
+
25
38
  def foobara_manifest_reference
26
39
  domain_module.foobara_manifest_reference
27
40
  end
@@ -100,16 +100,6 @@ module Foobara
100
100
  exposed_organization
101
101
  end
102
102
 
103
- def exposed_global_domain
104
- exposed_global_organization.foobara_lookup_domain("") ||
105
- build_and_register_exposed_domain("")
106
- end
107
-
108
- def exposed_global_organization
109
- foobara_lookup_organization("") ||
110
- build_and_register_exposed_organization("")
111
- end
112
-
113
103
  def [](name)
114
104
  if name.is_a?(Class)
115
105
  name.full_command_name
@@ -182,7 +182,8 @@ module Foobara
182
182
 
183
183
  if options[:ignore_unexpected_attributes]
184
184
  Thread.foobara_with_var(:foobara_ignore_unexpected_attributes, true) do
185
- return initialize(attributes, options.except(:ignore_unexpected_attributes))
185
+ initialize(attributes, options.except(:ignore_unexpected_attributes))
186
+ return
186
187
  end
187
188
  end
188
189
 
@@ -107,9 +107,9 @@ module Foobara
107
107
  _add_to_required(attribute_name)
108
108
  end
109
109
 
110
- default = declaration.delete(:default)
110
+ if declaration.key?(:default)
111
+ default = declaration.delete(:default)
111
112
 
112
- if default
113
113
  _add_to_defaults(attribute_name, default)
114
114
  end
115
115
 
@@ -208,7 +208,7 @@ module Foobara
208
208
  always_applicable?
209
209
  end
210
210
 
211
- # This means its applicable regardless of value to transform. Override if different behavior is needed.
211
+ # This means it's applicable regardless of value to transform. Override if different behavior is needed.
212
212
  def always_applicable?
213
213
  !!declaration_data
214
214
  end
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.72
4
+ version: 0.0.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-08 00:00:00.000000000 Z
10
+ date: 2025-03-15 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal