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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38de4ac84fa86c4333894c4e0adc744df06379bebd399fa64353e358c5f1c522
4
- data.tar.gz: adc97f1a4a65f9f606fd121e4b3aa47e91aae1c0c5e6e26c16e8894b7ebf753b
3
+ metadata.gz: 146472c232884b8bfe27c65fd3d3d8994b4878f7281e1ab3e487bc067dd3acb2
4
+ data.tar.gz: 9f69a5ab5f53b9686153a22f2ef4ef366d8324527956bf9aa36019c005ceac39
5
5
  SHA512:
6
- metadata.gz: 88a9c575b4fef1827c3be3322fb5603b07a0634395ca967b0329fafd7d53349856d226f9eb5479a3bedb4b31a021d95167d87e560e4e0a14e2cdb31ef82943fe
7
- data.tar.gz: b93e2fccd489c023889a5e4fe791864140c87fd1bf44e1032685fa9ad218c73425538c0202850aaabe2fff1322e506a9e1c025cc20ede67543ecb1f50beba62e
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
- CompletionSpec = Struct.new(:program_name, :nodes, keyword_init: true)
15
- Node = Struct.new(:path, :desc, :options, :arguments, :children, keyword_init: true)
16
-
17
- # :values shadows Struct#values by design: it is the field name the
18
- # interface contract in .plans/001.00-*/plan.md fixes for emitters.
19
- OptionSpec = Struct.new(
20
- :name, :type, :values, :aliases, :default, :desc, :required, :boolean, :array,
21
- keyword_init: true
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 = Struct.new(:name, :values, :desc, :required, :file, keyword_init: true)
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.
@@ -9,7 +9,7 @@ module Dry
9
9
  # inherits from Object, so an empty reopening is compatible either way.
10
10
  class CLI
11
11
  module Autocomplete
12
- VERSION = "0.1.0"
12
+ VERSION = "0.1.1"
13
13
  end
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-cli-autocomplete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul