markdown_exec 2.0.8.1 → 2.0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/bin/tab_completion.sh +2 -2
- data/examples/pass-through.md +21 -3
- data/lib/hash_delegator.rb +4 -2
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/markdown_exec.rb +1 -1
- data/lib/menu.src.yml +5 -4
- data/lib/menu.yml +2 -2
- 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: 39b3a2b14b7efe82967efab04742281a8233a24daebf7c68f11fec661c8cd80e
|
4
|
+
data.tar.gz: 16586313129a6c66cced3e45b6c94c758eba0fa0ea7fccce47a848366435ff11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7bcb0cb4ffdf2979ccc749a9abe1aaf86314b7a4ecd8fa34f9d6bfac7ae7d8a62f1981dcbdf7f0e7dd211e193392f009865b2adcd5eb5aa9d15610cd60559bb
|
7
|
+
data.tar.gz: 5ab77246617cec9bb918a44e51d40ba1ef4d1215c57de9541538f2f10aa60e61144fad31e7bd7901d7985b95064863783258ddec35dea48fe1a86faf4dbd15f2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
Pass-through arguments after "--" to the script
|
4
|
+
M Gemfile.lock
|
5
|
+
M bin/tab_completion.sh
|
6
|
+
M examples/pass-through.md
|
7
|
+
M lib/hash_delegator.rb
|
8
|
+
M lib/markdown_exec.rb
|
9
|
+
M lib/markdown_exec/version.rb
|
10
|
+
M lib/menu.src.yml
|
11
|
+
M lib/menu.yml
|
12
|
+
|
3
13
|
## [2.0.8] - 2024-06-05
|
4
14
|
|
5
15
|
### Added
|
data/Gemfile.lock
CHANGED
data/bin/tab_completion.sh
CHANGED
@@ -13,7 +13,7 @@ __filedirs_all()
|
|
13
13
|
}
|
14
14
|
|
15
15
|
_mde_echo_version() {
|
16
|
-
echo "2.0.8.
|
16
|
+
echo "2.0.8.2"
|
17
17
|
}
|
18
18
|
|
19
19
|
_mde() {
|
@@ -178,4 +178,4 @@ _mde() {
|
|
178
178
|
|
179
179
|
complete -o filenames -o nospace -F _mde mde
|
180
180
|
# _mde_echo_version
|
181
|
-
# echo "Updated: 2024-06-
|
181
|
+
# echo "Updated: 2024-06-07 23:43:21 UTC"
|
data/examples/pass-through.md
CHANGED
@@ -1,14 +1,32 @@
|
|
1
|
+
```opts :(document_options)
|
2
|
+
execute_in_own_window: false
|
3
|
+
pause_after_script_execution: true
|
4
|
+
save_executed_script: true
|
5
|
+
saved_script_folder: ../mde_logs
|
6
|
+
```
|
1
7
|
Pass-through arguments after "--" to the executed script.
|
2
8
|
|
3
9
|
A block can expect arguments to receive all arguments to MDE after "--".
|
4
10
|
|
5
|
-
For `mde examples/pass-through.md output_arguments --
|
11
|
+
For `mde examples/pass-through.md output_arguments -- 1 23`,
|
6
12
|
this block outputs:
|
7
13
|
|
8
|
-
ARGS:
|
14
|
+
ARGS: 1 23
|
15
|
+
|
16
|
+
::: Test
|
17
|
+
```bash
|
18
|
+
mde examples/pass-through.md output_arguments -- 1 23
|
19
|
+
```
|
9
20
|
|
10
|
-
:::
|
21
|
+
::: These options toggle the use of a separate window.
|
22
|
+
```opts
|
23
|
+
execute_in_own_window: true
|
24
|
+
```
|
25
|
+
```opts
|
26
|
+
execute_in_own_window: false
|
27
|
+
```
|
11
28
|
|
29
|
+
::: This block will output any command line arguments after "--".
|
12
30
|
```bash :output_arguments
|
13
31
|
echo "ARGS: $*"
|
14
32
|
```
|
data/lib/hash_delegator.rb
CHANGED
@@ -804,7 +804,7 @@ module MarkdownExec
|
|
804
804
|
system(
|
805
805
|
format(
|
806
806
|
@delegate_object[:execute_command_format],
|
807
|
-
command_execute_in_own_window_format_arguments
|
807
|
+
command_execute_in_own_window_format_arguments(rest: args ? args.join(' ') : '')
|
808
808
|
)
|
809
809
|
)
|
810
810
|
|
@@ -832,7 +832,7 @@ module MarkdownExec
|
|
832
832
|
@fout.fout "Error ENOENT: #{err.inspect}"
|
833
833
|
end
|
834
834
|
|
835
|
-
def command_execute_in_own_window_format_arguments(home: Dir.pwd)
|
835
|
+
def command_execute_in_own_window_format_arguments(home: Dir.pwd, rest: '')
|
836
836
|
{
|
837
837
|
batch_index: @run_state.batch_index,
|
838
838
|
batch_random: @run_state.batch_random,
|
@@ -842,6 +842,7 @@ module MarkdownExec
|
|
842
842
|
home: home,
|
843
843
|
output_filename: File.basename(@delegate_object[:logged_stdout_filespec]),
|
844
844
|
output_filespec: @delegate_object[:logged_stdout_filespec],
|
845
|
+
rest: rest,
|
845
846
|
script_filename: @run_state.saved_filespec,
|
846
847
|
script_filespec: File.join(home, @run_state.saved_filespec),
|
847
848
|
started_at: @run_state.started_at.strftime(
|
@@ -1827,6 +1828,7 @@ module MarkdownExec
|
|
1827
1828
|
document_filename: File.basename(@delegate_object[:filename]),
|
1828
1829
|
document_filespec: @delegate_object[:filename],
|
1829
1830
|
home: Dir.pwd,
|
1831
|
+
# rest: '',
|
1830
1832
|
started_at: Time.now.utc.strftime(@delegate_object[:execute_command_title_time_format])
|
1831
1833
|
}
|
1832
1834
|
end
|
data/lib/markdown_exec.rb
CHANGED
@@ -275,7 +275,7 @@ module MarkdownExec
|
|
275
275
|
end
|
276
276
|
|
277
277
|
# return arguments before ARGV_SEP
|
278
|
-
# arguments after ARGV_SEP are passed to the
|
278
|
+
# arguments after ARGV_SEP are passed to the generated script
|
279
279
|
#
|
280
280
|
def arguments_for_mde(argv = ARGV)
|
281
281
|
case ind = argv.find_index(ARGV_SEP)
|
data/lib/menu.src.yml
CHANGED
@@ -233,8 +233,6 @@
|
|
233
233
|
:opt_name: exclude_expect_blocks
|
234
234
|
:procname: val_as_bool
|
235
235
|
|
236
|
-
# - :default: >
|
237
|
-
# osascript scripts/applescript/mde.applescript "%{batch_index}" "%{home}" " %{started_at} - %{document_filename} - %{block_name} " "%{script_filespec}" "%{output_filespec}"
|
238
236
|
- :default: >
|
239
237
|
osascript -e '
|
240
238
|
on run argv
|
@@ -252,7 +250,7 @@
|
|
252
250
|
write text "o=" & quoted form of output_filespec & ""
|
253
251
|
write text "cd " & quoted form of home & ""
|
254
252
|
write text "echo -ne \"\\033]; " & title & " \\007\""
|
255
|
-
write text "\"$s\" 2>&1 | tee -a \"$o\""
|
253
|
+
write text "\"$s\" %{rest} 2>&1 | tee -a \"$o\""
|
256
254
|
end tell
|
257
255
|
end tell
|
258
256
|
end tell
|
@@ -261,6 +259,9 @@
|
|
261
259
|
:env_var: MDE_EXECUTE_COMMAND_FORMAT
|
262
260
|
:opt_name: execute_command_format
|
263
261
|
:procname: val_as_str
|
262
|
+
# execute_command_format using a saved script
|
263
|
+
# - :default: >
|
264
|
+
# osascript scripts/applescript/mde.applescript "%{batch_index}" "%{home}" " %{started_at} - %{document_filename} - %{block_name} " "%{script_filespec}" "%{output_filespec}" %{rest}
|
264
265
|
|
265
266
|
- :default: "%T"
|
266
267
|
:description: Format for time in window title
|
@@ -1037,7 +1038,7 @@
|
|
1037
1038
|
|
1038
1039
|
- :arg_name: BOOL
|
1039
1040
|
:default: false
|
1040
|
-
:description:
|
1041
|
+
:description: Whether to save an executed script
|
1041
1042
|
:env_var: MDE_SAVE_EXECUTED_SCRIPT
|
1042
1043
|
:opt_name: save_executed_script
|
1043
1044
|
:procname: val_as_bool
|
data/lib/menu.yml
CHANGED
@@ -211,7 +211,7 @@
|
|
211
211
|
write text "o=" & quoted form of output_filespec & ""
|
212
212
|
write text "cd " & quoted form of home & ""
|
213
213
|
write text "echo -ne \"\\033]; " & title & " \\007\""
|
214
|
-
write text "\"$s\" 2>&1 | tee -a \"$o\""
|
214
|
+
write text "\"$s\" %{rest} 2>&1 | tee -a \"$o\""
|
215
215
|
end tell
|
216
216
|
end tell
|
217
217
|
end tell
|
@@ -884,7 +884,7 @@
|
|
884
884
|
:procname: val_as_int
|
885
885
|
- :arg_name: BOOL
|
886
886
|
:default: false
|
887
|
-
:description:
|
887
|
+
:description: Whether to save an executed script
|
888
888
|
:env_var: MDE_SAVE_EXECUTED_SCRIPT
|
889
889
|
:opt_name: save_executed_script
|
890
890
|
:procname: val_as_bool
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markdown_exec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.8.
|
4
|
+
version: 2.0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fareed Stevenson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|