raindown 0.17.0 → 0.17.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2abf28897b1c392d34ec786d7abad550414050fe3f45949929240fa31453cf23
4
- data.tar.gz: edafdc330bddeaf1b76a4d6538b1e3db9241c1758526d0076b0ffe76d5aac32a
3
+ metadata.gz: c619df9532ee1f014b8837488ac3fe8cc4b3183e7abad17791fb27bb74491499
4
+ data.tar.gz: aad7d7aefc311af905d14afecd4960096b9cebab871c2da957e4ca05cb85c503
5
5
  SHA512:
6
- metadata.gz: 5ce17ac9171dfa2d3a37311698f53e89390eccd2d3105a60adef58136f6bf4f741162ecd6eea0edc10a341434aaa58b1b8832e1971cc1ae3498771255616e3ce
7
- data.tar.gz: 15ff81a860a3403f8bca98ca63052be5d8ff1cc9feda5da235f6b753ffd92f74ba313471ac60d7b61c59fb7c84f38bd05e8dd7dfa68877a66d84bd5251499217
6
+ metadata.gz: 91c9a12c3bd15d3c9f4ba9e41f645ee5f6ca8447b6208c38d3dd422702acc5f2395161ddb47ae60f248af9707d3c9d53edfa0d4d1dccb78d8aee99987e5c8de3
7
+ data.tar.gz: cd30f02347aae3834e30c0d77e8ee62b74379f005b844ef8c6b6f03f0638ad11ee7da3980b0978c4145b67dbd3144ce395c4abc7c6d8e2f57102a8e2afeb5534
@@ -13,7 +13,7 @@ module Raindown
13
13
  # {"id": 1, "path": "/notes/a.md", "markdown": "<!-- toc: -->", "rewrite": true}
14
14
  # {"id": 1, "output": "<!-- toc: -->\n- ...", "warnings": []}
15
15
  # Rewriting answers like --stdin --rewrite, with "execute" like -x, and otherwise it's HTML, like --stdin. An error's
16
- # answered as {"id": 1, "error": "raindown: /notes/a.md: ..."}, like the CLI writes it.
16
+ # answered as {"id": 1, "error": "/notes/a.md: ..."}, like the CLI writes it.
17
17
  # Each project renders in a worker of its own, which starts again when its .raindown folder changes, so its nodes,
18
18
  # config and schemas are never stale. Without fork, as on Windows, node changes need the server started again.
19
19
  class Server
@@ -33,13 +33,14 @@ module Raindown
33
33
 
34
34
  private
35
35
 
36
+ # Any error is the answer, as an editor's only got its server, and one note can't be allowed to stop it.
36
37
  def answer(line)
37
38
  request = JSON.parse(line)
38
39
  { id: request['id'], **edit(request) }
39
- rescue JSON::ParserError, KeyError => e
40
- { id: request&.dig('id'), error: "raindown: #{e.message}" }
41
40
  rescue Workers::Worker::Error => e
42
- { id: request['id'], error: "raindown: #{request['path']}: #{e.message}" }
41
+ { id: request['id'], error: "#{request['path']}: #{e.message}" }
42
+ rescue StandardError => e
43
+ { id: (request['id'] if request.is_a?(Hash)), error: e.message.to_s }
43
44
  end
44
45
 
45
46
  def edit(request)
@@ -59,7 +60,7 @@ module Raindown
59
60
  end
60
61
 
61
62
  def nodes_changed?(project)
62
- stamp = Dir.glob(File.join(project, Nodes::FOLDER, '**', '*')).to_h { [it, File.mtime(it)] }
63
+ stamp = Dir.glob(File.join(project, Nodes::FOLDER, '**', '*')).to_h { [it, File.lstat(it).mtime] }
63
64
  changed = @stamps.key?(project) && @stamps[project] != stamp
64
65
  @stamps[project] = stamp
65
66
  changed
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Raindown
4
- VERSION = '0.17.0'
4
+ VERSION = '0.17.1'
5
5
  end
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.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-11-07 00:00:00.000000000 Z
10
+ date: 2026-11-08 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: antlers