bashly 1.2.0 → 1.2.1
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/lib/bashly/commands/shell.rb +1 -1
- data/lib/bashly/config_validator.rb +4 -0
- data/lib/bashly/extensions/array.rb +6 -0
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly/views/argument/validations.gtx +1 -0
- data/lib/bashly/views/command/command_filter.gtx +3 -1
- data/lib/bashly/views/command/normalize_input_function.gtx +5 -1
- data/lib/bashly/views/command/whitelist_filter.gtx +2 -0
- data/lib/bashly/views/flag/validations.gtx +1 -0
- 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: 36c0868dbf2a0e4d5d2fecdc5854aac4e1bea8f7953a07712ccc985289c89b57
|
|
4
|
+
data.tar.gz: 63df3d720e1b36ce7ab658224fde796fb9460c92c7946bd867204c0e0caea304
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39e367d86e8bf21ae076c35887157234e7d39d003f17a596aa4711a02a87c6b3856ac27b0f1c73c30837b2589358e479c069dba4cff657431fdca98f44116718
|
|
7
|
+
data.tar.gz: eceaabeafea2e93a9cf7c9d7c2f999a2303c0d9172ddd7799bb0d1f9eafe62166ee9512d8688ad9cc6547dd28e20b7c8925ca489cb2639fd3cd2456517461e7a
|
|
@@ -231,6 +231,10 @@ module Bashly
|
|
|
231
231
|
assert value['args'].last['repeatable'],
|
|
232
232
|
"#{key}.args cannot contain a repeatable arg unless it is the last one"
|
|
233
233
|
end
|
|
234
|
+
|
|
235
|
+
required_order = value['args'].map { |x| x['required'] ? true : false }
|
|
236
|
+
refute required_order.include_sequence?(false, true),
|
|
237
|
+
"#{key}.args cannot contain required arg after optional arg"
|
|
234
238
|
end
|
|
235
239
|
|
|
236
240
|
if value['expose']
|
data/lib/bashly/version.rb
CHANGED
|
@@ -3,6 +3,7 @@ if whitelisted_args.any? or whitelisted_flags.any?
|
|
|
3
3
|
|
|
4
4
|
whitelisted_args.each do |arg|
|
|
5
5
|
if arg.repeatable
|
|
6
|
+
> input_array=''
|
|
6
7
|
> eval "input_array=(${args[{{ arg.name }}]})"
|
|
7
8
|
> for i in "${input_array[@]}"; do
|
|
8
9
|
> if [[ ! $i =~ ^({{ arg.allowed.join '|' }})$ ]]; then
|
|
@@ -22,6 +23,7 @@ if whitelisted_args.any? or whitelisted_flags.any?
|
|
|
22
23
|
|
|
23
24
|
whitelisted_flags.each do |flag|
|
|
24
25
|
if flag.repeatable
|
|
26
|
+
> input_array=''
|
|
25
27
|
> eval "input_array=(${args[{{ flag.name }}]})"
|
|
26
28
|
> for i in "${input_array[@]}"; do
|
|
27
29
|
> if [[ ! $i =~ ^({{ flag.allowed.join '|' }})$ ]]; then
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bashly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
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: 2024-07-
|
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colsole
|