thor 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/thor/group.rb +11 -0
- data/lib/thor/util.rb +1 -1
- data/lib/thor/version.rb +1 -1
- data/lib/thor.rb +11 -0
- 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: 9b49f263d36f84d82f17f16852671ff9e2f529ea0adec4b664a2b8660923d091
|
4
|
+
data.tar.gz: 2df9cade7c368e064377ec0f38737d5b379b38265f23d878cb4976588b94564c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4cca8a5e388509dd8a45a6484c13fa80d89f15c7bfde65ccc3d48d3f86c299269ce6019af1dfe3d2f6f172aff5ae7d7ef8f49ca69de189dcd721d5c9d48269f
|
7
|
+
data.tar.gz: 85b9b4834a91e7fab98ee9f555461cee740bebcbcee3e0efffc9d117d1b8dce6f9967db594225cd32a3d82462b5edc2d6e4c77bb4ef799d6253f3e66f4f88042
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ users.
|
|
15
15
|
|
16
16
|
Please note: Thor, by design, is a system tool created to allow seamless file and url
|
17
17
|
access, which should not receive application user input. It relies on [open-uri][open-uri],
|
18
|
-
which combined with application user input would provide a command injection attack
|
18
|
+
which, combined with application user input, would provide a command injection attack
|
19
19
|
vector.
|
20
20
|
|
21
21
|
[rake]: https://github.com/ruby/rake
|
@@ -27,7 +27,7 @@ Installation
|
|
27
27
|
|
28
28
|
Usage and documentation
|
29
29
|
-----------------------
|
30
|
-
Please see the [wiki][] for basic usage and other documentation on using Thor. You can also
|
30
|
+
Please see the [wiki][] for basic usage and other documentation on using Thor. You can also check out the [official homepage][homepage].
|
31
31
|
|
32
32
|
[wiki]: https://github.com/rails/thor/wiki
|
33
33
|
[homepage]: http://whatisthor.com/
|
data/lib/thor/group.rb
CHANGED
@@ -211,6 +211,17 @@ class Thor::Group
|
|
211
211
|
raise error, msg
|
212
212
|
end
|
213
213
|
|
214
|
+
# Checks if a specified command exists.
|
215
|
+
#
|
216
|
+
# ==== Parameters
|
217
|
+
# command_name<String>:: The name of the command to check for existence.
|
218
|
+
#
|
219
|
+
# ==== Returns
|
220
|
+
# Boolean:: +true+ if the command exists, +false+ otherwise.
|
221
|
+
def command_exists?(command_name) #:nodoc:
|
222
|
+
commands.keys.include?(command_name)
|
223
|
+
end
|
224
|
+
|
214
225
|
protected
|
215
226
|
|
216
227
|
# The method responsible for dispatching given the args.
|
data/lib/thor/util.rb
CHANGED
@@ -133,7 +133,7 @@ class Thor
|
|
133
133
|
*pieces, command = namespace.split(":")
|
134
134
|
namespace = pieces.join(":")
|
135
135
|
namespace = "default" if namespace.empty?
|
136
|
-
klass = Thor::Base.subclasses.detect { |thor| thor.namespace == namespace && thor.
|
136
|
+
klass = Thor::Base.subclasses.detect { |thor| thor.namespace == namespace && thor.command_exists?(command) }
|
137
137
|
end
|
138
138
|
unless klass # look for a Thor::Group with the right name
|
139
139
|
klass = Thor::Util.find_by_namespace(namespace)
|
data/lib/thor/version.rb
CHANGED
data/lib/thor.rb
CHANGED
@@ -439,6 +439,17 @@ class Thor
|
|
439
439
|
command && disable_required_check.include?(command.name.to_sym)
|
440
440
|
end
|
441
441
|
|
442
|
+
# Checks if a specified command exists.
|
443
|
+
#
|
444
|
+
# ==== Parameters
|
445
|
+
# command_name<String>:: The name of the command to check for existence.
|
446
|
+
#
|
447
|
+
# ==== Returns
|
448
|
+
# Boolean:: +true+ if the command exists, +false+ otherwise.
|
449
|
+
def command_exists?(command_name) #:nodoc:
|
450
|
+
commands.keys.include?(normalize_command_name(command_name))
|
451
|
+
end
|
452
|
+
|
442
453
|
protected
|
443
454
|
|
444
455
|
# Returns this class exclusive options array set.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yehuda Katz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -85,9 +85,9 @@ licenses:
|
|
85
85
|
- MIT
|
86
86
|
metadata:
|
87
87
|
bug_tracker_uri: https://github.com/rails/thor/issues
|
88
|
-
changelog_uri: https://github.com/rails/thor/releases/tag/v1.3.
|
88
|
+
changelog_uri: https://github.com/rails/thor/releases/tag/v1.3.2
|
89
89
|
documentation_uri: http://whatisthor.com/
|
90
|
-
source_code_uri: https://github.com/rails/thor/tree/v1.3.
|
90
|
+
source_code_uri: https://github.com/rails/thor/tree/v1.3.2
|
91
91
|
wiki_uri: https://github.com/rails/thor/wiki
|
92
92
|
rubygems_mfa_required: 'true'
|
93
93
|
post_install_message:
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: 1.3.5
|
107
107
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
108
|
+
rubygems_version: 3.5.11
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Thor is a toolkit for building powerful command-line interfaces.
|