Skip to content

Commit

Permalink
fix lint errors reported by RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jun 28, 2023
1 parent 70c204d commit d08d646
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/asciidoctor/pdf/ext/core/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def absolute_path path, dir = nil

# NOTE: JRuby < 9.4 doesn't implement this method; JRuby 9.4 implements it incorrectly
def absolute_path? path
(::Pathname.new path).absolute? && !(%r/\A[[:alpha:]][[:alnum:]\-+]*:\/\/\S/.match? path)
(Pathname.new path).absolute? && !(%r/\A[[:alpha:]][[:alnum:]\-+]*:\/\/\S/.match? path)
end
end) if RUBY_ENGINE == 'jruby'
2 changes: 1 addition & 1 deletion lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Prawn::SVG::Elements::Image.prepend (Module.new do
def image_dimensions data
unless (handler = find_image_handler data)
raise ::Prawn::SVG::Elements::Base::SkipElementError, 'Unsupported image type supplied to image tag'
raise Prawn::SVG::Elements::Base::SkipElementError, 'Unsupported image type supplied to image tag'
end
image = handler.new data
[image.width.to_f, image.height.to_f]
Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor/pdf/ext/prawn/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

require 'prawn/icon'

Prawn::Icon::Compatibility.prepend (::Module.new { def warning *_args; end })
Prawn::Icon::Compatibility.prepend (Module.new { def warning *_args; end })

module Asciidoctor
module Prawn
Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor/pdf/theme_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ThemeLoader
LoneVariableRx = /^\$([a-z0-9_-]+)$/
HexColorEntryRx = /^(?<k> *\p{Graph}+): +(?!null$)(?<q>["']?)(?<h>#)?(?<v>\h\h\h\h{0,3})\k<q> *(?:#.*)?$/
MultiplyDivideOpRx = %r((-?\d+(?:\.\d+)?) +([*/^]) +(-?\d+(?:\.\d+)?))
AddSubtractOpRx = /(-?\d+(?:\.\d+)?) +([+\-]) +(-?\d+(?:\.\d+)?)/
AddSubtractOpRx = /(-?\d+(?:\.\d+)?) +([+-]) +(-?\d+(?:\.\d+)?)/
PrecisionFuncRx = /^(round|floor|ceil)\(/
RoleAlignKeyRx = /(?:_text)?_align$/

Expand Down
2 changes: 1 addition & 1 deletion spec/converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ def layout_heading title, opts
def ink_general_heading sect, title, opts = {}
if (image_path = sect.attr 'image')
image_attrs = { 'target' => image_path, 'pdfwidth' => '1in' }
image_block = ::Asciidoctor::Block.new sect.document, :image, content_model: :empty, attributes: image_attrs
image_block = Asciidoctor::Block.new sect.document, :image, content_model: :empty, attributes: image_attrs
convert_image image_block, relative_to_imagesdir: true, pinned: true
end
super
Expand Down

0 comments on commit d08d646

Please sign in to comment.