bashly 1.1.0 → 1.1.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/libraries/ini/ini.sh +1 -0
- data/lib/bashly/libraries/render/mandoc/README.md +18 -0
- data/lib/bashly/libraries/render/mandoc/mandoc.gtx +10 -5
- data/lib/bashly/libraries/test/approvals.bash +9 -1
- data/lib/bashly/library_source.rb +2 -1
- data/lib/bashly/library_source_config.rb +48 -0
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa90db9009d993d431fb953ef48a36ea467cc1c050f679662ff07d0d1d1a7ef4
|
4
|
+
data.tar.gz: 12f338a3a26ca15cc4348bea85a224ba9912c0b5b4b9069d36cde356a5d05a11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d869adeb7b3cb568d35298b1bda904deda5ec70b08ef1fcaf79c9d2ed7eee14bc019d339f9ec333e1c761dc780e1ffe227a19931aadf69fcf128ec5dc2684f
|
7
|
+
data.tar.gz: 515ea7cca14d880a3add63ff3f1a959f9bea9e419532526737ef119c078c4644ca0efab2935c080ebddefdd804e4759eddba0c2b0dff6cccd8daa7b9a6e6a541
|
@@ -43,3 +43,21 @@ Add an authors string to your man pages.
|
|
43
43
|
```yaml
|
44
44
|
x_mandoc_authors: Lana Lang
|
45
45
|
```
|
46
|
+
|
47
|
+
### See Also: `x_mandoc_see_also`
|
48
|
+
|
49
|
+
Adds additional pages to the `SEE ALSO` section, in addition to the
|
50
|
+
pages that are added automatically (like the parent command, and
|
51
|
+
sub commands).
|
52
|
+
|
53
|
+
This property should be an array of strings. You can optionally add
|
54
|
+
a section number in parentheses. If not provided, `(1)` will be used
|
55
|
+
as default.
|
56
|
+
|
57
|
+
#### Example
|
58
|
+
|
59
|
+
```yaml
|
60
|
+
x_mandoc_see_also:
|
61
|
+
- docker
|
62
|
+
- docker-compose.yml(5)
|
63
|
+
```
|
@@ -181,14 +181,19 @@ if examples
|
|
181
181
|
>
|
182
182
|
end
|
183
183
|
|
184
|
-
|
184
|
+
see_also = []
|
185
|
+
see_also << parents.first if parents.any?
|
186
|
+
see_also += public_commands.map { |x| x.full_name.to_hyphen } if public_commands.any?
|
187
|
+
see_also += x_mandoc_see_also if x_mandoc_see_also && x_mandoc_see_also.is_a?(Array)
|
188
|
+
see_also.map! do |item|
|
189
|
+
item.match(/(.+)(\(\d\))/) ? "**#{$1}**#{$2}" : "**#{item}**(1)"
|
190
|
+
end
|
191
|
+
|
192
|
+
if see_also.any?
|
185
193
|
> SEE ALSO
|
186
194
|
> ==================================================
|
187
195
|
>
|
188
|
-
|
189
|
-
> **{{ parents.first }}**(1)
|
190
|
-
end
|
191
|
-
= public_commands.map { |x| "**#{x.full_name.to_hyphen}**(1)" }.join ', '
|
196
|
+
= see_also.join ', '
|
192
197
|
>
|
193
198
|
end
|
194
199
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# approvals.bash v0.
|
1
|
+
# approvals.bash v0.4.0
|
2
2
|
#
|
3
3
|
# Interactive approval testing for Bash.
|
4
4
|
# https://github.com/DannyBen/approvals.bash
|
@@ -9,6 +9,10 @@ approve() {
|
|
9
9
|
cmd=$1
|
10
10
|
last_exit_code=0
|
11
11
|
actual=$(eval "$cmd" 2>&1) || last_exit_code=$?
|
12
|
+
if [[ "$allow_diff_regex" ]]; then
|
13
|
+
actual=$(echo "$actual" | sed "s/$allow_diff_regex/*/g")
|
14
|
+
unset allow_diff_regex
|
15
|
+
fi
|
12
16
|
approval=$(printf "%b" "$cmd" | tr -s -c "[:alnum:]" _)
|
13
17
|
approval_file="$approvals_dir/${2:-"$approval"}"
|
14
18
|
|
@@ -35,6 +39,10 @@ approve() {
|
|
35
39
|
fi
|
36
40
|
}
|
37
41
|
|
42
|
+
allow_diff() {
|
43
|
+
allow_diff_regex="$1"
|
44
|
+
}
|
45
|
+
|
38
46
|
describe() {
|
39
47
|
echo
|
40
48
|
blue "= $*"
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'tmpdir'
|
2
3
|
|
3
4
|
module Bashly
|
4
5
|
class LibrarySource
|
@@ -14,7 +15,7 @@ module Bashly
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def config
|
17
|
-
@config ||=
|
18
|
+
@config ||= LibrarySourceConfig.new(config_path).validated_data
|
18
19
|
end
|
19
20
|
|
20
21
|
def libraries
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Bashly
|
2
|
+
class LibrarySourceConfig
|
3
|
+
include ValidationHelpers
|
4
|
+
|
5
|
+
attr_reader :path
|
6
|
+
|
7
|
+
def initialize(path)
|
8
|
+
@path = path
|
9
|
+
end
|
10
|
+
|
11
|
+
def data
|
12
|
+
@data ||= YAML.load_file path
|
13
|
+
end
|
14
|
+
|
15
|
+
def validated_data
|
16
|
+
validate
|
17
|
+
data
|
18
|
+
end
|
19
|
+
|
20
|
+
def validate
|
21
|
+
assert_root path, data
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def assert_root(path, value)
|
27
|
+
assert_hash path, value
|
28
|
+
data.each { |id, spec| assert_lib "[#{path}] #{id}", spec }
|
29
|
+
end
|
30
|
+
|
31
|
+
def assert_lib(key, value)
|
32
|
+
assert_string "#{key}.help", value['help']
|
33
|
+
|
34
|
+
assert_optional_string "#{key}.usage", value['usage']
|
35
|
+
assert_optional_string "#{key}.handler", value['handler']
|
36
|
+
assert_optional_string "#{key}.post_install_message", value['post_install_message']
|
37
|
+
|
38
|
+
return if value['handler']
|
39
|
+
|
40
|
+
assert_array "#{key}.files", value['files'], of: :filespec
|
41
|
+
end
|
42
|
+
|
43
|
+
def assert_filespec(key, value)
|
44
|
+
assert_string "#{key}.source", value['source']
|
45
|
+
assert_string "#{key}.target", value['target']
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/bashly/version.rb
CHANGED
data/lib/bashly.rb
CHANGED
@@ -15,6 +15,7 @@ module Bashly
|
|
15
15
|
autoload :ConfigValidator, 'bashly/config_validator'
|
16
16
|
autoload :Library, 'bashly/library'
|
17
17
|
autoload :LibrarySource, 'bashly/library_source'
|
18
|
+
autoload :LibrarySourceConfig, 'bashly/library_source_config'
|
18
19
|
autoload :MessageStrings, 'bashly/message_strings'
|
19
20
|
autoload :RenderContext, 'bashly/render_context'
|
20
21
|
autoload :RenderSource, 'bashly/render_source'
|
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.1.
|
4
|
+
version: 1.1.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: 2023-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -207,6 +207,7 @@ files:
|
|
207
207
|
- lib/bashly/libraries/yaml/yaml.sh
|
208
208
|
- lib/bashly/library.rb
|
209
209
|
- lib/bashly/library_source.rb
|
210
|
+
- lib/bashly/library_source_config.rb
|
210
211
|
- lib/bashly/message_strings.rb
|
211
212
|
- lib/bashly/refinements/compose_refinements.rb
|
212
213
|
- lib/bashly/render_context.rb
|