foobara 0.0.53 → 0.0.55

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: 6f36fa530b7c550b95ee9f580590ad68e18700e80048746fb734078ea0e9744e
4
- data.tar.gz: 1454b5d06e3be5c3be8b9cfee10b6e598b71ad74f409c7f09d2a66427f71f3a7
3
+ metadata.gz: 78bd1547b990baf3ef2d1210747e7c9ea2943a3136fd39d38f399f0a90f73aa6
4
+ data.tar.gz: b75e8291b79c05de501de15ed64c62df2ce26de2f7e13fcde95dd6c9cd445430
5
5
  SHA512:
6
- metadata.gz: 5a238d0b3ba1366f67a0edee344a7f0228367b56a0c45eabe230603310a4b36b9f13b765382907a9e8c72533f0ec18af6f1b956e575a0c79bffe08e036de3097
7
- data.tar.gz: 99b3b4c279bc4104fc1faefda279bf4fadcae8ee57975655dec120f17ce5980fda6b2dccf1476e00df20460e3a091dba56f5c00afdc4907bdf62c374feddee78
6
+ metadata.gz: 3d49b8eef5f2823c475b2227e1f05c844327837ff8eb0545ca62b46aa2f122413d4d283d3e6fc7a8618e8469c98ab7bfb6b77f5a4fa7131743cffa0d398309a3
7
+ data.tar.gz: ca9194b01789d6ac289322a919b56ac9e9074a838524509d0759251d4c62839942b56aac0d6c59f3018d89a67fa68aa9421b5c28922b1c4c978e3060432aeb32
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [0.0.55] - 2025-02-01
2
+
3
+ - Mark types as builtin directly and add builtin flag to manifest
4
+ - Pass Request#inputs through to Describe and other commands
5
+ - Fix bugs around what is considered a manifest entity/model
6
+
7
+ ## [0.0.54] - 2025-01-31
8
+
9
+ - Change interface of base_type_for_manifest
10
+
1
11
  ## [0.0.53] - 2025-01-30
2
12
 
3
13
  - Prefix and re-organize several model methods to facilitate type extension
@@ -12,6 +12,7 @@ module Foobara
12
12
  def add_builtin_type(type)
13
13
  @builtin_references = nil
14
14
  builtin_types << type
15
+ type.is_builtin = true
15
16
  end
16
17
 
17
18
  def builtin_references
@@ -139,7 +139,8 @@ module Foobara
139
139
  command_class = find_builtin_command_class("Describe")
140
140
  full_command_name = command_class.full_command_name
141
141
 
142
- inputs = { manifestable:, request: }
142
+ inputs = request.inputs.merge(manifestable:, request:)
143
+
143
144
  transformed_command_class = transformed_command_from_name(full_command_name) ||
144
145
  transform_command_class(command_class)
145
146
  when "describe_command"
@@ -154,7 +155,7 @@ module Foobara
154
155
  command_class = find_builtin_command_class("Describe")
155
156
  full_command_name = command_class.full_command_name
156
157
 
157
- inputs = { manifestable: transformed_command_class, request: }
158
+ inputs = request.inputs.merge(manifestable: transformed_command_class, request:)
158
159
  transformed_command_class = transformed_command_from_name(full_command_name) ||
159
160
  transform_command_class(command_class)
160
161
  when "describe_type"
@@ -169,14 +170,14 @@ module Foobara
169
170
  command_class = find_builtin_command_class("Describe")
170
171
  full_command_name = command_class.full_command_name
171
172
 
172
- inputs = { manifestable: type, request: }
173
+ inputs = request.inputs.merge(manifestable: type, request:)
173
174
  transformed_command_class = transformed_command_from_name(full_command_name) ||
174
175
  transform_command_class(command_class)
175
176
  when "manifest"
176
177
  command_class = find_builtin_command_class("Describe")
177
178
  full_command_name = command_class.full_command_name
178
179
 
179
- inputs = { manifestable: self, request: }
180
+ inputs = request.inputs.merge(manifestable: self, request:)
180
181
  transformed_command_class = transformed_command_from_name(full_command_name) ||
181
182
  transform_command_class(command_class)
182
183
  when "ping"
@@ -20,15 +20,15 @@ module Foobara
20
20
  end
21
21
 
22
22
  def detached_entities
23
- @detached_entities ||= types.select(&:detached_entity?)
23
+ @detached_entities ||= models.select(&:detached_entity?)
24
24
  end
25
25
 
26
26
  def entities
27
- @entities ||= types.select(&:entity?)
27
+ @entities ||= detached_entities.select(&:entity?)
28
28
  end
29
29
 
30
30
  def models
31
- @models ||= types.select(&:model?)
31
+ @models ||= types.select(&:model?).reject(&:builtin?)
32
32
  end
33
33
 
34
34
  def global?
@@ -27,44 +27,15 @@ module Foobara
27
27
  end
28
28
 
29
29
  def entity?
30
- type = base_type
31
-
32
- while type
33
- return true if type.reference.to_sym == :entity
34
-
35
- type = type.base_type
36
- end
37
-
38
- false
30
+ !builtin? && extends_symbol?(:entity)
39
31
  end
40
32
 
41
33
  def detached_entity?
42
- return false if reference == "entity"
43
-
44
- type = base_type
45
-
46
- while type
47
- return true if type.reference.to_sym == :detached_entity
48
-
49
- type = type.base_type
50
- end
51
-
52
- false
34
+ !builtin? && extends_symbol?(:detached_entity)
53
35
  end
54
36
 
55
37
  def model?
56
- # TODO: hmmmm, should be false for :active_record
57
- return false if %w[entity detached_entity].include?(reference)
58
-
59
- type = base_type
60
-
61
- while type
62
- return true if type.reference.to_sym == :model
63
-
64
- type = type.base_type
65
- end
66
-
67
- false
38
+ !builtin? && extends_symbol?(:model)
68
39
  end
69
40
 
70
41
  def base_type
@@ -102,6 +73,18 @@ module Foobara
102
73
  def builtin?
103
74
  BuiltinTypes.builtin_reference?(reference)
104
75
  end
76
+
77
+ def extends_symbol?(symbol)
78
+ type = base_type
79
+
80
+ while type
81
+ return true if type.reference.to_sym == symbol
82
+
83
+ type = type.base_type
84
+ end
85
+
86
+ false
87
+ end
105
88
  end
106
89
  end
107
90
  end
@@ -22,6 +22,7 @@ module Foobara
22
22
  :structure_count,
23
23
  :element_types,
24
24
  :element_type,
25
+ :is_builtin,
25
26
  :raw_declaration_data,
26
27
  :name,
27
28
  :target_classes,
@@ -322,8 +323,9 @@ module Foobara
322
323
  target_classes: target_classes.map(&:name).sort,
323
324
  declaration_data:,
324
325
  types_depended_on: types.sort,
325
- possible_errors: possible_errors_manifests
326
- ).merge(description:, base_type: base_type_for_manifest)
326
+ possible_errors: possible_errors_manifests,
327
+ builtin: builtin?
328
+ ).merge(description:, base_type: base_type_for_manifest&.full_type_name&.to_sym)
327
329
 
328
330
  h.merge!(
329
331
  supported_processor_manifest(to_include).merge(
@@ -340,8 +342,12 @@ module Foobara
340
342
  super.merge(h)
341
343
  end
342
344
 
345
+ def builtin?
346
+ is_builtin
347
+ end
348
+
343
349
  def base_type_for_manifest
344
- base_type&.full_type_name&.to_sym
350
+ base_type
345
351
  end
346
352
 
347
353
  def supported_processor_manifest(to_include)
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.53
4
+ version: 0.0.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-31 00:00:00.000000000 Z
10
+ date: 2025-02-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal