foobara 0.0.4 → 0.0.6

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: 467a360223436ef05ee0657bdcfbe8b6f8e855fe13a5af8f16d1fc9ef5d3b8e1
4
- data.tar.gz: 3dcf54e84bd89483b9130d3c6093e1e14908c284904032fdb1c3011c7ca02dfb
3
+ metadata.gz: 2415af0fac9d64a2075b934b81e2949ca672135419cd3c8dad6ee7655b449288
4
+ data.tar.gz: 5a775144eb8d9073d6d9dcaf25590004fab2782de345438354b0b386b53d83ec
5
5
  SHA512:
6
- metadata.gz: b58b221f4cfbc3407bcf2098049f9a00e8cc50b9ba97f03ac0c7f50e7e851f44096f98183a5d1e1805559df2ed10cabbc731002eec3ce5bd492db97656fa167e
7
- data.tar.gz: 813912a5fe4b4aed472f4cf4dc51724e650595b128c422bacb7f6592ab08e319b9d8977b3474df048833f4a5847d037cef6013d498bfe722507e1e313221f361
6
+ metadata.gz: 43c26a3672bee00ffd4cb8a1939bf87194274a61f4f9e824bce378cbb216edb7b4cef85a84fd6d1695448311302e9a6db41370666c3c82f898c174e180b9835f
7
+ data.tar.gz: 1944745066fca3464cb6e4a733a091ab982c2cdd8d38b5fae2ac877ffa2a0cff61990df339d5e49fa8e08274970a84812a688d35595ec3ee81c3155be6bcbc52
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.6] - 2024-08-21
2
+
3
+ - Give a way to check if a type is builtin by reference
4
+
5
+ ## [0.0.5] - 2024-08-21
6
+
7
+ - Render element type for Array types in Http::Help
8
+
1
9
  ## [0.0.4] - 2024-08-19
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)
@@ -391,7 +391,13 @@ module Foobara
391
391
  end
392
392
  end
393
393
 
394
- h.sort.to_h
394
+ normalize_manifest(h)
395
+ end
396
+
397
+ def normalize_manifest(manifest_hash)
398
+ manifest_hash.map do |key, entries|
399
+ [key, entries.sort.to_h]
400
+ end.sort.to_h
395
401
  end
396
402
 
397
403
  def all_exposed_commands
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.4
4
+ version: 0.0.6
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-08-19 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foobara-util