dry-cli-autocomplete 0.1.0 → 0.1.1
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.
Potentially problematic release.
This version of dry-cli-autocomplete might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/dry/cli/autocomplete/spec_builder.rb +17 -10
- data/lib/dry/cli/autocomplete/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 146472c232884b8bfe27c65fd3d3d8994b4878f7281e1ab3e487bc067dd3acb2
|
|
4
|
+
data.tar.gz: 9f69a5ab5f53b9686153a22f2ef4ef366d8324527956bf9aa36019c005ceac39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cec8fb53e24d452b7c26fdcc371ba8d6b99757ec5f3670e24c0b38a3deed8c4ca1ac3fd8476feb672beeb838ef3063a345f070d6364d0bd2c4ef89dcfbf23f64
|
|
7
|
+
data.tar.gz: 592b9a0c0ff24d4e181b58f399db327826cc583b8bf595a6703ec49db4c455c6ab784b9c610ccb9ece2e7c642d766ff7c4273d985e3208446bc3d94f50d7174b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.1] - 2026-08-22
|
|
4
|
+
|
|
5
|
+
- Fixed loading inside any host that has dry-struct loaded. The value objects
|
|
6
|
+
were built from a bare `Struct`, which resolves to `Dry::Struct` from inside
|
|
7
|
+
`module Dry`, so `mycli completion bash` raised `wrong number of arguments`
|
|
8
|
+
on the host's machine while this gem's own suite stayed green.
|
|
9
|
+
- Value objects are `Data` rather than `Struct`: frozen, and a missing field
|
|
10
|
+
raises instead of arriving as a silent nil.
|
|
11
|
+
|
|
3
12
|
## [0.1.0] - 2026-08-22
|
|
4
13
|
|
|
5
14
|
- Initial release
|
|
@@ -11,17 +11,24 @@ module Dry
|
|
|
11
11
|
# already holds, so it stays cheap enough to run on every shell start.
|
|
12
12
|
# See SPECIFICATION.md §2.2 and §2.3.
|
|
13
13
|
class SpecBuilder
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
# `::Data`, with the leading colons, and never a bare `Data`. This file
|
|
15
|
+
# is lexically inside `module Dry`, so an unqualified constant is looked
|
|
16
|
+
# up there first: a bare `Struct` here meant `Dry::Struct` in any host
|
|
17
|
+
# that had dry-struct loaded, which took different arguments and broke
|
|
18
|
+
# on the host's machine while this gem's own suite stayed green. No
|
|
19
|
+
# `Dry::Data` exists today, but the same trap is one released gem away,
|
|
20
|
+
# and dry_struct_host_spec.rb is what keeps watch.
|
|
21
|
+
#
|
|
22
|
+
# Data rather than Struct because these are descriptions, built once and
|
|
23
|
+
# rendered: frozen is what they should be, a missing field raises rather
|
|
24
|
+
# than arriving as a silent nil, and `:values` stops colliding with a
|
|
25
|
+
# method Struct defines and Data does not.
|
|
26
|
+
CompletionSpec = ::Data.define(:program_name, :nodes)
|
|
27
|
+
Node = ::Data.define(:path, :desc, :options, :arguments, :children)
|
|
28
|
+
OptionSpec = ::Data.define(
|
|
29
|
+
:name, :type, :values, :aliases, :default, :desc, :required, :boolean, :array
|
|
22
30
|
)
|
|
23
|
-
ArgumentSpec =
|
|
24
|
-
# rubocop:enable Lint/StructNewOverride
|
|
31
|
+
ArgumentSpec = ::Data.define(:name, :values, :desc, :required, :file)
|
|
25
32
|
|
|
26
33
|
# A bare heuristic, used only when a host does not declare `file:`
|
|
27
34
|
# explicitly on the argument. See SPECIFICATION.md §4.3.
|