jekyll_img 0.2.3 → 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: fda05bddcf8c3506b2a68947549a297afe1cceec2dd461c21cd24141d1ecfe8d
4
- data.tar.gz: 374733466b41e6f70209ec49db53cd0e177c77f712a050cdc5ed61fa0406fa7a
3
+ metadata.gz: 68b1a33d89b04dfab1851a2ba9adaac2ebeb7b7fbd91428cb2431f008f9226a1
4
+ data.tar.gz: ac86e8906b8d5e96d7295486f8e7b0ac2f76a825e2f9cd66d6072a5e644c0fb3
5
5
  SHA512:
6
- metadata.gz: bbdaa8fb03b1cba56b855e0f02d747175ca07e248cf7343d1ba2eb6304ffaf09d86f6b30a38b44cf0116585cd4e6ecfe356c3c61853846d1e1b3523d77c873cd
7
- data.tar.gz: 338caab74974775747ee4f21ab66c913dc2efd4a23ac0b2f9cb83d14add8f60e2a33d2d4dda3b0f72d20d782870deb4f1dbb067699d1abcd053368de021cb82f
6
+ metadata.gz: f44391734629f99eedf6d62579bf3e4342ba334f20b6bc7b67e6a046cca8f774cc8e181fbc9c5c4c0661d6ba532c6cc525a8de62cf6f5ce049eea4c7766bc0b5
7
+ data.tar.gz: d7fa41d16eb7b23368ce08dddb59574a5c71b5a4afab28705bd16b44ab7b10d527db90e068d51ef91780e1cb950fb1a23953bc5d1922d2c0800a1d81418d34fc
data/.rubocop.yml CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
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
+
17
+ ## 0.2.4 / 2024-07-23
18
+
19
+ * Depends on jekyll_plugin_support v1.0.0
20
+
21
+
3
22
  ## 0.2.3 / 2024-04-27
4
23
 
5
24
  * Depends on jekyll_plugin_support v0.8.5
data/LICENSE.txt CHANGED
File without changes
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/Rakefile CHANGED
File without changes
data/jekyll_img.gemspec CHANGED
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.version = JekyllImgVersion::VERSION
29
29
 
30
30
  spec.add_dependency 'jekyll', '>= 3.5.0'
31
- spec.add_dependency 'jekyll_plugin_support', '>= 0.8.5'
31
+ spec.add_dependency 'jekyll_plugin_support', '>= 1.0.0'
32
32
  end
data/lib/img_builder.rb CHANGED
File without changes
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.3'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
data/lib/jekyll_img.rb CHANGED
@@ -13,10 +13,10 @@ module ImgModule
13
13
  end
14
14
 
15
15
  module Jekyll
16
- ImgError = JekyllSupport.define_error
16
+ ImgError = ::JekyllSupport.define_error
17
17
 
18
18
  # Plugin implementation
19
- class Img < JekyllSupport::JekyllTag
19
+ class Img < ::JekyllSupport::JekyllTag
20
20
  include JekyllImgVersion
21
21
 
22
22
  def render_impl
@@ -47,15 +47,13 @@ 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
- JekyllPluginHelper.register(self, ImgModule::PLUGIN_NAME)
57
+ ::JekyllSupport::JekyllPluginHelper.register(self, ImgModule::PLUGIN_NAME)
60
58
  end
61
59
  end
File without changes
File without changes
File without changes
data/spec/spec_helper.rb CHANGED
File without changes
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.3
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-04-28 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
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.5
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.5
40
+ version: 1.0.0
41
41
  description:
42
42
  email:
43
43
  - mslinn@mslinn.com
@@ -59,7 +59,6 @@ files:
59
59
  - spec/img_props_spec.rb
60
60
  - spec/jekyll_img_spec.rb
61
61
  - spec/spec_helper.rb
62
- - spec/status_persistence.txt
63
62
  homepage: https://www.mslinn.com/jekyll_plugins/jekyll_img.html
64
63
  licenses:
65
64
  - MIT
@@ -87,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
86
  - !ruby/object:Gem::Version
88
87
  version: '0'
89
88
  requirements: []
90
- rubygems_version: 3.3.3
89
+ rubygems_version: 3.5.17
91
90
  signing_key:
92
91
  specification_version: 4
93
92
  summary: Provides a Jekyll tag that generates images.
@@ -96,5 +95,4 @@ test_files:
96
95
  - spec/img_props_spec.rb
97
96
  - spec/jekyll_img_spec.rb
98
97
  - spec/spec_helper.rb
99
- - spec/status_persistence.txt
100
98
  ...
@@ -1,10 +0,0 @@
1
- example_id | status | run_time |
2
- ------------------------------- | ------ | --------------- |
3
- ./spec/img_builder_spec.rb[1:1] | passed | 0.00073 seconds |
4
- ./spec/img_props_spec.rb[1:1] | passed | 0.0001 seconds |
5
- ./spec/img_props_spec.rb[1:2] | passed | 0.00008 seconds |
6
- ./spec/img_props_spec.rb[1:3] | failed | 0.00051 seconds |
7
- ./spec/img_props_spec.rb[1:4] | passed | 0.0011 seconds |
8
- ./spec/img_props_spec.rb[1:5] | passed | 0.00019 seconds |
9
- ./spec/img_props_spec.rb[1:6] | failed | 0.00008 seconds |
10
- ./spec/jekyll_img_spec.rb[1:1] | failed | 0.00037 seconds |