markdown_exec 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95d097cfcf93e09ba3bf487989923d4be03dd9fde0521854ea0660850b157d01
4
- data.tar.gz: 22bc0e8bc8cd35d0d1dd52b6275c1609fb4cb95d69bd125064f0ca16f2f931f7
3
+ metadata.gz: c8baa6b01b9d965c3a8856d08a86225457c09106c366ecd174f7f0e547f43f4a
4
+ data.tar.gz: bd0348f31ddb1bb0cda0328e5c7dd3187e6692269e8b132849833ce1d44f5b0f
5
5
  SHA512:
6
- metadata.gz: 591c09a221c0f5a34f8523d99d8e416bb022219fee38a7a05e3541600b03132e5ae3cc6aee02048eda2170a408d9e86090dedadff7c16f1f79ea98469826c27a
7
- data.tar.gz: 74a76b6a6b10b165f8e79e59d25db78bcba173d730fd1a696e73c2012794bcfedd7c1b648cabe6b15d4d0a70995e5303b02c58d0b16c35a03ffbfea0b4efc5f4
6
+ metadata.gz: e6f8028d4fe4dea45bacb14e8cb12306d0ee975ac729c04d0f8db990a6ce92758b13400329358656d5902c85dd5411aef717210b0151de4ae2cec375f51b0b98
7
+ data.tar.gz: 390dd965fe49ab4ac1651996fc7500ff971fbe71ce580ff807d8652b62aff5b50768ce971920e9f93682d5adb692cd5bcf99834b8b022c41734dc24f61cf940c
data/CHANGELOG.md CHANGED
@@ -22,7 +22,13 @@
22
22
 
23
23
  - add shebang to saved script
24
24
 
25
- ## [0.2.5] - 2022-04
25
+ ## [0.2.6] - 2022-04-07
26
+
27
+ ### Changed
28
+
29
+ - Fixed default values for command line options.
30
+
31
+ ## [0.2.5] - 2022-04-03
26
32
 
27
33
  ### Added
28
34
 
@@ -4,5 +4,5 @@ module MarkdownExec
4
4
  APP_NAME = 'MDE'
5
5
  APP_DESC = 'Markdown Executor'
6
6
  GEM_NAME = 'markdown_exec'
7
- VERSION = '0.2.5'
7
+ VERSION = '0.2.6'
8
8
  end
data/lib/markdown_exec.rb CHANGED
@@ -476,53 +476,43 @@ module MarkdownExec
476
476
  end
477
477
 
478
478
  def menu_data
479
- proc_self = ->(value) { value }
480
- proc_to_i = ->(value) { value.to_i != 0 }
481
- proc_true = ->(_) { true }
479
+ val_as_bool = ->(value) { value.to_i != 0 }
480
+ val_as_int = ->(value) { value.to_i }
481
+ val_as_str = ->(value) { value.to_s }
482
+ val_true = ->(_) { true }
482
483
 
483
484
  summary_head = [
484
- ['config', nil, nil, 'PATH', 'Read configuration file',
485
- nil, '.', ->(value) { read_configuration_file! options, value }],
486
- ['debug', 'd', 'MDE_DEBUG', 'BOOL', 'Debug output',
487
- nil, false, ->(value) { $pdebug = value.to_i != 0 }]
485
+ ['config', nil, nil, 'PATH', 'Read configuration file', nil, '.', lambda { |value|
486
+ read_configuration_file! options, value
487
+ }],
488
+ ['debug', 'd', 'MDE_DEBUG', 'BOOL', 'Debug output', nil, false, ->(value) { $pdebug = value.to_i != 0 }]
488
489
  ]
489
490
 
491
+ # rubocop:disable Layout/LineLength
490
492
  summary_body = [
491
- ['filename', 'f', 'MDE_FILENAME', 'RELATIVE', 'Name of document',
492
- :filename, nil, proc_self],
493
- ['list-blocks', nil, nil, nil, 'List blocks',
494
- :list_blocks, nil, proc_true],
495
- ['list-default-env', nil, nil, nil, 'List default configuration as environment variables',
496
- :list_default_env, nil, proc_true],
497
- ['list-default-yaml', nil, nil, nil, 'List default configuration as YAML',
498
- :list_default_yaml, nil, proc_true],
499
- ['list-docs', nil, nil, nil, 'List docs in current folder',
500
- :list_docs, nil, proc_true],
501
- ['list-recent-scripts', nil, nil, nil, 'List recent saved scripts',
502
- :list_recent_scripts, nil, proc_true],
503
- ['output-execution-summary', nil, 'MDE_OUTPUT_EXECUTION_SUMMARY', 'BOOL', 'Display summary for execution',
504
- :output_execution_summary, false, proc_to_i],
505
- ['output-script', nil, 'MDE_OUTPUT_SCRIPT', 'BOOL', 'Display script prior to execution',
506
- :output_script, false, proc_to_i],
507
- ['output-stdout', nil, 'MDE_OUTPUT_STDOUT', 'BOOL', 'Display standard output from execution',
508
- :output_stdout, true, proc_to_i],
509
- ['path', 'p', 'MDE_PATH', 'PATH', 'Path to documents',
510
- :path, nil, proc_self],
511
- ['run-last-script', nil, nil, nil, 'Run most recently saved script',
512
- :run_last_script, nil, proc_true],
513
- ['select-recent-script', nil, nil, nil, 'Select and execute a recently saved script',
514
- :select_recent_script, nil, proc_true],
515
- ['save-execution-output', nil, 'MDE_SAVE_EXECUTION_OUTPUT', 'BOOL', 'Save execution output',
516
- :save_execution_output, false, proc_to_i],
517
- ['save-executed-script', nil, 'MDE_SAVE_EXECUTED_SCRIPT', 'BOOL', 'Save executed script',
518
- :save_executed_script, false, proc_to_i],
519
- ['saved-script-folder', nil, 'MDE_SAVED_SCRIPT_FOLDER', 'SPEC', 'Saved script folder',
520
- :saved_script_folder, 'logs', proc_self],
521
- ['saved-stdout-folder', nil, 'MDE_SAVED_STDOUT_FOLDER', 'SPEC', 'Saved stdout folder',
522
- :saved_stdout_folder, 'logs', proc_self],
523
- ['user-must-approve', nil, 'MDE_USER_MUST_APPROVE', 'BOOL', 'Pause for user to approve script',
524
- :user_must_approve, true, proc_to_i]
493
+ ['filename', 'f', 'MDE_FILENAME', 'RELATIVE', 'Name of document', :filename, nil, val_as_str],
494
+ ['list-blocks', nil, nil, nil, 'List blocks', :list_blocks, nil, val_true],
495
+ ['list-count', nil, 'MDE_LIST_COUNT', 'NUM', 'Max. items to return in list', :list_count, 16, val_as_int],
496
+ ['list-default-env', nil, nil, nil, 'List default configuration as environment variables', :list_default_env, nil, val_true],
497
+ ['list-default-yaml', nil, nil, nil, 'List default configuration as YAML', :list_default_yaml, nil, val_true],
498
+ ['list-docs', nil, nil, nil, 'List docs in current folder', :list_docs, nil, val_true],
499
+ ['list-recent-scripts', nil, nil, nil, 'List recent saved scripts', :list_recent_scripts, nil, val_true],
500
+ ['logged-stdout-filename-prefix', nil, 'MDE_LOGGED_STDOUT_FILENAME_PREFIX', 'NAME', 'Name prefix for stdout files', :logged_stdout_filename_prefix, 'mde', val_as_str],
501
+ ['output-execution-summary', nil, 'MDE_OUTPUT_EXECUTION_SUMMARY', 'BOOL', 'Display summary for execution', :output_execution_summary, false, val_as_bool],
502
+ ['output-script', nil, 'MDE_OUTPUT_SCRIPT', 'BOOL', 'Display script prior to execution', :output_script, false, val_as_bool],
503
+ ['output-stdout', nil, 'MDE_OUTPUT_STDOUT', 'BOOL', 'Display standard output from execution', :output_stdout, true, val_as_bool],
504
+ ['path', 'p', 'MDE_PATH', 'PATH', 'Path to documents', :path, nil, val_as_str],
505
+ ['run-last-script', nil, nil, nil, 'Run most recently saved script', :run_last_script, nil, val_true],
506
+ ['select-recent-script', nil, nil, nil, 'Select and execute a recently saved script', :select_recent_script, nil, val_true],
507
+ ['save-executed-script', nil, 'MDE_SAVE_EXECUTED_SCRIPT', 'BOOL', 'Save executed script', :save_executed_script, false, val_as_bool],
508
+ ['save-execution-output', nil, 'MDE_SAVE_EXECUTION_OUTPUT', 'BOOL', 'Save standard output of the executed script', :save_execution_output, false, val_as_bool],
509
+ ['saved-script-filename-prefix', nil, 'MDE_SAVED_SCRIPT_FILENAME_PREFIX', 'NAME', 'Name prefix for saved scripts', :saved_script_filename_prefix, 'mde', val_as_str],
510
+ ['saved-script-folder', nil, 'MDE_SAVED_SCRIPT_FOLDER', 'SPEC', 'Saved script folder', :saved_script_folder, 'logs', val_as_str],
511
+ ['saved-script-glob', nil, 'MDE_SAVED_SCRIPT_GLOB', 'SPEC', 'Glob matching saved scripts', :saved_script_glob, 'mde_*.sh', val_as_str],
512
+ ['saved-stdout-folder', nil, 'MDE_SAVED_STDOUT_FOLDER', 'SPEC', 'Saved stdout folder', :saved_stdout_folder, 'logs', val_as_str],
513
+ ['user-must-approve', nil, 'MDE_USER_MUST_APPROVE', 'BOOL', 'Pause for user to approve script', :user_must_approve, true, val_as_bool]
525
514
  ]
515
+ # rubocop:enable Layout/LineLength
526
516
 
527
517
  # rubocop:disable Style/Semicolon
528
518
  summary_tail = [
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: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fareed Stevenson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-04 00:00:00.000000000 Z
11
+ date: 2022-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open3