completely 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/completely/commands/test.rb +17 -8
- data/lib/completely/templates/tester-template.erb +8 -1
- data/lib/completely/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: cb9fe8791d64ddc71e8ee082ce9fc9cf028376f61c71bf354b758f38ecfded86
|
4
|
+
data.tar.gz: 9fa6a5ced31c2fafdebfbd0172f939cccd9aa95b48eedd5ca528ab5a3b03eee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea9dcf451393c1b242bebcf0766a2d56e847005da451557aa601893536fdb7a2773bd1abbeb6a3b510abae3ffa87258fd6bbc45641405a991690c2bd0441a623
|
7
|
+
data.tar.gz: 77ee32ac693f7cdee5953e173974e84ddee4380b0298b3caf3a68a79208bae2ab6f856ae0e8f49b9c15d152b171ad7ad5186837e56cfcbc69b5abe4bd82a6873
|
@@ -5,15 +5,13 @@ module Completely
|
|
5
5
|
class Test < Base
|
6
6
|
summary "Test completions"
|
7
7
|
|
8
|
-
help
|
9
|
-
This command can be used to test that any completion script (either generated by compeltely or not) responds with the right completions.
|
8
|
+
help "This command can be used to test that your completions script responds with the right completions. It works by reading your completely.yaml file, generating a completions script, and generating a temporary testing script."
|
10
9
|
|
11
|
-
|
12
|
-
EOF
|
13
|
-
|
14
|
-
usage "completely test COMPLINE"
|
10
|
+
usage "completely test [--keep] COMPLINE"
|
15
11
|
usage "completely test (-h|--help)"
|
16
12
|
|
13
|
+
option "-k --keep", "Keep the temporary testing script in the current directory"
|
14
|
+
|
17
15
|
param "COMPLINE", "The command to test completions for. This will be handled as if a TAB was pressed immediately at the end of it, so the last word is considered the active cursor. If you wish to complete for the next word instead, end your command with a space."
|
18
16
|
|
19
17
|
environment_config_path
|
@@ -24,6 +22,10 @@ module Completely
|
|
24
22
|
|
25
23
|
def run
|
26
24
|
puts tester.test(compline).join "\n"
|
25
|
+
if args['--keep']
|
26
|
+
File.write 'completely-tester.sh', tester_script
|
27
|
+
puts 'saved completely-tester.sh'
|
28
|
+
end
|
27
29
|
end
|
28
30
|
|
29
31
|
private
|
@@ -32,9 +34,16 @@ module Completely
|
|
32
34
|
args['COMPLINE']
|
33
35
|
end
|
34
36
|
|
37
|
+
def completions
|
38
|
+
@completions ||= Completions.load config_path
|
39
|
+
end
|
40
|
+
|
35
41
|
def tester
|
36
|
-
|
37
|
-
|
42
|
+
@tester ||= completions.tester
|
43
|
+
end
|
44
|
+
|
45
|
+
def tester_script
|
46
|
+
@tester_script ||= tester.tester_script compline
|
38
47
|
end
|
39
48
|
|
40
49
|
end
|
@@ -1,7 +1,14 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
|
+
if [[ -n $ZSH_VERSION ]]; then
|
3
|
+
autoload -U +X bashcompinit && bashcompinit
|
4
|
+
autoload -U +X compinit && compinit
|
5
|
+
fi
|
6
|
+
|
7
|
+
# === COMPLETION SCRIPT START ===
|
8
|
+
|
2
9
|
<%= script || %Q[source "#{absolute_script_path}"] %>
|
3
10
|
|
4
|
-
#
|
11
|
+
# === COMPLETION SCRIPT END ===
|
5
12
|
|
6
13
|
COMP_WORDS=( <%= compline %> )
|
7
14
|
COMP_LINE="<%= compline %>"
|
data/lib/completely/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: completely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|