markdown_exec 1.2.0 → 1.3.0
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/.reek +3 -1
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +61 -0
- data/Gemfile.lock +1 -1
- data/README.md +25 -4
- data/Rakefile +450 -16
- data/bin/tab_completion.sh +13 -41
- data/lib/globfiles.rb +40 -0
- data/lib/markdown_exec/version.rb +3 -1
- data/lib/markdown_exec.rb +255 -529
- data/lib/menu.yml +293 -0
- data/lib/shared.rb +21 -0
- data/lib/tap.rb +13 -7
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f3c0e2ecc6da4fa81adc0876e9f37180204935fd1b666abccd7584145922d98
|
4
|
+
data.tar.gz: 74534fa3b85c76447dbca1affea96bb31c566826edb6484acfeb14af9ce24de7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48c7a83d8bb1c00f947c87fc9de2c316371e538f7fb4637df0f0a58cb2385cb682e0ba65cdfd9e32f04ba5942022b50baa91dd20db17baa68162c8b531c35ab4
|
7
|
+
data.tar.gz: 1b343974fb86e0ff9a9775d50663ae37ccd3919d047cb9efa4291fd2d7b7fbd7b3f72325965949a11c4c999f2fba1167098452a4a52d1cd0dfd707fdabced800
|
data/.reek
CHANGED
@@ -11,7 +11,7 @@ detectors:
|
|
11
11
|
ControlParameter:
|
12
12
|
enabled: true
|
13
13
|
DuplicateMethodCall:
|
14
|
-
enabled:
|
14
|
+
enabled: false # too strict
|
15
15
|
FeatureEnvy:
|
16
16
|
enabled: false # too strict
|
17
17
|
InstanceVariableAssumption:
|
@@ -22,3 +22,5 @@ detectors:
|
|
22
22
|
enabled: true
|
23
23
|
LongYieldList:
|
24
24
|
enabled: true
|
25
|
+
TooManyStatements:
|
26
|
+
enabled: false # too strict
|
data/.rubocop.yml
CHANGED
@@ -6,6 +6,9 @@ AllCops:
|
|
6
6
|
NewCops: enable
|
7
7
|
TargetRubyVersion: 2.6
|
8
8
|
|
9
|
+
Lint/SafeNavigationChain:
|
10
|
+
Enabled: false
|
11
|
+
|
9
12
|
Metrics/AbcSize:
|
10
13
|
Enabled: false
|
11
14
|
|
@@ -30,9 +33,24 @@ Metrics/MethodLength:
|
|
30
33
|
Metrics/PerceivedComplexity:
|
31
34
|
Enabled: false
|
32
35
|
|
36
|
+
Minitest/MultipleAssertions:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Security/YAMLLoad:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/CommentedKeyword:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/DoubleNegation:
|
46
|
+
Enabled: false
|
47
|
+
|
33
48
|
Style/GlobalVars:
|
34
49
|
Enabled: false
|
35
50
|
|
51
|
+
Style/MixinUsage:
|
52
|
+
Enabled: false
|
53
|
+
|
36
54
|
Style/MultilineBlockChain:
|
37
55
|
Enabled: false
|
38
56
|
|
data/CHANGELOG.md
CHANGED
@@ -39,6 +39,67 @@
|
|
39
39
|
- [ ] ren logged_stdout_filename_prefix to saved_stdout_filename_prefix
|
40
40
|
- [ ] ignore '#' in fenced code blocks
|
41
41
|
|
42
|
+
- [ ] write named block, can be included
|
43
|
+
- [ ] file type per block type
|
44
|
+
- [ ] file name per block name or specified in quotes ("")
|
45
|
+
- [ ] overwrite-rules for writing blocks
|
46
|
+
- [ ] erase-rules for written blocks
|
47
|
+
- [ ] files to create named at top of script to execute; written prior to start of script
|
48
|
+
|
49
|
+
- [ ] tab completion example ascii demo
|
50
|
+
|
51
|
+
- [ ] reorder help list
|
52
|
+
|
53
|
+
- [ ] parameters or (env vars) in menu
|
54
|
+
- [ ] config menu or read env vars
|
55
|
+
- [ ] enable/disable script, output saving per file
|
56
|
+
- [ ] keep values between runs so same env vars are not prompted
|
57
|
+
- [ ] move menu data to required file
|
58
|
+
|
59
|
+
- [ ] tab complation for short option names
|
60
|
+
|
61
|
+
- [ ] option to list full menu
|
62
|
+
|
63
|
+
- [ ] task confirmation block option or bash template, env names
|
64
|
+
- [ ] decoration for menu heading items, template?
|
65
|
+
- [ ] configuration block `mde_config` anywhere in file
|
66
|
+
- [ ] configuration block `mde_config` anywhere in folder config file
|
67
|
+
```yaml :(mde_config)```
|
68
|
+
- [x] fix execution stdin, stdout to allow for ask function
|
69
|
+
- [ ] fix execution stdin, stdout to allow for tty-prompt
|
70
|
+
|
71
|
+
## [1.3.0] - 2022-07-16
|
72
|
+
|
73
|
+
### Added
|
74
|
+
|
75
|
+
- Short name `-p` for `--user-must-approve` option
|
76
|
+
Enable/disable pause for user to review and approve script
|
77
|
+
- Automatic wrapping for data in blocks of yaml data eg ` ```yaml `
|
78
|
+
Data is written to the file named in the fenced block heading
|
79
|
+
- Data transformations are embedded in the script at every invocation
|
80
|
+
with arguments to the transformation as stdin and stdout for the `yq` process
|
81
|
+
eg `export fruit_summary=$(yq e '[.fruit.name,.fruit.price]' fruit.yml)`
|
82
|
+
for invocation `%(summarize_fruits <fruit.yml >fruit_summary)`
|
83
|
+
and transformation `[.fruit.name,.fruit.price]`
|
84
|
+
- Option to extract document text and display it as disabled items in-line with the blocks in the selection menu.
|
85
|
+
Add options for constants used in parsing.
|
86
|
+
- [x] yaml processing
|
87
|
+
- ```yaml :(make_fruit_file) >fruit.yml```
|
88
|
+
write to: fruit.yml
|
89
|
+
- ```yq [summarize_fruits] +(make_fruit_file) <fruit.yml =color_price```
|
90
|
+
not included in linear script
|
91
|
+
read from: fruit.yml
|
92
|
+
result into var: color_price instead of stdout
|
93
|
+
- ```bash :show_fruit_yml +(summarize_fruits)```
|
94
|
+
include summarize_fruits
|
95
|
+
output value of var color_price
|
96
|
+
|
97
|
+
### Changed
|
98
|
+
|
99
|
+
- Refactoring
|
100
|
+
- Run-time menu in YAML file.
|
101
|
+
- Tap module initialization
|
102
|
+
|
42
103
|
## [1.2.0] - 2022-06-11
|
43
104
|
|
44
105
|
### Added
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -49,7 +49,7 @@ Displays help information.
|
|
49
49
|
|
50
50
|
#### `mde`
|
51
51
|
|
52
|
-
Process `README.md` file in the current folder. Displays all the blocks in the file and allows you to select using [up], [down], and [return].
|
52
|
+
Process `README.md` file in the current folder. Displays all the blocks in the file and allows you to select using [up], [down], and [return].
|
53
53
|
|
54
54
|
#### `mde my.md` or `mde -f my.md`
|
55
55
|
|
@@ -159,7 +159,7 @@ echo "source $(mde --pwd)/bin/tab_completion.sh" >> ~/.bash_profile
|
|
159
159
|
### Behavior
|
160
160
|
|
161
161
|
Press tab for completions appropriate to the current input.
|
162
|
-
`mde <...> <prior word> <current word>`
|
162
|
+
`mde <...> <prior word> <current word><TAB>`
|
163
163
|
|
164
164
|
Completions are calculated based on the current word and the prior word.
|
165
165
|
1. If the current word starts with `-`, present matching options, eg `--version` for the current word `--v`.
|
@@ -171,7 +171,7 @@ Completions are calculated based on the current word and the prior word.
|
|
171
171
|
|
172
172
|
In the table below, tab is indicated by `!`
|
173
173
|
| Input | Completions |
|
174
|
-
|
|
174
|
+
| :--- | :--- |
|
175
175
|
| `mde !` | local files and folders |
|
176
176
|
| `mde -!` | all options |
|
177
177
|
| `mde --!` | all options |
|
@@ -213,4 +213,25 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
213
213
|
|
214
214
|
# Code of Conduct
|
215
215
|
|
216
|
-
Everyone interacting in the MarkdownExec project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
216
|
+
Everyone interacting in the MarkdownExec project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fareedst/markdown_exec/blob/master/CODE_OF_CONDUCT.md).
|
217
|
+
|
218
|
+
|
219
|
+
``` :test_vars +(echo_vars)
|
220
|
+
vars1=$(
|
221
|
+
echo '1'
|
222
|
+
whoami
|
223
|
+
echo '2'
|
224
|
+
pwd
|
225
|
+
echo '3'
|
226
|
+
stat README.md
|
227
|
+
echo '4'
|
228
|
+
/bin/ls
|
229
|
+
echo '5'
|
230
|
+
whoami
|
231
|
+
echo '6'
|
232
|
+
)
|
233
|
+
```
|
234
|
+
|
235
|
+
``` :(echo_vars)
|
236
|
+
echo "vars1: ${vars1:-missing}"
|
237
|
+
```
|