jekyll_plugin_support 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eab3c711a499142ca58c0c2083dbac62072dd98f86dd343c57dda2d7603aed8b
4
- data.tar.gz: 101b79a6402931862a23be32c12fd3a8152b56aa3644f38cd73a1a7d2bde9a2e
3
+ metadata.gz: fc8c02963da77be335a8e4713e9bcffc12395912733d31781e16198f9f9392f0
4
+ data.tar.gz: 8851a2ede60d7a70f0cb7eab711c7a3cb06da87d9764740d5dd50a385ee8066d
5
5
  SHA512:
6
- metadata.gz: a82cb83ce7c34268e79c0c4715832442cab58bd2e49a67ee849bf7d0fbd378bb068f0a5e499db9ccbace3567b04e95b5d0efd061a8d6f21a164a4ef6cc881efe
7
- data.tar.gz: 0e6328a5b3e0fc4320c999cc88cfa13a92cacf5279027afe26bcff5f0dc9f56404f14747124b403bf417815282ac7025fd9fcf9e7e161aeb6bf6a54fd4d47571
6
+ metadata.gz: 06b06073d76ba15d23d69d585d3148edd0e2adcd86ffc0b6d7982d2659989aad9da79b6adab83220c9c4299354e423a4bc3490ace1f2c1348d5e9a01e1b848c8
7
+ data.tar.gz: 9e9bd5db4569abe954ba547e38538c62ecf99037f772a893ef73a1fe68c9a9766df4c15069f6e1ff3aea578913d92e91922ab076c2be632540eb1e31a73e33a4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+ ## 1.0.2 / 2024-08-19
5
+
6
+ * Computes line_number and path properly
7
+ * Refactored demo CSS
8
+ * Improved custom plugin error handling and sample code.
9
+ The following seems to be optimal for custom plugins; it suppresses the ridiculously long stack trace that used to be generated:
10
+
11
+ ```ruby
12
+ rescue DemoInlineTagError => e # jekyll_plugin_support handles StandardError
13
+ @logger.error e.logger_message
14
+ exit! 1 if @die_on_demo_tag_error
15
+
16
+ e.html_message
17
+ ```
18
+
19
+
4
20
  ## 1.0.1 / 2024-07-27
5
21
 
6
22
  * 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
- raise e if @die_on_demo_block_error
470
+ exit! 1 if @die_on_demo_block_error
472
471
 
473
472
  e.html_message
474
473
  end
@@ -23,8 +23,7 @@ module JekyllSupport
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 = self.class.class_variable_get :@@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 = self.class.class_variable_get :@@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}
@@ -1,3 +1,3 @@
1
1
  module JekyllPluginSupportVersion
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  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.1
4
+ version: 1.0.2
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-07-27 00:00:00.000000000 Z
11
+ date: 2024-08-19 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.16
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