markdown_exec 2.0.8 → 2.0.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e071fd1fad2603543cbad492e8bed6ee2a1e437f914cf834d3bb99da3a87234f
4
- data.tar.gz: ba95432a7a17319cde5eaa821c554a472f8cdfeca8238c370869a560e22fcae7
3
+ metadata.gz: 39b3a2b14b7efe82967efab04742281a8233a24daebf7c68f11fec661c8cd80e
4
+ data.tar.gz: 16586313129a6c66cced3e45b6c94c758eba0fa0ea7fccce47a848366435ff11
5
5
  SHA512:
6
- metadata.gz: 0c3586f87853edbb872a7ad8ba766fe1a76d4184ebb6b02d11eaf6227ed152ae75b83c5b291981f0cf9a2208133cf122e8a3fcd4376bd694607f9bfa5d8bc577
7
- data.tar.gz: 73a013bc437ba2d5aa87bd9c8a0c8039d6ad8cb6b95767a3b16ab340a90aec26ae1f2c0d0fa355280caa89cb45de7a474b51473683573a147d6cebc91b6522a1
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_exec (2.0.8)
4
+ markdown_exec (2.0.8.2)
5
5
  clipboard (~> 1.3.6)
6
6
  open3 (~> 0.1.1)
7
7
  optparse (~> 0.1.1)
data/Rakefile CHANGED
@@ -134,10 +134,7 @@ task :update_menu_yml do
134
134
  }
135
135
  )
136
136
 
137
- File.write(MENU_YML,
138
- "# #{MarkdownExec::APP_NAME} - #{MarkdownExec::APP_DESC} " \
139
- "(#{MarkdownExec::VERSION})\n" +
140
- menu_options.to_yaml)
137
+ File.write(MENU_YML, menu_options.to_yaml)
141
138
  puts `stat #{MENU_YML}`
142
139
  end
143
140
 
@@ -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-06 00:36:41 UTC"
181
+ # echo "Updated: 2024-06-07 23:43:21 UTC"
@@ -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 -- 123`,
11
+ For `mde examples/pass-through.md output_arguments -- 1 23`,
6
12
  this block outputs:
7
13
 
8
- ARGS: 123
14
+ ARGS: 1 23
15
+
16
+ ::: Test
17
+ ```bash
18
+ mde examples/pass-through.md output_arguments -- 1 23
19
+ ```
9
20
 
10
- ::: This block will output any arguments after "--" in the command line.
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
  ```
@@ -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
@@ -7,5 +7,5 @@ module MarkdownExec
7
7
  BIN_NAME = 'mde'
8
8
  GEM_NAME = 'markdown_exec'
9
9
  TAP_DEBUG = 'MDE_DEBUG'
10
- VERSION = '2.0.8'
10
+ VERSION = '2.0.8.2'
11
11
  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 generatede script
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: Wheter to save an executed script`
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
@@ -1,4 +1,3 @@
1
- # MDE - Markdown Executor (2.0.8)
2
1
  ---
3
2
  - :description: Show current configuration values
4
3
  :procname: show_config
@@ -212,7 +211,7 @@
212
211
  write text "o=" & quoted form of output_filespec & ""
213
212
  write text "cd " & quoted form of home & ""
214
213
  write text "echo -ne \"\\033]; " & title & " \\007\""
215
- write text "\"$s\" 2>&1 | tee -a \"$o\""
214
+ write text "\"$s\" %{rest} 2>&1 | tee -a \"$o\""
216
215
  end tell
217
216
  end tell
218
217
  end tell
@@ -885,7 +884,7 @@
885
884
  :procname: val_as_int
886
885
  - :arg_name: BOOL
887
886
  :default: false
888
- :description: Wheter to save an executed script`
887
+ :description: Whether to save an executed script
889
888
  :env_var: MDE_SAVE_EXECUTED_SCRIPT
890
889
  :opt_name: save_executed_script
891
890
  :procname: val_as_bool
@@ -12,7 +12,7 @@ require 'timeout'
12
12
  # If the terminal emulator is unsupported, it prints an error message.
13
13
  def resize_terminal(show_dims: false, show_rectangle: false)
14
14
  # Check if running in an interactive terminal and no arguments are provided
15
- if $stdin.tty? && ARGV.empty?
15
+ if $stdin.tty?
16
16
  begin
17
17
  # Save the current state and send the escape sequence to get the cursor position
18
18
  print "\e7\e[r\e[999;999H\e[6n\e8"
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-06 00:00:00.000000000 Z
11
+ date: 2024-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard