jekyll_img 0.2.4 → 0.2.5

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: 8c2e88e7ebb6182b1e60c4f4ac59eaf46c28e21434706b4887c63cb9a8f84b25
4
- data.tar.gz: 33e4bba4d05ea7bd18dd7ee6941f3b81c3723a3a4f5a32e948e4a60cfe991df5
3
+ metadata.gz: 68b1a33d89b04dfab1851a2ba9adaac2ebeb7b7fbd91428cb2431f008f9226a1
4
+ data.tar.gz: ac86e8906b8d5e96d7295486f8e7b0ac2f76a825e2f9cd66d6072a5e644c0fb3
5
5
  SHA512:
6
- metadata.gz: 676baaea8845b9c9bb3c66ca103355e949105e70effa250ded10373de3bcd0ef366e6843bee407d53f4b13440c7899760648c2bd3bd2936b6e83fdcfe0d5f0c0
7
- data.tar.gz: aa6d2cbd168bdd77190e6e1d549bc729bae606d1cf06f5e6ebc5ffef03940557445f9fdd34dd1736b0316d519bda3475e2f883d8ff8e5919a9c84c1dc2984d26
6
+ metadata.gz: f44391734629f99eedf6d62579bf3e4342ba334f20b6bc7b67e6a046cca8f774cc8e181fbc9c5c4c0661d6ba532c6cc525a8de62cf6f5ce049eea4c7766bc0b5
7
+ data.tar.gz: d7fa41d16eb7b23368ce08dddb59574a5c71b5a4afab28705bd16b44ab7b10d527db90e068d51ef91780e1cb950fb1a23953bc5d1922d2c0800a1d81418d34fc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.2.5 / 2024-07-23
4
+
5
+ * Depends on jekyll_plugin_support v1.0.2
6
+ * Error handling improved
7
+ * Corrected `README.md#Configuration` and fixed demo `_config.yml`
8
+ so they correctly specify error handling for this plugin:
9
+
10
+ ```ruby
11
+ img:
12
+ die_on_img_error: false
13
+ pry_on_img_error: false
14
+ ```
15
+
16
+
3
17
  ## 0.2.4 / 2024-07-23
4
18
 
5
19
  * Depends on jekyll_plugin_support v1.0.0
data/README.md CHANGED
@@ -151,7 +151,7 @@ By default, errors cause Jekyll to abort.
151
151
  You can allow Jekyll to halt by setting the following in `_config.yml`:
152
152
 
153
153
  ```yaml
154
- jekyll_img:
154
+ img:
155
155
  die_on_img_error: true
156
156
  pry_on_img_error: true
157
157
  ```
data/lib/img_props.rb CHANGED
@@ -67,8 +67,6 @@ class ImgProperties
67
67
  end
68
68
 
69
69
  def src_any(filetype)
70
- raise Jekyll::ImgError, "The 'src' parameter was not specified" if @src.to_s.empty?
71
-
72
70
  @src.gsub('.webp', ".#{filetype}")
73
71
  end
74
72
 
@@ -86,8 +84,12 @@ class ImgProperties
86
84
  private
87
85
 
88
86
  def setup_src
87
+ raise Jekyll::ImgError, "The 'src' parameter was not specified" if @src.nil?
88
+
89
+ raise Jekyll::ImgError, "The 'src' parameter was empty" if @src.empty?
90
+
89
91
  @src = @src.to_s.strip
90
- raise Jekyll::ImgError, "The 'src' parameter was not specified" if @src.empty?
92
+ raise Jekyll::ImgError, "The 'src' parameter only contained whitespace" if @src.empty?
91
93
 
92
94
  filetype = File.extname(URI(@src).path)
93
95
  @src += '.webp' if filetype.empty?
@@ -1,3 +1,3 @@
1
1
  module JekyllImgVersion
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
data/lib/jekyll_img.rb CHANGED
@@ -47,13 +47,11 @@ module Jekyll
47
47
  @builder = ImgBuilder.new(props)
48
48
  @builder.to_s
49
49
  rescue ImgError => e # jekyll_plugin_support handles StandardError
50
- e.shorten_backtrace
51
- msg = format_error_message e.message
52
- @logger.error { "#{e.class} raised #{msg}" }
50
+ @logger.error { e.logger_message }
53
51
  binding.pry if @pry_on_img_error # rubocop:disable Lint/Debugger
54
- raise e if @die_on_img_error
52
+ exit! 1 if @die_on_img_error
55
53
 
56
- "<div class='jekyll_img_error'>#{e.class} raised in #{@tag_name} tag\n#{msg}</div>"
54
+ e.html_message
57
55
  end
58
56
 
59
57
  ::JekyllSupport::JekyllPluginHelper.register(self, ImgModule::PLUGIN_NAME)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_img
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-26 00:00:00.000000000 Z
11
+ date: 2024-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.5.16
89
+ rubygems_version: 3.5.17
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Provides a Jekyll tag that generates images.