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 +4 -4
- data/CHANGELOG.md +28 -0
- data/Gemfile.lock +1 -1
- data/bin/tab_completion.sh +2 -2
- data/lib/hash_delegator.rb +14 -7
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/menu.yml +1 -1
- 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: d8aaff8a595c31c7795c427ecc803b27ef40ae65d54be8bac9df13350c51f2fd
|
4
|
+
data.tar.gz: f65aee00b1f8567e7006ab73b4a60fb7a2e340fc6e4cfec33bd357051ab3a175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/bin/tab_completion.sh
CHANGED
@@ -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-
|
157
|
+
# echo "Updated: 2023-12-12 00:15:14 UTC"
|
data/lib/hash_delegator.rb
CHANGED
@@ -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[:
|
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({
|
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({
|
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({
|
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
|
-
{
|
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, {
|
2756
|
+
MenuState::CONTINUE, { oname: 'continue_block' }
|
2750
2757
|
)
|
2751
2758
|
@hd.stubs(:wait_for_user_selection).returns(mock_block_state)
|
2752
2759
|
|
data/lib/menu.yml
CHANGED
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:
|
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
|
+
date: 2023-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|