markdown_exec 3.0.5 → 3.0.7
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/bats/block-type-ux-act-init.bats +17 -0
- data/bats/block-type-ux-echo.bats +1 -2
- data/bats/block-type-ux-sources.bats +1 -1
- data/bats/block-type-ux-transform.bats +1 -1
- data/bats/import-conflict.bats +11 -0
- data/bats/import-duplicates.bats +53 -0
- data/bats/variable-expansion-multiline.bats +1 -1
- data/bin/bmde +4 -3
- data/docs/dev/block-type-ux-act-init.md +187 -0
- data/docs/dev/block-type-ux-auto.md +0 -1
- data/docs/dev/block-type-ux-default.md +2 -2
- data/docs/dev/block-type-ux-echo.md +1 -1
- data/docs/dev/block-type-ux-exec.md +0 -1
- data/docs/dev/block-type-ux-sources.md +1 -1
- data/docs/dev/block-type-ux-transform.md +5 -4
- data/docs/dev/command-substitution.md +1 -0
- data/docs/dev/import-conflict-0.md +12 -0
- data/docs/dev/import-conflict-1.md +7 -0
- data/docs/dev/import-duplicates-0.md +17 -0
- data/docs/dev/import-duplicates-1.md +13 -0
- data/docs/dev/load_code.md +1 -0
- data/docs/dev/no-active-elements.md +1 -0
- data/docs/dev/variable-expansion-multiline.md +4 -1
- data/docs/ux-blocks-examples.md +120 -0
- data/docs/ux-blocks-init-act.md +100 -0
- data/lib/command_result.rb +12 -0
- data/lib/command_result_alternatives.rb +233 -0
- data/lib/env_interface.rb +57 -0
- data/lib/hash_delegator.rb +186 -116
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/resize_terminal.rb +11 -5
- data/lib/ww.rb +4 -1
- metadata +14 -2
data/lib/resize_terminal.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# encoding=utf-8
|
5
5
|
require 'io/console'
|
6
6
|
require 'timeout'
|
7
|
+
require_relative 'env_interface'
|
7
8
|
|
8
9
|
# This function attempts to resize the terminal to its maximum supported size.
|
9
10
|
# It checks if the script is running in an interactive terminal with no arguments.
|
@@ -49,7 +50,9 @@ def resize_terminal(show_dims: false, show_rectangle: false,
|
|
49
50
|
|
50
51
|
calculated_rows, calculated_columns = match_data.captures.map(&:to_i)
|
51
52
|
|
52
|
-
if
|
53
|
+
if EnvInterface.get('COLUMNS',
|
54
|
+
transform: lambda(&:to_i)) == calculated_columns &&
|
55
|
+
EnvInterface.get('LINES', transform: lambda(&:to_i)) == calculated_rows
|
53
56
|
puts "#{ENV.fetch('TERM', nil)} #{calculated_columns}x#{calculated_rows}"
|
54
57
|
elsif calculated_columns.positive? && calculated_rows.positive?
|
55
58
|
warn "#{ENV.fetch('COLUMNS',
|
@@ -70,6 +73,9 @@ rescue Timeout::Error
|
|
70
73
|
rescue StandardError => err
|
71
74
|
warn "Error: #{err.message}. Unsupported terminal emulator."
|
72
75
|
1
|
76
|
+
ensure
|
77
|
+
EnvInterface.set('COLUMNS', @original_columns)
|
78
|
+
EnvInterface.set('LINES', @original_lines)
|
73
79
|
end
|
74
80
|
|
75
81
|
# This function draws a rectangle of the given width and height
|
@@ -96,8 +102,8 @@ class ResizeTerminalTest < Minitest::Test
|
|
96
102
|
def teardown
|
97
103
|
# Restore original ARGV and environment variables
|
98
104
|
ARGV.replace(@original_argv)
|
99
|
-
|
100
|
-
|
105
|
+
EnvInterface.set('COLUMNS', @original_columns)
|
106
|
+
EnvInterface.set('LINES', @original_lines)
|
101
107
|
end
|
102
108
|
|
103
109
|
# def test_resize_terminal_successful
|
@@ -119,8 +125,8 @@ class ResizeTerminalTest < Minitest::Test
|
|
119
125
|
$stdin.stub(:tty?, true) do
|
120
126
|
ARGV.replace([])
|
121
127
|
columns = 40 + (2 * rand(10))
|
122
|
-
|
123
|
-
|
128
|
+
EnvInterface.set('COLUMNS', columns.to_s)
|
129
|
+
EnvInterface.set('LINES', '24')
|
124
130
|
response = "\e[999;999H\e[6n\e[24;#{columns}R".dup
|
125
131
|
$stdin.stub(:getch, -> { response.slice!(0) || '' }) do
|
126
132
|
assert_output(/xterm-256color #{columns}x24$/) do
|
data/lib/ww.rb
CHANGED
@@ -87,9 +87,12 @@ end
|
|
87
87
|
|
88
88
|
class Array
|
89
89
|
unless defined?(deref)
|
90
|
-
def deref
|
90
|
+
def deref(count = 4)
|
91
|
+
dir_pwd = Dir.pwd
|
91
92
|
map(&:deref).reject do |line|
|
92
93
|
%r{^/(vendor|\.bundle)/}.match(line)
|
94
|
+
end.first(count).map do |line|
|
95
|
+
line.sub(dir_pwd, '.')
|
93
96
|
end
|
94
97
|
end
|
95
98
|
end
|
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: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fareed Stevenson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- bats/block-type-link.bats
|
113
113
|
- bats/block-type-opts.bats
|
114
114
|
- bats/block-type-port.bats
|
115
|
+
- bats/block-type-ux-act-init.bats
|
115
116
|
- bats/block-type-ux-allowed.bats
|
116
117
|
- bats/block-type-ux-auto.bats
|
117
118
|
- bats/block-type-ux-chained.bats
|
@@ -136,6 +137,8 @@ files:
|
|
136
137
|
- bats/document-shell.bats
|
137
138
|
- bats/fail.bats
|
138
139
|
- bats/history.bats
|
140
|
+
- bats/import-conflict.bats
|
141
|
+
- bats/import-duplicates.bats
|
139
142
|
- bats/import.bats
|
140
143
|
- bats/indented-block-type-vars.bats
|
141
144
|
- bats/indented-multi-line-output.bats
|
@@ -165,6 +168,7 @@ files:
|
|
165
168
|
- docs/dev/block-type-bash.md
|
166
169
|
- docs/dev/block-type-opts.md
|
167
170
|
- docs/dev/block-type-port.md
|
171
|
+
- docs/dev/block-type-ux-act-init.md
|
168
172
|
- docs/dev/block-type-ux-allowed.md
|
169
173
|
- docs/dev/block-type-ux-auto.md
|
170
174
|
- docs/dev/block-type-ux-chained.md
|
@@ -188,6 +192,10 @@ files:
|
|
188
192
|
- docs/dev/data-blocks.md
|
189
193
|
- docs/dev/disable.md
|
190
194
|
- docs/dev/document-shell.md
|
195
|
+
- docs/dev/import-conflict-0.md
|
196
|
+
- docs/dev/import-conflict-1.md
|
197
|
+
- docs/dev/import-duplicates-0.md
|
198
|
+
- docs/dev/import-duplicates-1.md
|
191
199
|
- docs/dev/import-missing.md
|
192
200
|
- docs/dev/import.md
|
193
201
|
- docs/dev/indented-block-type-vars.md
|
@@ -215,6 +223,8 @@ files:
|
|
215
223
|
- docs/dev/text-decoration.md
|
216
224
|
- docs/dev/variable-expansion-multiline.md
|
217
225
|
- docs/dev/variable-expansion.md
|
226
|
+
- docs/ux-blocks-examples.md
|
227
|
+
- docs/ux-blocks-init-act.md
|
218
228
|
- examples/bash-blocks.md
|
219
229
|
- examples/block-names.md
|
220
230
|
- examples/block-types.md
|
@@ -272,9 +282,11 @@ files:
|
|
272
282
|
- lib/color_scheme.rb
|
273
283
|
- lib/colorize.rb
|
274
284
|
- lib/command_result.rb
|
285
|
+
- lib/command_result_alternatives.rb
|
275
286
|
- lib/constants.rb
|
276
287
|
- lib/directory_searcher.rb
|
277
288
|
- lib/env.rb
|
289
|
+
- lib/env_interface.rb
|
278
290
|
- lib/error_reporting.rb
|
279
291
|
- lib/evaluate_shell_expressions.rb
|
280
292
|
- lib/exceptions.rb
|