markdown_exec 1.8 → 1.8.1

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: c4fdb41b414911d16030ffbfb8c4b07ca8c09e3684f21e123d0d99cd738dba3d
4
- data.tar.gz: 70c1ec9fb9b795d0cbdcc87ceb03809a57af5901a70dc2b1d319c9451592d687
3
+ metadata.gz: d8aaff8a595c31c7795c427ecc803b27ef40ae65d54be8bac9df13350c51f2fd
4
+ data.tar.gz: f65aee00b1f8567e7006ab73b4a60fb7a2e340fc6e4cfec33bd357051ab3a175
5
5
  SHA512:
6
- metadata.gz: abea63db83a4d785bce7c2ec1c9babebe6d78637872a068c4d6b2169832de8ea707a2c3ae426f6cd5ea548269194a797d95abdd7fceb286c4efa49da9d591bfe
7
- data.tar.gz: 1b102cb3e898789d6ddf2a401f90cfee04403ea135a14a5067673b250855aef569ca3b39a171570930ef5946d52874d022fb19fd9cf7c1561737144aefc5ef3c
6
+ metadata.gz: fbc6f2c928ba9a6e7a02783ff5f958df4daa8e7841b25c6482e1fb886d54b784bc9770c249eb38db1829b17bff4cea15b3a95dd4480aab1aab172595de7ee8e8
7
+ data.tar.gz: dbca510e5135474f9ab1ed200046469dc06781a6c051559b07dad381dbaba11e5e4e71a95fe500a69c8373fe7676ae7c4650ad339cc644bd29fdafb2aa02187c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.1] - 2023-12-11
4
+
5
+ ### Changed
6
+
7
+ - Name used in script saved file.
8
+
9
+ ## [1.8] - 2023-12-11
10
+
11
+ ### Changed
12
+
13
+ - Default colors.
14
+
15
+ ### Added
16
+
17
+ - Run-time exception for unmet dependencies.
18
+ - Command to find text in directory name, file name, or file contents.
19
+ - Options to detect and display block dependency graph and exceptions.
20
+ - Options to dump parsed blocks structures.
21
+ - Options to add labels to shell code blocks.
22
+
23
+ ## [1.7] - 2023-12-01
24
+
25
+ ### Added
26
+
27
+ - Options to format menu and output blocks.
28
+ - Control display of imported content.
29
+ - Example documents.
30
+
3
31
  ## [1.6] - 2023-11-13
4
32
 
5
33
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_exec (1.8)
4
+ markdown_exec (1.8.1)
5
5
  clipboard (~> 1.3.6)
6
6
  open3 (~> 0.1.1)
7
7
  optparse (~> 0.1.1)
@@ -13,7 +13,7 @@ __filedirs_all()
13
13
  }
14
14
 
15
15
  _mde_echo_version() {
16
- echo "1.8"
16
+ echo "1.8.1"
17
17
  }
18
18
 
19
19
  _mde() {
@@ -154,4 +154,4 @@ _mde() {
154
154
 
155
155
  complete -o filenames -o nospace -F _mde mde
156
156
  # _mde_echo_version
157
- # echo "Updated: 2023-12-11 19:58:50 UTC"
157
+ # echo "Updated: 2023-12-12 00:15:14 UTC"
@@ -384,6 +384,7 @@ module MarkdownExec
384
384
  @run_state.files = Hash.new([])
385
385
  @run_state.options = @delegate_object
386
386
  @run_state.started_at = Time.now.utc
387
+ # rbp
387
388
 
388
389
  Open3.popen3(@delegate_object[:shell],
389
390
  '-c', command,
@@ -790,7 +791,8 @@ module MarkdownExec
790
791
  return
791
792
  end
792
793
 
793
- @delegate_object[:block_name] = block_state.block[:dname]
794
+ @delegate_object[:block_name] = block_state.block[:oname]
795
+ # rbp
794
796
  @menu_user_clicked_back_link = block_state.state == MenuState::BACK
795
797
  end
796
798
 
@@ -802,6 +804,7 @@ module MarkdownExec
802
804
  # @param selected [Hash] The selected item from the menu to be executed.
803
805
  # @return [LoadFileNextBlock] An object indicating whether to load the next block or reuse the current one.
804
806
  def handle_generic_block(mdoc, selected)
807
+ # rbp
805
808
  required_lines = collect_required_code_lines(mdoc, selected)
806
809
  output_or_approval = @delegate_object[:output_script] || @delegate_object[:user_must_approve]
807
810
  display_required_code(required_lines) if output_or_approval
@@ -1108,6 +1111,7 @@ module MarkdownExec
1108
1111
  def next_block_name_from_command_line_arguments
1109
1112
  return MenuControl::Repeat unless @delegate_object[:input_cli_rest].present?
1110
1113
 
1114
+ # rbp
1111
1115
  @delegate_object[:block_name] = @delegate_object[:input_cli_rest].pop
1112
1116
  MenuControl::Fresh
1113
1117
  end
@@ -1300,6 +1304,7 @@ module MarkdownExec
1300
1304
  loop do
1301
1305
  @delegate_object = @menu_base_options.dup
1302
1306
  @menu_base_options[:filename] = @menu_state_filename
1307
+ # rbp
1303
1308
  @menu_base_options[:block_name] = @menu_state_block_name
1304
1309
  @menu_state_filename = nil
1305
1310
  @menu_state_block_name = nil
@@ -1332,9 +1337,11 @@ module MarkdownExec
1332
1337
  warn block_state.block.to_yaml.sub(/^(?:---\n)?/, "Block:\n")
1333
1338
  end
1334
1339
 
1340
+ # rbp
1335
1341
  load_file_next_block = approve_and_execute_block(block_state.block,
1336
1342
  mdoc)
1337
1343
  default = load_file_next_block.load_file == LoadFile::Load ? nil : @delegate_object[:block_name]
1344
+ # rbp
1338
1345
  @menu_base_options[:block_name] =
1339
1346
  @delegate_object[:block_name] = load_file_next_block.next_block
1340
1347
  @menu_base_options[:filename] = @delegate_object[:filename]
@@ -1583,13 +1590,13 @@ module MarkdownExec
1583
1590
  def write_command_file(required_lines)
1584
1591
  return unless @delegate_object[:save_executed_script]
1585
1592
 
1593
+ # rbp
1586
1594
  time_now = Time.now.utc
1587
1595
  @run_state.saved_script_filename =
1588
1596
  SavedAsset.script_name(blockname: @delegate_object[:block_name],
1589
1597
  filename: @delegate_object[:filename],
1590
1598
  prefix: @delegate_object[:saved_script_filename_prefix],
1591
1599
  time: time_now)
1592
-
1593
1600
  @run_state.saved_filespec =
1594
1601
  File.join(@delegate_object[:saved_script_folder],
1595
1602
  @run_state.saved_script_filename)
@@ -2275,7 +2282,7 @@ if $PROGRAM_NAME == __FILE__
2275
2282
 
2276
2283
  def test_handle_block_state_with_back
2277
2284
  @mock_block_state.stubs(:state).returns(MenuState::BACK)
2278
- @mock_block_state.stubs(:block).returns({ dname: 'sample_block' })
2285
+ @mock_block_state.stubs(:block).returns({ oname: 'sample_block' })
2279
2286
 
2280
2287
  @hd.handle_block_state(@mock_block_state)
2281
2288
 
@@ -2286,7 +2293,7 @@ if $PROGRAM_NAME == __FILE__
2286
2293
 
2287
2294
  def test_handle_block_state_with_continue
2288
2295
  @mock_block_state.stubs(:state).returns(MenuState::CONTINUE)
2289
- @mock_block_state.stubs(:block).returns({ dname: 'another_block' })
2296
+ @mock_block_state.stubs(:block).returns({ oname: 'another_block' })
2290
2297
 
2291
2298
  @hd.handle_block_state(@mock_block_state)
2292
2299
 
@@ -2297,7 +2304,7 @@ if $PROGRAM_NAME == __FILE__
2297
2304
 
2298
2305
  def test_handle_block_state_with_other
2299
2306
  @mock_block_state.stubs(:state).returns(nil) # MenuState::OTHER
2300
- @mock_block_state.stubs(:block).returns({ dname: 'other_block' })
2307
+ @mock_block_state.stubs(:block).returns({ oname: 'other_block' })
2301
2308
 
2302
2309
  @hd.handle_block_state(@mock_block_state)
2303
2310
 
@@ -2732,7 +2739,7 @@ if $PROGRAM_NAME == __FILE__
2732
2739
 
2733
2740
  def test_wait_for_user_selected_block_with_back_state
2734
2741
  mock_block_state = Struct.new(:state, :block).new(MenuState::BACK,
2735
- { dname: 'back_block' })
2742
+ { oname: 'back_block' })
2736
2743
  @hd.stubs(:wait_for_user_selection).returns(mock_block_state)
2737
2744
 
2738
2745
  result = @hd.wait_for_user_selected_block([], ['Block 1', 'Block 2'],
@@ -2746,7 +2753,7 @@ if $PROGRAM_NAME == __FILE__
2746
2753
 
2747
2754
  def test_wait_for_user_selected_block_with_continue_state
2748
2755
  mock_block_state = Struct.new(:state, :block).new(
2749
- MenuState::CONTINUE, { dname: 'continue_block' }
2756
+ MenuState::CONTINUE, { oname: 'continue_block' }
2750
2757
  )
2751
2758
  @hd.stubs(:wait_for_user_selection).returns(mock_block_state)
2752
2759
 
@@ -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 = '1.8'
10
+ VERSION = '1.8.1'
11
11
  end
data/lib/menu.yml CHANGED
@@ -1,4 +1,4 @@
1
- # MDE - Markdown Executor (1.8)
1
+ # MDE - Markdown Executor (1.8.1)
2
2
  ---
3
3
  - :description: Show current configuration values
4
4
  :procname: show_config
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: '1.8'
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fareed Stevenson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-11 00:00:00.000000000 Z
11
+ date: 2023-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard