bashly 0.8.8 → 0.8.10
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/validate.rb +7 -1
- data/lib/bashly/config_validator.rb +6 -1
- data/lib/bashly/script/command.rb +8 -2
- data/lib/bashly/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93a8d1b32e641bee6713b57ed0cd3e970c8806273f02f900909553dd391d5b43
|
4
|
+
data.tar.gz: 4024323aa10f725b947d9b59c4019724bd26a58945ff1436102d57130a677442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81a26b1e7eb07c45f596db2b3f787af3580cfdc9be9490b7b361670decdf582b3eeb996a889f8409631ea4f9470cb81812d73655727189844b833849e543bbb5
|
7
|
+
data.tar.gz: 3d52eb5364d947bfe5e8a9e3efa626d10da75ddd68f1dff3c279aca4f830f4ef52e17b6b65a95f2b4dfcba1927fecbcc5c9445d6f0e02dc472834f48bcb9284e
|
@@ -3,12 +3,18 @@ module Bashly
|
|
3
3
|
class Validate < Base
|
4
4
|
help "Scan the configuration file for errors"
|
5
5
|
|
6
|
-
usage "bashly validate"
|
6
|
+
usage "bashly validate [--verbose]"
|
7
7
|
usage "bashly validate (-h|--help)"
|
8
8
|
|
9
|
+
option "-v --verbose", "Show the bashly configuration file prior to validating. This is useful when using split config (import) since it will show the final compiled configuration."
|
10
|
+
|
9
11
|
environment "BASHLY_SOURCE_DIR", "The path containing the bashly configuration and source files [default: src]"
|
10
12
|
|
11
13
|
def run
|
14
|
+
if args['--verbose']
|
15
|
+
lp config
|
16
|
+
puts "---"
|
17
|
+
end
|
12
18
|
validate_config
|
13
19
|
show_deprecations
|
14
20
|
deprecations = config_validator.deprecations
|
@@ -119,6 +119,7 @@ module Bashly
|
|
119
119
|
assert_optional_string "#{key}.footer", value['footer']
|
120
120
|
assert_optional_string "#{key}.group", value['group']
|
121
121
|
assert_optional_string "#{key}.filename", value['filename']
|
122
|
+
assert_optional_string "#{key}.function", value['function']
|
122
123
|
|
123
124
|
assert_boolean "#{key}.private", value['private']
|
124
125
|
assert_boolean "#{key}.default", value['default']
|
@@ -126,6 +127,7 @@ module Bashly
|
|
126
127
|
assert_version "#{key}.version", value['version']
|
127
128
|
assert_catch_all "#{key}.catch_all", value['catch_all']
|
128
129
|
assert_string_or_array "#{key}.alias", value['alias']
|
130
|
+
assert_string_or_array "#{key}.examples", value['examples']
|
129
131
|
assert_extensible "#{key}.extensible", value['extensible']
|
130
132
|
|
131
133
|
assert_array "#{key}.args", value['args'], of: :arg
|
@@ -135,13 +137,16 @@ module Bashly
|
|
135
137
|
assert_array "#{key}.dependencies", value['dependencies'], of: :string
|
136
138
|
assert_array "#{key}.filters", value['filters'], of: :string
|
137
139
|
assert_array "#{key}.environment_variables", value['environment_variables'], of: :env_var
|
138
|
-
assert_array "#{key}.examples", value['examples'], of: :string
|
139
140
|
|
140
141
|
assert_uniq "#{key}.commands", value['commands'], ['name', 'alias']
|
141
142
|
assert_uniq "#{key}.flags", value['flags'], 'long'
|
142
143
|
assert_uniq "#{key}.flags", value['flags'], 'short'
|
143
144
|
assert_uniq "#{key}.args", value['args'], 'name'
|
144
145
|
|
146
|
+
if value['function']
|
147
|
+
assert value['function'].match(/^[a-z0-9_]+$/), "#{key}.function must contain lowercase alphanumeric characters and underscores only"
|
148
|
+
end
|
149
|
+
|
145
150
|
if value['default']
|
146
151
|
assert value['args'], "#{key}.default makes no sense without args"
|
147
152
|
end
|
@@ -9,7 +9,7 @@ module Bashly
|
|
9
9
|
alias args catch_all commands completions
|
10
10
|
default dependencies environment_variables examples
|
11
11
|
extensible expose filename filters flags
|
12
|
-
footer group help name
|
12
|
+
footer function group help name
|
13
13
|
private version
|
14
14
|
short
|
15
15
|
]
|
@@ -152,6 +152,12 @@ module Bashly
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
# Returns an array of examples
|
156
|
+
def examples
|
157
|
+
return nil unless options["examples"]
|
158
|
+
options["examples"].is_a?(Array) ? options['examples'] : [options['examples']]
|
159
|
+
end
|
160
|
+
|
155
161
|
# Returns the bash filename that is expected to hold the user code
|
156
162
|
# for this command
|
157
163
|
def filename
|
@@ -168,7 +174,7 @@ module Bashly
|
|
168
174
|
|
169
175
|
# Returns a unique name, suitable to be used in a bash function
|
170
176
|
def function_name
|
171
|
-
full_name.to_underscore
|
177
|
+
options['function'] || full_name.to_underscore
|
172
178
|
end
|
173
179
|
|
174
180
|
# Returns the name of the command, including its parent name (in case
|
data/lib/bashly/version.rb
CHANGED
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: 0.8.
|
4
|
+
version: 0.8.10
|
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-
|
11
|
+
date: 2022-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: completely
|
@@ -53,21 +53,21 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.7'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: filewatcher
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '2.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: lp
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
@@ -81,19 +81,33 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: mister_bin
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0.7'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0.7'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: requires
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.2'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.2'
|
97
111
|
description: Generate bash command line tools using YAML configuration
|
98
112
|
email: db@dannyben.com
|
99
113
|
executables:
|