markdown_exec 1.3.1 → 1.3.3.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/.rubocop.yml +21 -4
- data/CHANGELOG.md +45 -1
- data/Gemfile +8 -5
- data/Gemfile.lock +125 -29
- data/README.md +5 -80
- data/Rakefile +108 -24
- data/bin/tab_completion.sh +2 -2
- data/lib/cached_nested_file_reader.rb +115 -0
- data/lib/colorize.rb +4 -0
- data/lib/env.rb +8 -3
- data/lib/env_opts.rb +242 -0
- data/lib/environment_opt_parse.rb +28 -19
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/markdown_exec.rb +593 -281
- data/lib/menu.yml +70 -4
- data/lib/object_present.rb +44 -1
- data/lib/rspec_helpers.rb +10 -0
- data/lib/tap.rb +81 -17
- metadata +5 -3
- data/lib/globfiles.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54b0269e09acf58585ba9e30e71c8aef641c2adda1f55aac5fadfb303afa43fe
|
4
|
+
data.tar.gz: ca8f09facf7e219efd019c68fb5a64f542f41be4129b09733dcbb58f10ef6373
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4844da82d7ab3ba8a891bb3848f5594ba027dedc5a33c868fdf0bbde031e66cff117b521f013320db2de7f603b9c09d368bfe5e9d1a76687f2a2876f9306dc
|
7
|
+
data.tar.gz: be5f232e7a5e35ceeae3e1414d1296a9172706151ae5f86ad297c4ef97dacc0dd78bb7b1e7b9056849dac11302568419caca71ede0afaaa8abfc06379b0f640b
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-minitest
|
3
3
|
- rubocop-rake
|
4
|
+
- rubocop-rspec
|
4
5
|
|
5
6
|
AllCops:
|
6
7
|
NewCops: enable
|
@@ -9,6 +10,16 @@ AllCops:
|
|
9
10
|
Layout/LeadingCommentSpace:
|
10
11
|
Enabled: false
|
11
12
|
|
13
|
+
Layout/LineContinuationLeadingSpace:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Layout/LineLength:
|
17
|
+
Max: 96
|
18
|
+
# Max: 120
|
19
|
+
|
20
|
+
Lint/Debugger:
|
21
|
+
Enabled: false
|
22
|
+
|
12
23
|
Lint/SafeNavigationChain:
|
13
24
|
Enabled: false
|
14
25
|
|
@@ -38,7 +49,10 @@ Metrics/PerceivedComplexity:
|
|
38
49
|
|
39
50
|
Minitest/MultipleAssertions:
|
40
51
|
Enabled: false
|
41
|
-
|
52
|
+
|
53
|
+
Naming/RescuedExceptionsVariableName:
|
54
|
+
PreferredName: err
|
55
|
+
|
42
56
|
Security/YAMLLoad:
|
43
57
|
Enabled: false
|
44
58
|
|
@@ -48,6 +62,9 @@ Style/CommentedKeyword:
|
|
48
62
|
Style/DoubleNegation:
|
49
63
|
Enabled: false
|
50
64
|
|
65
|
+
Style/EmptyElse:
|
66
|
+
Enabled: false
|
67
|
+
|
51
68
|
Style/GlobalVars:
|
52
69
|
Enabled: false
|
53
70
|
|
@@ -57,6 +74,9 @@ Style/MixinUsage:
|
|
57
74
|
Style/MultilineBlockChain:
|
58
75
|
Enabled: false
|
59
76
|
|
77
|
+
Style/SlicingWithRange:
|
78
|
+
Enabled: false
|
79
|
+
|
60
80
|
Style/StringLiterals:
|
61
81
|
Enabled: true
|
62
82
|
EnforcedStyle: single_quotes
|
@@ -64,6 +84,3 @@ Style/StringLiterals:
|
|
64
84
|
Style/StringLiteralsInInterpolation:
|
65
85
|
Enabled: true
|
66
86
|
EnforcedStyle: single_quotes
|
67
|
-
|
68
|
-
Layout/LineLength:
|
69
|
-
Max: 120
|
data/CHANGELOG.md
CHANGED
@@ -76,7 +76,51 @@
|
|
76
76
|
- [! ] search for document in custom path
|
77
77
|
- [ ] doc use of `#!/usr/bin/env mde`
|
78
78
|
- [ ] command to export each command to file, menu for list
|
79
|
-
|
79
|
+
|
80
|
+
- [ ] option blocks to exclude by shell
|
81
|
+
|
82
|
+
- #+BEGIN_SRC sh :results silent
|
83
|
+
#+END_SRC
|
84
|
+
|
85
|
+
- [ ] requires extra CRs after ctrl-C of earlier script?
|
86
|
+
|
87
|
+
- [! ] silent for `mde file block -q 0`
|
88
|
+
- [! ] define for block: env var name, prompt if missing, default value
|
89
|
+
- [! ] display env vars in menu
|
90
|
+
- [! ] mde md -- --arg1 --arg2
|
91
|
+
|
92
|
+
- [! ] display tasks (regex) similar to current `:::`
|
93
|
+
diff done, tbd, important, progress, note, timestamp
|
94
|
+
|
95
|
+
- [! ] redo block selection logic in
|
96
|
+
def self.fcb_select?(options, fcb)
|
97
|
+
used for selecting for 1) menu, 2) script composition, 3) list?
|
98
|
+
layers 1) block name in cli, 2) required blocks, 3) hidden, 4) selected, 5) excluded, 6) also per shell name
|
99
|
+
- [ ] opt to add block name as comment in bash script
|
100
|
+
- [ ] marker in file separating VARS from CODE in bash script
|
101
|
+
[ ] VARS, CODE section separately sourceable/executable
|
102
|
+
- [ ] config to hide unnamed bash blocks
|
103
|
+
- [ ] default to No after Save of script
|
104
|
+
|
105
|
+
- [ ] block into file; template
|
106
|
+
|
107
|
+
- [! ] option to use most recent named block if dupiclate, currently appends same-name blocks but lists twice in menu
|
108
|
+
|
109
|
+
## [1.3.3] - 2023-10-03
|
110
|
+
|
111
|
+
### Added
|
112
|
+
|
113
|
+
- Nest scripts by using an `import` directive.
|
114
|
+
|
115
|
+
### Changed
|
116
|
+
|
117
|
+
- Convert constants for block selection into options.
|
118
|
+
|
119
|
+
## [1.3.2] - 2022-11-12
|
120
|
+
|
121
|
+
### Added
|
122
|
+
|
123
|
+
- Add RSpec tests for internal classes
|
80
124
|
|
81
125
|
## [1.3.1] - 2022-10-29
|
82
126
|
|
data/Gemfile
CHANGED
@@ -8,14 +8,17 @@ source 'https://rubygems.org'
|
|
8
8
|
gemspec
|
9
9
|
gem 'clipboard'
|
10
10
|
gem 'erb'
|
11
|
-
gem 'minitest',
|
12
|
-
gem '
|
11
|
+
gem 'minitest', require: false
|
12
|
+
gem 'pry-nav'
|
13
|
+
gem 'pry-stack_explorer'
|
14
|
+
gem 'railties'
|
15
|
+
gem 'rake'
|
13
16
|
gem 'reek'
|
14
|
-
|
15
|
-
gem 'rubocop'
|
17
|
+
gem 'rspec'
|
18
|
+
gem 'rubocop'
|
16
19
|
gem 'rubocop-minitest', require: false
|
17
20
|
gem 'rubocop-rake', require: false
|
18
|
-
|
21
|
+
gem 'rubocop-rspec', require: false
|
19
22
|
gem 'shellwords'
|
20
23
|
gem 'uri'
|
21
24
|
gem 'yaml'
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
markdown_exec (1.3.1)
|
4
|
+
markdown_exec (1.3.3.1)
|
5
5
|
clipboard (~> 1.3.6)
|
6
6
|
open3 (~> 0.1.1)
|
7
7
|
optparse (~> 0.1.1)
|
@@ -11,47 +11,135 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
+
actionpack (7.0.8)
|
15
|
+
actionview (= 7.0.8)
|
16
|
+
activesupport (= 7.0.8)
|
17
|
+
rack (~> 2.0, >= 2.2.4)
|
18
|
+
rack-test (>= 0.6.3)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
21
|
+
actionview (7.0.8)
|
22
|
+
activesupport (= 7.0.8)
|
23
|
+
builder (~> 3.1)
|
24
|
+
erubi (~> 1.4)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
27
|
+
activesupport (7.0.8)
|
28
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
29
|
+
i18n (>= 1.6, < 2)
|
30
|
+
minitest (>= 5.1)
|
31
|
+
tzinfo (~> 2.0)
|
14
32
|
ast (2.4.2)
|
15
|
-
|
33
|
+
base64 (0.1.1)
|
34
|
+
binding_of_caller (1.0.0)
|
35
|
+
debug_inspector (>= 0.0.1)
|
36
|
+
builder (3.2.4)
|
37
|
+
cgi (0.3.6)
|
16
38
|
clipboard (1.3.6)
|
17
|
-
|
18
|
-
|
19
|
-
|
39
|
+
coderay (1.1.3)
|
40
|
+
concurrent-ruby (1.2.2)
|
41
|
+
crass (1.0.6)
|
42
|
+
debug_inspector (1.1.0)
|
43
|
+
diff-lcs (1.5.0)
|
44
|
+
erb (4.0.3)
|
45
|
+
cgi (>= 0.3.3)
|
46
|
+
erubi (1.12.0)
|
47
|
+
i18n (1.14.1)
|
48
|
+
concurrent-ruby (~> 1.0)
|
49
|
+
json (2.6.3)
|
20
50
|
kwalify (0.7.2)
|
21
|
-
|
22
|
-
|
51
|
+
language_server-protocol (3.17.0.3)
|
52
|
+
loofah (2.21.3)
|
53
|
+
crass (~> 1.0.2)
|
54
|
+
nokogiri (>= 1.12.0)
|
55
|
+
method_source (1.0.0)
|
56
|
+
minitest (5.20.0)
|
57
|
+
nokogiri (1.15.4-arm64-darwin)
|
58
|
+
racc (~> 1.4)
|
59
|
+
open3 (0.1.2)
|
23
60
|
optparse (0.1.1)
|
24
|
-
parallel (1.
|
25
|
-
parser (3.
|
61
|
+
parallel (1.23.0)
|
62
|
+
parser (3.2.2.3)
|
26
63
|
ast (~> 2.4.1)
|
64
|
+
racc
|
27
65
|
pastel (0.8.0)
|
28
66
|
tty-color (~> 0.5)
|
67
|
+
pry (0.14.2)
|
68
|
+
coderay (~> 1.1)
|
69
|
+
method_source (~> 1.0)
|
70
|
+
pry-nav (1.0.0)
|
71
|
+
pry (>= 0.9.10, < 0.15)
|
72
|
+
pry-stack_explorer (0.6.1)
|
73
|
+
binding_of_caller (~> 1.0)
|
74
|
+
pry (~> 0.13)
|
75
|
+
racc (1.7.1)
|
76
|
+
rack (2.2.8)
|
77
|
+
rack-test (2.1.0)
|
78
|
+
rack (>= 1.3)
|
79
|
+
rails-dom-testing (2.2.0)
|
80
|
+
activesupport (>= 5.0.0)
|
81
|
+
minitest
|
82
|
+
nokogiri (>= 1.6)
|
83
|
+
rails-html-sanitizer (1.6.0)
|
84
|
+
loofah (~> 2.21)
|
85
|
+
nokogiri (~> 1.14)
|
86
|
+
railties (7.0.8)
|
87
|
+
actionpack (= 7.0.8)
|
88
|
+
activesupport (= 7.0.8)
|
89
|
+
method_source
|
90
|
+
rake (>= 12.2)
|
91
|
+
thor (~> 1.0)
|
92
|
+
zeitwerk (~> 2.5)
|
29
93
|
rainbow (3.1.1)
|
30
94
|
rake (13.0.6)
|
31
|
-
reek (6.1.
|
95
|
+
reek (6.1.4)
|
32
96
|
kwalify (~> 0.7.0)
|
33
|
-
parser (~> 3.
|
97
|
+
parser (~> 3.2.0)
|
34
98
|
rainbow (>= 2.0, < 4.0)
|
35
|
-
regexp_parser (2.
|
36
|
-
rexml (3.2.
|
37
|
-
|
99
|
+
regexp_parser (2.8.1)
|
100
|
+
rexml (3.2.6)
|
101
|
+
rspec (3.12.0)
|
102
|
+
rspec-core (~> 3.12.0)
|
103
|
+
rspec-expectations (~> 3.12.0)
|
104
|
+
rspec-mocks (~> 3.12.0)
|
105
|
+
rspec-core (3.12.2)
|
106
|
+
rspec-support (~> 3.12.0)
|
107
|
+
rspec-expectations (3.12.3)
|
108
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
109
|
+
rspec-support (~> 3.12.0)
|
110
|
+
rspec-mocks (3.12.6)
|
111
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
112
|
+
rspec-support (~> 3.12.0)
|
113
|
+
rspec-support (3.12.1)
|
114
|
+
rubocop (1.56.4)
|
115
|
+
base64 (~> 0.1.1)
|
38
116
|
json (~> 2.3)
|
117
|
+
language_server-protocol (>= 3.17.0)
|
39
118
|
parallel (~> 1.10)
|
40
|
-
parser (>= 3.
|
119
|
+
parser (>= 3.2.2.3)
|
41
120
|
rainbow (>= 2.2.2, < 4.0)
|
42
121
|
regexp_parser (>= 1.8, < 3.0)
|
43
122
|
rexml (>= 3.2.5, < 4.0)
|
44
|
-
rubocop-ast (>= 1.
|
123
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
45
124
|
ruby-progressbar (~> 1.7)
|
46
|
-
unicode-display_width (>=
|
47
|
-
rubocop-ast (1.
|
48
|
-
parser (>= 3.
|
49
|
-
rubocop-
|
50
|
-
rubocop (
|
125
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
126
|
+
rubocop-ast (1.29.0)
|
127
|
+
parser (>= 3.2.1.0)
|
128
|
+
rubocop-capybara (2.19.0)
|
129
|
+
rubocop (~> 1.41)
|
130
|
+
rubocop-factory_bot (2.24.0)
|
131
|
+
rubocop (~> 1.33)
|
132
|
+
rubocop-minitest (0.32.2)
|
133
|
+
rubocop (>= 1.39, < 2.0)
|
51
134
|
rubocop-rake (0.6.0)
|
52
135
|
rubocop (~> 1.0)
|
53
|
-
|
136
|
+
rubocop-rspec (2.24.1)
|
137
|
+
rubocop (~> 1.33)
|
138
|
+
rubocop-capybara (~> 2.17)
|
139
|
+
rubocop-factory_bot (~> 2.22)
|
140
|
+
ruby-progressbar (1.13.0)
|
54
141
|
shellwords (0.1.0)
|
142
|
+
thor (1.2.2)
|
55
143
|
tty-color (0.6.0)
|
56
144
|
tty-cursor (0.7.1)
|
57
145
|
tty-prompt (0.23.1)
|
@@ -62,10 +150,13 @@ GEM
|
|
62
150
|
tty-screen (~> 0.8)
|
63
151
|
wisper (~> 2.0)
|
64
152
|
tty-screen (0.8.1)
|
65
|
-
|
66
|
-
|
153
|
+
tzinfo (2.0.6)
|
154
|
+
concurrent-ruby (~> 1.0)
|
155
|
+
unicode-display_width (2.5.0)
|
156
|
+
uri (0.12.2)
|
67
157
|
wisper (2.0.1)
|
68
|
-
yaml (0.2.
|
158
|
+
yaml (0.2.1)
|
159
|
+
zeitwerk (2.6.12)
|
69
160
|
|
70
161
|
PLATFORMS
|
71
162
|
arm64-darwin-21
|
@@ -74,15 +165,20 @@ DEPENDENCIES
|
|
74
165
|
clipboard
|
75
166
|
erb
|
76
167
|
markdown_exec!
|
77
|
-
minitest
|
78
|
-
|
168
|
+
minitest
|
169
|
+
pry-nav
|
170
|
+
pry-stack_explorer
|
171
|
+
railties
|
172
|
+
rake
|
79
173
|
reek
|
80
|
-
|
174
|
+
rspec
|
175
|
+
rubocop
|
81
176
|
rubocop-minitest
|
82
177
|
rubocop-rake
|
178
|
+
rubocop-rspec
|
83
179
|
shellwords
|
84
180
|
uri
|
85
181
|
yaml
|
86
182
|
|
87
183
|
BUNDLED WITH
|
88
|
-
2.
|
184
|
+
2.4.13
|
data/README.md
CHANGED
@@ -203,9 +203,11 @@ export ACTIVITY=asleep
|
|
203
203
|
echo "$TIME -> $ACTIVITY"
|
204
204
|
```
|
205
205
|
|
206
|
-
|
207
|
-
|
208
|
-
|
206
|
+
# Testing
|
207
|
+
|
208
|
+
Execute tests for individual libraries.
|
209
|
+
|
210
|
+
`bundle exec rake minitest`
|
209
211
|
|
210
212
|
# License
|
211
213
|
|
@@ -214,80 +216,3 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
214
216
|
# Code of Conduct
|
215
217
|
|
216
218
|
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
|
-
```
|
238
|
-
|
239
|
-
```bash :test_quick
|
240
|
-
cat README.md
|
241
|
-
```
|
242
|
-
|
243
|
-
- `echo "gem: --no-document" >> ~/.gemrc`
|
244
|
-
|
245
|
-
- `bundle install --path vendor/bundle`
|
246
|
-
|
247
|
-
```
|
248
|
-
bundle exec rake test
|
249
|
-
bundle exec rake rubocopminitest
|
250
|
-
# bundle exec rake reek
|
251
|
-
reek --config .reek .
|
252
|
-
```
|
253
|
-
|
254
|
-
```
|
255
|
-
bundle exec rake build
|
256
|
-
```
|
257
|
-
includes Rake::Task['update_menu_yml'].execute
|
258
|
-
Rake::Task['update_tab_completion'].execute
|
259
|
-
|
260
|
-
```
|
261
|
-
bundle exec rake uninstall
|
262
|
-
```
|
263
|
-
|
264
|
-
```
|
265
|
-
bundle exec rake install
|
266
|
-
```
|
267
|
-
|
268
|
-
```
|
269
|
-
bundle exec rake publish
|
270
|
-
```
|
271
|
-
|
272
|
-
```
|
273
|
-
bundle exec rake --tasks
|
274
|
-
```
|
275
|
-
```expect
|
276
|
-
rake build # Build markdown_exec-1.3.0.9.gem into the pkg directory / gem build
|
277
|
-
rake clean # Remove any temporary products / gem build clean
|
278
|
-
rake clobber # Remove any generated files
|
279
|
-
rake install # Build and install markdown_exec-1.3.0.9.gem into system gems / gem install
|
280
|
-
rake install:local # Build and install markdown_exec-1.3.0.9.gem into system gems without network access
|
281
|
-
rake publish # gem publish
|
282
|
-
rake reek # reek
|
283
|
-
rake release[remote] # Create tag v1.3.0.9 and build and push markdown_exec-1.3.0.9.gem to rubygems.org
|
284
|
-
rake rubocop # Run RuboCop
|
285
|
-
rake rubocop:autocorrect # Autocorrect RuboCop offenses (only when it's safe)
|
286
|
-
rake rubocop:autocorrect_all # Autocorrect RuboCop offenses (safe and unsafe)
|
287
|
-
rake rubocopminitest # named task because minitest not included in rubocop tests
|
288
|
-
rake test # Run tests
|
289
|
-
rake uninstall # gem uninstall
|
290
|
-
rake update_installed_tab_completion # update installed tab_completion.sh
|
291
|
-
rake update_menu_yml # update menu.yml
|
292
|
-
rake update_tab_completion # update tab_completion.sh
|
293
|
-
```
|