thor-completion 0.0.2 → 0.0.3

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: c9a09943a60c0fa1ee8dc204e7f1ce67f86683d31651ce15f284c087313c1ce2
4
- data.tar.gz: 8b82e6ded0bd726a29d701fa71ccaccadda97d76308385b5333766a83a06a66f
3
+ metadata.gz: 691cb833f0cc214e326a1b186f6c884cab5abe6102dc4357f1eee7cd6f82ed1e
4
+ data.tar.gz: fb8a29b2ceb7ae67e907d3e63e02717acfa6e44ab68a229ed85bc6c1f91db3a5
5
5
  SHA512:
6
- metadata.gz: 3feea415e81693e107ef457275d38207e1f495de6ea439e43a889b23ec7a59ae8f94f2e8329dc77b683e2b0de5adc239ce5384e87a4a849eebabe6358eea5b1f
7
- data.tar.gz: e339618aa4c8e0a6054178a4d729fa9bcdfe3b898e104671fb3247bf96eac273d6dee2e73b00de156f95e749b810e7a9b9f8858b49d0e793e1990ad9d7725134
6
+ metadata.gz: bd116f5e939b154e1dce77cd86bb02ccf07f832c5591d6ba782aa3b8b0aa9d0fdf459fd9e6eddb0ecf500ccaf0fb911579a40b7f435996a9b417d42bfb63f4f5
7
+ data.tar.gz: 19120d0dba101995ae46132e91e45eea1c674ef47b27d4ca86c022c5bff6a6569b2c3dd7028db693840dcb74d8a6f5dbdc1f4260baff13cb88be33ebe42b026d
data/CHANGELOG.md CHANGED
@@ -11,6 +11,10 @@ Prefix your message with one of the following:
11
11
  - [Security] in case of vulnerabilities.
12
12
  -->
13
13
 
14
+ ## v0.0.3
15
+
16
+ - [Fixed] Map Thor's `numeric` type to schema's `float` type.
17
+
14
18
  ## v0.0.2
15
19
 
16
20
  - [Fixed] Fix completion property format to match schema (object instead of
@@ -56,6 +56,15 @@ class Thor
56
56
  end
57
57
  end
58
58
 
59
+ def self.normalize_type(thor_type)
60
+ case thor_type.to_s
61
+ when "numeric"
62
+ "float"
63
+ else
64
+ thor_type.to_s
65
+ end
66
+ end
67
+
59
68
  def self.resolve_completion(value)
60
69
  value = value.to_s
61
70
 
@@ -124,7 +133,7 @@ class Thor
124
133
  short_opts = option.aliases.map { dasherize.call(_1.gsub(/^-+/, "")) }
125
134
  opt_hash = {
126
135
  name:,
127
- type: option.type.to_s,
136
+ type: normalize_type(option.type),
128
137
  description: option.description || "",
129
138
  required: option.required,
130
139
  repeatable: option.repeatable || false,
@@ -148,7 +157,7 @@ class Thor
148
157
  if option.type == :boolean
149
158
  list << {
150
159
  name: "no-#{name}",
151
- type: option.type.to_s,
160
+ type: normalize_type(option.type),
152
161
  description: "",
153
162
  required: false,
154
163
  repeatable: option.repeatable || false,
@@ -157,7 +166,7 @@ class Thor
157
166
 
158
167
  list << {
159
168
  name: "skip-#{name}",
160
- type: option.type.to_s,
169
+ type: normalize_type(option.type),
161
170
  description: "",
162
171
  required: false,
163
172
  repeatable: option.repeatable || false,
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Thor
4
4
  module Completion
5
- VERSION = "0.0.2"
5
+ VERSION = "0.0.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thor-completion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
@@ -165,10 +165,10 @@ metadata:
165
165
  rubygems_mfa_required: 'true'
166
166
  homepage_uri: https://github.com/fnando/thor-completion
167
167
  bug_tracker_uri: https://github.com/fnando/thor-completion/issues
168
- source_code_uri: https://github.com/fnando/thor-completion/tree/v0.0.2
169
- changelog_uri: https://github.com/fnando/thor-completion/tree/v0.0.2/CHANGELOG.md
170
- documentation_uri: https://github.com/fnando/thor-completion/tree/v0.0.2/README.md
171
- license_uri: https://github.com/fnando/thor-completion/tree/v0.0.2/LICENSE.md
168
+ source_code_uri: https://github.com/fnando/thor-completion/tree/v0.0.3
169
+ changelog_uri: https://github.com/fnando/thor-completion/tree/v0.0.3/CHANGELOG.md
170
+ documentation_uri: https://github.com/fnando/thor-completion/tree/v0.0.3/README.md
171
+ license_uri: https://github.com/fnando/thor-completion/tree/v0.0.3/LICENSE.md
172
172
  rdoc_options: []
173
173
  require_paths:
174
174
  - lib