thor 0.20.1 → 0.20.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/thor/error.rb +10 -13
- data/lib/thor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20c14f63247ba230f58e65b5ec5f5a88168d07d165279bef09d69c29056c9f0f
|
4
|
+
data.tar.gz: d54f3dbe3c1fe7ae4ad41b11af4744de090be3090b0c80926f2bf2e221444d97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14e7a0814d7ae8a31a10c481e42120fba4a64dc977026cd5aa81508f5acc44c4482d02cd5969898f8593c18e378209443c8e5622d8298f085137dc5267621bae
|
7
|
+
data.tar.gz: cb1b294f8e9e460c46d122be4c3fed8355470178724f43b9881aefc1e550d28c47dd6a3e154b15a18735004362142feeb984bca804253875403c29297e636503
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# 0.20.2
|
2
|
+
* Fix `did_you_mean` support.
|
3
|
+
|
1
4
|
# 0.20.1
|
2
5
|
* Support new versions fo ERB.
|
3
6
|
* Fix `check_unknown_options!` to not check the content that was not parsed, i.e. after a `--` or after the first unknown with `stop_on_unknown_option!`
|
7
|
+
* Add `did_you_mean` support.
|
4
8
|
|
5
9
|
## 0.20.0
|
6
10
|
* Add `check_default_type!` to check if the default value of an option matches the defined type.
|
data/lib/thor/error.rb
CHANGED
@@ -3,16 +3,14 @@ class Thor
|
|
3
3
|
begin
|
4
4
|
require 'did_you_mean'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@dictionary = dictionary
|
15
|
-
end
|
6
|
+
# In order to support versions of Ruby that don't have keyword
|
7
|
+
# arguments, we need our own spell checker class that doesn't take key
|
8
|
+
# words. Even though this code wouldn't be hit because of the check
|
9
|
+
# above, it's still necessary because the interpreter would otherwise be
|
10
|
+
# unable to parse the file.
|
11
|
+
class NoKwargSpellChecker < DidYouMean::SpellChecker # :nodoc:
|
12
|
+
def initialize(dictionary)
|
13
|
+
@dictionary = dictionary
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
@@ -43,7 +41,7 @@ class Thor
|
|
43
41
|
end
|
44
42
|
|
45
43
|
def spell_checker
|
46
|
-
|
44
|
+
NoKwargSpellChecker.new(error.all_commands)
|
47
45
|
end
|
48
46
|
end
|
49
47
|
|
@@ -85,8 +83,7 @@ class Thor
|
|
85
83
|
end
|
86
84
|
|
87
85
|
def spell_checker
|
88
|
-
@spell_checker ||=
|
89
|
-
DidYouMean::NoKwargSpellChecker.new(error.switches)
|
86
|
+
@spell_checker ||= NoKwargSpellChecker.new(error.switches)
|
90
87
|
end
|
91
88
|
end
|
92
89
|
|
data/lib/thor/version.rb
CHANGED
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: 0.20.
|
4
|
+
version: 0.20.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: 2018-11-
|
12
|
+
date: 2018-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|