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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/thor/completion/builder.rb +12 -3
- data/lib/thor/completion/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 691cb833f0cc214e326a1b186f6c884cab5abe6102dc4357f1eee7cd6f82ed1e
|
|
4
|
+
data.tar.gz: fb8a29b2ceb7ae67e907d3e63e02717acfa6e44ab68a229ed85bc6c1f91db3a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
|
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
|
|
169
|
+
type: normalize_type(option.type),
|
|
161
170
|
description: "",
|
|
162
171
|
required: false,
|
|
163
172
|
repeatable: option.repeatable || false,
|
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.
|
|
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.
|
|
169
|
-
changelog_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
170
|
-
documentation_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
171
|
-
license_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
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
|