File tree 8 files changed +30
-13
lines changed
8 files changed +30
-13
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def completion_generator
62
62
end
63
63
64
64
def completion_flag_names
65
- visible_flags . map ( &:name ) + public_flags . map ( &:short )
65
+ visible_flags . map ( &:name ) + visible_flags . map ( &:short )
66
66
end
67
67
68
68
def completion_allowed_args
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ if extensible
43
43
end
44
44
>
45
45
46
- if public_commands .any?
46
+ if visible_commands .any?
47
47
grouped_commands.each do |group, commands|
48
48
> {{ group.gsub(/:$/, '').upcase }}
49
49
> ==================================================
@@ -150,11 +150,11 @@ if dependencies.any?
150
150
end
151
151
end
152
152
153
- if public_environment_variables .any?
153
+ if visible_environment_variables .any?
154
154
> ENVIRONMENT VARIABLES
155
155
> ==================================================
156
156
>
157
- public_environment_variables .each do |environment_variable|
157
+ visible_environment_variables .each do |environment_variable|
158
158
> {{ environment_variable.name.upcase }}
159
159
> --------------------------------------------------
160
160
>
186
186
187
187
see_also = []
188
188
see_also << parents.first if parents.any?
189
- see_also += public_commands .map { |x| x.full_name.to_hyphen } if public_commands .any?
189
+ see_also += visible_commands .map { |x| x.full_name.to_hyphen } if visible_commands .any?
190
190
see_also += x_mandoc_see_also if x_mandoc_see_also && x_mandoc_see_also.is_a?(Array)
191
191
see_also.map! do |item|
192
192
item.match(/(.+)(\(\d\))/) ? "**#{$1}**#{$2}" : "**#{item}**(1)"
Original file line number Diff line number Diff line change 62
62
63
63
# === Environment Variables
64
64
65
- if public_environment_variables .any?
65
+ if visible_environment_variables .any?
66
66
> ## Environment Variables
67
67
>
68
- public_environment_variables .each do |environment_variable|
68
+ visible_environment_variables .each do |environment_variable|
69
69
attributes = environment_variable.required || environment_variable.default
70
70
71
71
> #### *{{ environment_variable.name.upcase }}*
Original file line number Diff line number Diff line change @@ -72,12 +72,12 @@ def default_command
72
72
def grouped_commands
73
73
result = { }
74
74
75
- public_commands . each do |command |
75
+ visible_commands . each do |command |
76
76
result [ command . group_string ] ||= [ ]
77
77
result [ command . group_string ] << command
78
78
next unless command . expose
79
79
80
- command . public_commands . each do |subcommand |
80
+ command . visible_commands . each do |subcommand |
81
81
result [ command . group_string ] << subcommand
82
82
end
83
83
end
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ def validated_environment_variables
31
31
environment_variables . select ( &:validate )
32
32
end
33
33
34
+ # Returns only public environment variables, or both public and private
35
+ # environment variables if Settings.private_reveal_key is set
36
+ def visible_environment_variables
37
+ Settings . private_reveal_key ? environment_variables : public_environment_variables
38
+ end
39
+
34
40
# Returns an array of all the environment_variables with a whitelist arg
35
41
def whitelisted_environment_variables
36
42
environment_variables . select ( &:allowed )
Original file line number Diff line number Diff line change 4
4
> printf "{{ help.wrap(76).indent(4).sanitize_for_print }}\n"
5
5
6
6
if allowed
7
- > printf " %s\n" "{{ strings[:allowed] % { values: allowed.join(', ') } }}\n "
7
+ > printf " %s\n" "{{ strings[:allowed] % { values: allowed.join(', ') } }}"
8
8
end
9
9
10
10
if default
Original file line number Diff line number Diff line change @@ -18,10 +18,21 @@ Some specs have tags for convenience:
18
18
- ` :stable ` - specs of features that rarely change
19
19
- ` :noci ` - specs that are disabled in CI
20
20
21
- For example, to run only specs that are not : slow and not : stable , run:
21
+ ## Useful respec commands
22
+
22
23
23
24
``` bash
25
+ # smoke test; run only specs that are not :slow and not :stable
24
26
$ respec tagged ~ stable ~ slow
27
+
28
+ # test examples only
29
+ $ respec only examples
30
+
31
+ # test a specific example only
32
+ $ EXAMPLE=whitelist respec only examples
33
+
34
+ # test only specs that changed recently, and repeat on change
35
+ $ respec refactor # or respec r
25
36
```
26
37
27
38
## Notes about Example Tests
Original file line number Diff line number Diff line change 14
14
cli --version | -v
15
15
16
16
Commands:
17
- connect Connect to the metaverse
17
+ connect Connect to the metaverse
18
18
19
19
+ ./cli -h
20
20
cli - Sample application with private commands
25
25
cli --version | -v
26
26
27
27
Commands:
28
- connect Connect to the metaverse
28
+ connect Connect to the metaverse
29
29
30
30
Options:
31
31
--help, -h
You can’t perform that action at this time.
0 commit comments