jekyll_plugin_support 1.0.1 → 1.0.3
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 +21 -0
- data/README.md +1 -2
- data/lib/error/jekyll_custom_error.rb +3 -5
- data/lib/error/jekyll_plugin_error_handling.rb +1 -1
- data/lib/jekyll_plugin_support/version.rb +1 -1
- data/lib/tag/jekyll_plugin_support_tag.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4f3097e166568e130edb33f7dac7b366f0813bd9d21bc8e5e4687b7f8e9fbe2
|
4
|
+
data.tar.gz: d5523a0a88be86c56091eb906376507cd4b6d5e42e1722e90b5c568959ff03f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d7f3863be9bf780ecc5da65141be8ddda6b920ee354a4065b8f43e05d1532083b36537c8112494ef83e18ce0cf47b25ee45f25a3ba7af149240ba40ebe1f75
|
7
|
+
data.tar.gz: d5ba448bfd2b4bdbf01208e00d1b932b76293a7c6e78e7fe57f706c2dc8f9b3cd48af7867c0da38347dabdbda7e0f4420f739889f1e0aeda747b8f92bbee3b39
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
3
|
|
4
|
+
## 1.0.3 / 2024-08-19
|
5
|
+
|
6
|
+
* Still fussing with error handling
|
7
|
+
|
8
|
+
|
9
|
+
## 1.0.2 / 2024-08-19
|
10
|
+
|
11
|
+
* Computes line_number and path properly
|
12
|
+
* Refactored demo CSS
|
13
|
+
* Improved custom plugin error handling and sample code.
|
14
|
+
The following seems to be optimal for custom plugins; it suppresses the ridiculously long stack trace that used to be generated:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
rescue DemoInlineTagError => e # jekyll_plugin_support handles StandardError
|
18
|
+
@logger.error { e.logger_message }
|
19
|
+
exit! 1 if @die_on_demo_tag_error
|
20
|
+
|
21
|
+
e.html_message
|
22
|
+
```
|
23
|
+
|
24
|
+
|
4
25
|
## 1.0.1 / 2024-07-27
|
5
26
|
|
6
27
|
* Moved `warn_short_trace`, `maybe_reraise_error`, `remove_ansi_color`,
|
data/README.md
CHANGED
@@ -466,9 +466,8 @@ class DemoBlock < JekyllSupport::JekyllBlock
|
|
466
466
|
def render_impl(text)
|
467
467
|
raise DemoBlockTagError, 'Fall down, go boom.'
|
468
468
|
rescue DemoBlockTagError => e
|
469
|
-
e.shorten_backtrace
|
470
469
|
@logger.error e.logger_message
|
471
|
-
|
470
|
+
exit! 1 if @die_on_demo_block_error
|
472
471
|
|
473
472
|
e.html_message
|
474
473
|
end
|
@@ -16,15 +16,14 @@ module JekyllSupport
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def calling_file
|
19
|
-
file_fq, _line_number, _extra = backtrace[0]
|
19
|
+
file_fq, _line_number, _extra = backtrace[0]&.split(':')
|
20
20
|
file_fq
|
21
21
|
end
|
22
22
|
|
23
23
|
# @return HTML <div> tag with class set to the snake_case version of the error class name.
|
24
24
|
def html_message
|
25
25
|
shorten_backtrace
|
26
|
-
line_number =
|
27
|
-
path = self.class.class_variable_get :@@path
|
26
|
+
path, line_number, _caller = backtrace[1]&.split(':')
|
28
27
|
<<~END_MSG
|
29
28
|
<div class='#{error_name.snakecase}'>
|
30
29
|
#{self.class} raised in #{calling_file} while processing line #{line_number} (after front matter) of #{path}
|
@@ -36,8 +35,7 @@ module JekyllSupport
|
|
36
35
|
def logger_message
|
37
36
|
shorten_backtrace
|
38
37
|
kaller = caller(1..1).first
|
39
|
-
line_number =
|
40
|
-
path = self.class.class_variable_get :@@path
|
38
|
+
path, line_number, _caller = backtrace[1]&.split(':')
|
41
39
|
<<~END_MSG
|
42
40
|
#{error_name} raised in #{kaller} while processing line #{line_number} (after front matter) of #{path}
|
43
41
|
#{message}
|
@@ -34,7 +34,7 @@ module JekyllSupportError
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def maybe_reraise_error(error, throw_error: true)
|
37
|
-
fmsg =
|
37
|
+
fmsg = format_error_message "#{error.class}: #{error.message.strip}"
|
38
38
|
@logger.error { fmsg }
|
39
39
|
return "<span class='jekyll_plugin_support_error'>#{fmsg}</span>" unless throw_error
|
40
40
|
|
@@ -70,7 +70,7 @@ module JekyllSupport
|
|
70
70
|
|
71
71
|
<<~END_MSG
|
72
72
|
<div class='standard_error'>
|
73
|
-
#{e.class} on line #{@line_number}
|
73
|
+
#{e.class} on line #{@line_number} #{of_page}while processing #{tag_name} #{in_file_name} - #{e.message}
|
74
74
|
</div>
|
75
75
|
END_MSG
|
76
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_plugin_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.5.
|
143
|
+
rubygems_version: 3.5.17
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Provides a framework for writing and testing Jekyll plugins
|