diff --git a/docbook/asciidoctor-macros/commaize-block/extension.rb b/docbook/asciidoctor-macros/commaize-block/extension.rb index 9b37823b29..ae8fd30568 100644 --- a/docbook/asciidoctor-macros/commaize-block/extension.rb +++ b/docbook/asciidoctor-macros/commaize-block/extension.rb @@ -22,21 +22,18 @@ class CommaizeBlock < Extensions::BlockProcessor # XXX What's the difference between text, raw, simple, verbatim, etc? parse_content_as :simple - def process parent, reader, attrs + def process(parent, reader, attrs) lines = reader.lines sort = attrs.fetch('sort', 'true') == 'true' - lines.reject { |line| line.empty? } - lines = lines.collect(&:strip) - - if sort - lines = lines.sort_by { |line| line.downcase } - end + lines = lines.reject(&:empty?) + lines = lines.map(&:strip) + lines = lines.sort_by(&:downcase) if sort if lines.length < 2 create_paragraph parent, lines, attrs elsif lines.length == 2 - create_paragraph parent, (lines.join(" and ")), attrs + create_paragraph parent, lines.join(" and "), attrs else commaized = lines[0..-2].join(", ") commaized << ", and " + lines[-1] diff --git a/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb b/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb index a087c4cde3..8e2b741a25 100644 --- a/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb @@ -14,7 +14,7 @@ class CVEIdLinkInlineMacro < Extensions::InlineMacroProcessor named :cveidlink - def process parent, cvenum, attrs + def process(parent, cvenum, _attrs) cvename = "CVE-#{cvenum}" suffix = '' target = %(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cvenum}) diff --git a/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb b/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb index 7d09caf8ab..ddb1fbf188 100644 --- a/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb @@ -17,12 +17,8 @@ class WSBugLinkInlineMacro < Extensions::InlineMacroProcessor parse_content_as :text name_positional_attributes 'bugtext' - def process parent, bugnum, attrs - bugtext = if (attrs['bugtext']) - attrs['bugtext'] - else - %(Bug #{bugnum}) - end + def process(parent, bugnum, attrs) + bugtext = attrs['bugtext'] || %(Bug #{bugnum}) target = %(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=#{bugnum}) if parent.document.basebackend? 'html' parent.document.register :links, target diff --git a/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb b/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb index 1b8a078be0..b2c3caf077 100644 --- a/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb +++ b/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb @@ -14,7 +14,7 @@ class WSSALinkInlineMacro < Extensions::InlineMacroProcessor named :'wssalink' - def process parent, sanum, attrs + def process(parent, sanum, attrs) satext = "wnpa-sec-#{sanum}" target = %(https://www.wireshark.org/security/wnpa-sec-#{sanum}) if parent.document.basebackend? 'html'