foobara 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0d75c02aeb1d7ced25b0d2a0ef318dd0e3a1935b4c49be4f051c047f20087ef
4
- data.tar.gz: 2e356c61f565f53264e67158099796459f3acc9b265ad6762acb351753062c89
3
+ metadata.gz: 2864913cd9394c107229c991b761ca242a2b86dcdede5e2c18dc506c1c4694c0
4
+ data.tar.gz: 185e017e5206d707e590647b0f024742b874ef41ebc4569c43867420c37c9df9
5
5
  SHA512:
6
- metadata.gz: 3b1ea24287f78f2c071d9c3284674b92ad127a96fb19186fa59e2994b85c43277fd075e95587df12ff582f05dcb59f50cf439b0c54e7b07de7b982171f8098a9
7
- data.tar.gz: fc609c10518e1cc5af2a096204ddde8527fbcf9934df455343c3565fdd94dd4863b47269e5b7ec3acd2796e179075f6d2744c4c43116af6e9a110b93d28fb7e2
6
+ metadata.gz: 76a106a02c5cce555b55fa415ba66d48bb8d55ca276f81f079ed4efd63c37bdc03157f147322475cc92a085030c1cc43129319c933a6a2c8a3c77336058e78bd
7
+ data.tar.gz: 959c99953c84ed9f1113fca6fcd8c77336d01a594401008c2aa825455c8679ac39625162a1523b4b3aa4fba74e0ff738c53838a4ef7c4bb226ace70c9a5630b8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.7] - 2024-08-21
2
+
3
+ - Add Manifest::Type#builtin?
4
+
5
+ ## [0.0.6] - 2024-08-21
6
+
7
+ - Give a way to check if a type is builtin by reference
8
+
1
9
  ## [0.0.5] - 2024-08-21
2
10
 
3
11
  - Render element type for Array types in Http::Help
@@ -9,10 +9,23 @@ module Foobara
9
9
  @builtin_types ||= Set.new
10
10
  end
11
11
 
12
+ def add_builtin_type(type)
13
+ @builtin_references = nil
14
+ builtin_types << type
15
+ end
16
+
17
+ def builtin_references
18
+ @builtin_references ||= builtin_types.to_set(&:foobara_manifest_reference)
19
+ end
20
+
12
21
  def builtin?(type)
13
22
  builtin_types.include?(type)
14
23
  end
15
24
 
25
+ def builtin_reference?(reference)
26
+ builtin_references.include?(reference)
27
+ end
28
+
16
29
  def [](symbol)
17
30
  builtin_types.find do |type|
18
31
  type.type_symbol == symbol
@@ -57,7 +57,7 @@ module Foobara
57
57
  description:
58
58
  )
59
59
 
60
- builtin_types << type
60
+ add_builtin_type(type)
61
61
 
62
62
  # TODO: is this necessary?
63
63
  Foobara::Namespace::NamespaceHelpers.foobara_namespace!(type)
@@ -81,6 +81,10 @@ module Foobara
81
81
  def full_type_name
82
82
  scoped_full_name
83
83
  end
84
+
85
+ def builtin?
86
+ BuiltinTypes.builtin_reference?(reference)
87
+ end
84
88
  end
85
89
  end
86
90
  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.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi