raindown 0.11.0 → 0.13.0
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/lib/raindown/actions.rb +1 -1
- data/lib/raindown/bare_directives.rb +10 -16
- data/lib/raindown/blueprints.rb +7 -6
- data/lib/raindown/cli.rb +22 -16
- data/lib/raindown/code_blocks.rb +26 -16
- data/lib/raindown/document.rb +9 -9
- data/lib/raindown/editing.rb +2 -2
- data/lib/raindown/endpoint/endpoint_runner.rb +15 -29
- data/lib/raindown/markdown_nodes.rb +1 -1
- data/lib/raindown/node_blocks.rb +1 -6
- data/lib/raindown/node_injector.rb +7 -1
- data/lib/raindown/nodes.rb +5 -3
- data/lib/raindown/pages.rb +61 -12
- data/lib/raindown/rewriter.rb +13 -12
- data/lib/raindown/table/markdown_table.rb +33 -0
- data/lib/raindown/table/table.rb +73 -0
- data/lib/raindown/tui/blueprints/blueprints_view.rb +1 -1
- data/lib/raindown/tui/cloud.rb +154 -0
- data/lib/raindown/tui/feelings/celebration/celebration_renderer.rb +22 -0
- data/lib/raindown/tui/feelings/feelings_log.rb +4 -4
- data/lib/raindown/tui/feelings/feelings_renderer.rb +3 -16
- data/lib/raindown/tui/layout.rb +8 -1
- data/lib/raindown/tui/project.rb +23 -11
- data/lib/raindown/tui/renderers/endpoint_renderer.rb +4 -3
- data/lib/raindown/tui/terminal/loading.rb +34 -0
- data/lib/raindown/tui/terminal/screen.rb +6 -5
- data/lib/raindown/tui/terminal/styles.rb +13 -1
- data/lib/raindown/tui/views/endpoint_view.rb +5 -4
- data/lib/raindown/tui.rb +10 -6
- data/lib/raindown/watcher/file_watcher.rb +3 -3
- data/lib/raindown/watcher/project.rb +3 -4
- data/lib/version.rb +1 -1
- metadata +7 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative '../../code_blocks'
|
|
3
4
|
require_relative '../events'
|
|
4
5
|
require_relative '../../workers/worker'
|
|
5
6
|
|
|
@@ -9,11 +10,11 @@ module Raindown
|
|
|
9
10
|
# Worker when it's opened, which scrolls.
|
|
10
11
|
# A key's next step, for the Navigator, is nil, an Open or Edit of its directive, or an Execute of it.
|
|
11
12
|
class EndpointView
|
|
12
|
-
# The
|
|
13
|
-
|
|
13
|
+
# The text of the comment above a response, like "response 200 · 142 ms · 2026-10-26".
|
|
14
|
+
COMMENT = /<!--\s*(.*?)\s*-->/
|
|
14
15
|
FENCE = /\A\s*`{3,}(\S*)/
|
|
15
16
|
|
|
16
|
-
attr_reader :endpoint, :response, :language, :
|
|
17
|
+
attr_reader :endpoint, :response, :language, :comment, :error
|
|
17
18
|
|
|
18
19
|
def initialize(endpoint, workers:)
|
|
19
20
|
@endpoint = endpoint
|
|
@@ -36,7 +37,7 @@ module Raindown
|
|
|
36
37
|
# Reads the response again, like after the request's run.
|
|
37
38
|
def load
|
|
38
39
|
lines = output_lines
|
|
39
|
-
@
|
|
40
|
+
@comment = lines.shift[COMMENT, 1] if lines.first&.match?(CodeBlocks::RESPONSE_COMMENT)
|
|
40
41
|
@language = lines.first.to_s[FENCE, 1]
|
|
41
42
|
@response = @language ? lines[1...-1] : lines
|
|
42
43
|
@error = nil
|
data/lib/raindown/tui.rb
CHANGED
|
@@ -27,12 +27,16 @@ module Raindown
|
|
|
27
27
|
# so two projects' nodes of the same name stay apart.
|
|
28
28
|
workers = Project.workers(root:, bare:, execute:)
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
saves = nil
|
|
31
|
+
Screen.new do
|
|
32
|
+
# Rouge loads here, rather than with Raindown, which doesn't highlight code outside the TUI, while the screen shows
|
|
33
|
+
# the rain cloud.
|
|
34
|
+
require 'rouge'
|
|
35
|
+
# Saved files are written back, like when the folder's watched.
|
|
36
|
+
require_relative 'tui/saves'
|
|
37
|
+
saves = Saves.new(root)
|
|
38
|
+
Navigator.new(root:, path: (path unless File.directory?(path)), workers:, saves:, runs_endpoints: execute)
|
|
39
|
+
end.run
|
|
36
40
|
true
|
|
37
41
|
ensure
|
|
38
42
|
saves&.stop
|
|
@@ -51,9 +51,9 @@ module Raindown
|
|
|
51
51
|
|
|
52
52
|
# The files' metadata is loaded again each time, so new and renamed files are listed.
|
|
53
53
|
def rewrite
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
changed
|
|
54
|
+
rewrite = Rewriter.update(path:, bare:, execute:, metadata: Pages.for(path))
|
|
55
|
+
rewrite.failures.each { warn "Endpoint check failed: #{it}" }
|
|
56
|
+
rewrite.changed?
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
end
|
|
@@ -28,10 +28,9 @@ module Raindown
|
|
|
28
28
|
|
|
29
29
|
# Writing back saves the file again, and that save changes nothing, so it ends there.
|
|
30
30
|
def update(path)
|
|
31
|
-
|
|
32
|
-
puts "[#{name}] Updated #{relative(path)}" if changed
|
|
33
|
-
|
|
34
|
-
.each { warn "[#{name}] Endpoint check failed: #{it}" }
|
|
31
|
+
rewrite = Rewriter.update(path:, bare: @bare, execute: @execute, metadata: Pages.for(path))
|
|
32
|
+
puts "[#{name}] Updated #{relative(path)}" if rewrite.changed?
|
|
33
|
+
rewrite.failures.each { warn "[#{name}] Endpoint check failed: #{it}" }
|
|
35
34
|
rescue StandardError => e
|
|
36
35
|
raise if ENV['RAINDOWN_DEBUG']
|
|
37
36
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: raindown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- maedi
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-11-
|
|
10
|
+
date: 2026-11-05 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: antlers
|
|
@@ -251,6 +251,8 @@ files:
|
|
|
251
251
|
- lib/raindown/rewriter.rb
|
|
252
252
|
- lib/raindown/server.rb
|
|
253
253
|
- lib/raindown/stat.rb
|
|
254
|
+
- lib/raindown/table/markdown_table.rb
|
|
255
|
+
- lib/raindown/table/table.rb
|
|
254
256
|
- lib/raindown/table_formatter.rb
|
|
255
257
|
- lib/raindown/toc.rb
|
|
256
258
|
- lib/raindown/tui.rb
|
|
@@ -262,6 +264,7 @@ files:
|
|
|
262
264
|
- lib/raindown/tui/blueprints/traced_code.rb
|
|
263
265
|
- lib/raindown/tui/blueprints/tracing.rb
|
|
264
266
|
- lib/raindown/tui/card.rb
|
|
267
|
+
- lib/raindown/tui/cloud.rb
|
|
265
268
|
- lib/raindown/tui/code_box.rb
|
|
266
269
|
- lib/raindown/tui/endpoint.rb
|
|
267
270
|
- lib/raindown/tui/endpoints.rb
|
|
@@ -269,6 +272,7 @@ files:
|
|
|
269
272
|
- lib/raindown/tui/feelings/batch.rb
|
|
270
273
|
- lib/raindown/tui/feelings/bins.rb
|
|
271
274
|
- lib/raindown/tui/feelings/celebration/celebration.rb
|
|
275
|
+
- lib/raindown/tui/feelings/celebration/celebration_renderer.rb
|
|
272
276
|
- lib/raindown/tui/feelings/celebration/fireworks.rb
|
|
273
277
|
- lib/raindown/tui/feelings/celebration/rain.rb
|
|
274
278
|
- lib/raindown/tui/feelings/celebration/scene.rb
|
|
@@ -308,6 +312,7 @@ files:
|
|
|
308
312
|
- lib/raindown/tui/saves.rb
|
|
309
313
|
- lib/raindown/tui/search_box.rb
|
|
310
314
|
- lib/raindown/tui/terminal/input.rb
|
|
315
|
+
- lib/raindown/tui/terminal/loading.rb
|
|
311
316
|
- lib/raindown/tui/terminal/ncurses_shim.rb
|
|
312
317
|
- lib/raindown/tui/terminal/quiet.rb
|
|
313
318
|
- lib/raindown/tui/terminal/screen.rb
|