jekyll_href 1.2.10 → 1.2.11

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: 7ff34de3543f22694104004179a170c7eccaed4ab74c8c454d5d6f9e7e1b95b6
4
- data.tar.gz: cba2381032c48b897e1f1835ce2484b0b5d1c589d077359bade41be88984c9f8
3
+ metadata.gz: 79cf3cccc7fc8072d6b2f7ae73d59845633f48026e0d0923d9749fbdcdd75ddf
4
+ data.tar.gz: 3e93f0d18068f86997210ddd93a3d90f899f28d82dd130c08177f4c70915e315
5
5
  SHA512:
6
- metadata.gz: ca46777a4c3d5bd9eeb1b859715d73f45ea793d97b183a862e25eb78c8688387bc91d25ca353c21cfe7b734e4a9aa74d5c12a163872b07dcd3cc1ca179393a18
7
- data.tar.gz: 25a5d7c61e1baf54b767a0b1824c263a52f0bfdf054a428b5290f655ca4c9fe701c633406c8c6da165d14bc0852a1b21a7fcba0f9e1dce03c10fb50917796259
6
+ metadata.gz: acafa56a136b24199a00febabfc2ff420974ae0d3e09eb6a772ce482691adc1709a765cc7a8e78ce7160eff6c819da8e72350c52160a8dc0c615cef4ee4063dc
7
+ data.tar.gz: c0c4e34adb9ef314b270f742860ee52ddcc82855f031693233ae8516d69e86c107bd0ed415958a872356e52e3afae58f5e82c53a4d43d5a8ae03a992b7f53adb
data/.rubocop.yml CHANGED
@@ -37,6 +37,9 @@ Metrics/BlockLength:
37
37
  - jekyll_plugin_support.gemspec
38
38
  Max: 30
39
39
 
40
+ Metrics/ClassLength:
41
+ Max: 150
42
+
40
43
  Metrics/CyclomaticComplexity:
41
44
  Max: 25
42
45
 
data/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+ ## 1.2.11 / 2024-07-27
5
+
6
+ * Fixed an unqualified reference to `JekyllPluginHelper`.
7
+ * Shortened the very long stack dump for an error condition.
8
+
9
+
4
10
  ## 1.2.10 / 2024-07-23
5
11
 
6
- * Make compatible with jekyll_plugin_support 1.0.0
12
+ * Make compatible with `jekyll_plugin_support` 1.0.0
7
13
 
8
14
 
9
15
  ## 1.2.9 / 2024-07-17
data/lib/hash_array.rb CHANGED
@@ -6,7 +6,7 @@ module HashArray
6
6
 
7
7
  def add_link_for_page(href, hash)
8
8
  enclosing_page = href.path
9
- hash[enclosing_page] = [] if hash[enclosing_page].nil?
9
+ hash[enclosing_page] = hash[enclosing_page] || []
10
10
  pre_existing = hash[enclosing_page].find { |h| h.link_save == href.link_save }
11
11
  if pre_existing
12
12
  if pre_existing.follow != href.follow
data/lib/href_match.rb CHANGED
@@ -1,4 +1,4 @@
1
- module MSlinn
1
+ module JekyllSupport
2
2
  class HRefTag
3
3
  private
4
4
 
@@ -1,4 +1,4 @@
1
- module MSlinn
1
+ module JekyllSupport
2
2
  class HRefTag
3
3
  private
4
4
 
data/lib/href_private.rb CHANGED
@@ -1,4 +1,4 @@
1
- module MSlinn
1
+ module JekyllSupport
2
2
  class HRefTag
3
3
  private
4
4
 
@@ -25,7 +25,7 @@ module MSlinn
25
25
  No URL was provided on #{@path}:#{@line_number} (after front matter).
26
26
  <pre>{% href #{@argument_string.strip} %}</pre>
27
27
  END_MESSAGE
28
- @logger.error { JekyllPluginHelper.remove_html_tags msg.strip }
28
+ @logger.error { JekyllSupport::JekyllPluginHelper.remove_html_tags msg.strip }
29
29
  "<div class='href_error'>HRefError: #{msg}</div>"
30
30
  end
31
31
 
data/lib/href_summary.rb CHANGED
@@ -1,4 +1,4 @@
1
- module MSlinn
1
+ module JekyllSupport
2
2
  class HRefTag
3
3
  private
4
4
 
@@ -2,10 +2,8 @@ require 'jekyll_plugin_logger'
2
2
  require 'jekyll_plugin_support'
3
3
  require_relative 'jekyll_href/version'
4
4
 
5
- module MSlinn
6
- class HrefSummary < JekyllSupport::JekyllTag
7
- include JekyllHrefVersion
8
-
5
+ module JekyllSupport
6
+ class HrefSummary < JekyllTag
9
7
  # Class instance variables accumulate hrefs across invocations.
10
8
  # These are hashes of arrays;
11
9
  # the hash keys are page paths (strings) and the hash values are arrays of HRefTags.
@@ -85,6 +83,6 @@ module MSlinn
85
83
  END_RENDER
86
84
  end
87
85
 
88
- ::JekyllSupport::JekyllPluginHelper.register(self, 'href_summary')
86
+ JekyllSupport::JekyllPluginHelper.register(self, 'href_summary')
89
87
  end
90
88
  end
data/lib/href_tag.rb CHANGED
@@ -11,13 +11,13 @@ require_relative 'hash_array'
11
11
  # @license SPDX-License-Identifier: Apache-2.0
12
12
  # Generates an href.
13
13
 
14
- module MSlinn
14
+ module JekyllSupport
15
15
  MiniHref = Struct.new(:follow, :html, :link, :line_number, :link_save, :path, :summary_exclude, :summary_href, keyword_init: true)
16
16
 
17
17
  HRefError = JekyllSupport.define_error
18
18
 
19
19
  # Implements href Jekyll tag
20
- class HRefTag < JekyllSupport::JekyllTag
20
+ class HRefTag < JekyllTag
21
21
  attr_reader :follow, :helper, :line_number, :link_save, :match, :page, :path, :site,
22
22
  :summary, :summary_exclude, :summary_href, :target, :text, :url
23
23
  attr_accessor :link
@@ -47,14 +47,15 @@ module MSlinn
47
47
  @helper_save = @helper.clone
48
48
  globals_update(@helper.argv, linkk) # Sets @link and @text, might clear @follow and @target
49
49
  handle_match(@link) if @match
50
- raise HrefError, "@link_type was not set" if @link_type == LinkType::UNKNOWN
50
+ raise HrefError, '@link_type was not set' if @link_type == LinkType::UNKNOWN
51
51
 
52
52
  save_summary
53
53
  klass = " class='#{@klass}'" if @klass
54
54
  style = " style='#{@style}'" if @style
55
55
  "<a href='#{@link}'#{klass}#{style}#{@target}#{@follow}>#{@text}</a>"
56
56
  rescue HRefError => e # jekyll_plugin_support handles StandardError
57
- msg = format_error_message "#{e.message}\n<pre> {% href #{@argument_string.strip} %}</pre>"
57
+ msg = format_error_message e.message
58
+ msg = "#{msg}\n<pre> {% href #{@argument_string.strip} %}</pre>"
58
59
  @text = "<div class='href_error'>#{msg}</div>"
59
60
  e.shorten_backtrace
60
61
  @logger.error "#{e.class} raised #{msg}"
@@ -68,7 +69,7 @@ module MSlinn
68
69
  "On line #{line_number} of #{path}: #{follow} #{match} #{target} #{link} => '#{text}'"
69
70
  end
70
71
 
71
- ::JekyllSupport::JekyllPluginHelper.register(self, 'href')
72
+ JekyllSupport::JekyllPluginHelper.register(self, 'href')
72
73
  end
73
74
  end
74
75
 
@@ -1,3 +1,3 @@
1
1
  module JekyllHrefVersion
2
- VERSION = '1.2.10'.freeze
2
+ VERSION = '1.2.11'.freeze
3
3
  end
data/lib/jekyll_href.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  require_relative 'href_tag'
2
2
  require_relative 'href_summary_tag'
3
3
 
4
- HrefError = Class.new Liquid::Error
5
-
6
- module JekyllHrefModule
7
- include MSlinn
4
+ module JekyllSupport
8
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_href
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.10
4
+ version: 1.2.11
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-26 00:00:00.000000000 Z
11
+ date: 2024-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ipaddress