summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2023-06-28 14:05:27 -0600
committerDan Allen <dan.j.allen@gmail.com>2023-06-28 14:05:27 -0600
commitd08d64656041bcb1711677e86d68225f0f488396 (patch)
treee9348a4cc97cdc221fe8de1f0e6d8ebb66ce56fa
parent70c204da2f0f9d73d25798fe026e30acbd37d114 (diff)
fix lint errors reported by RuboCop
-rw-r--r--lib/asciidoctor/pdf/ext/core/file.rb2
-rw-r--r--lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb2
-rw-r--r--lib/asciidoctor/pdf/ext/prawn/extensions.rb2
-rw-r--r--lib/asciidoctor/pdf/theme_loader.rb2
-rw-r--r--spec/converter_spec.rb2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/asciidoctor/pdf/ext/core/file.rb b/lib/asciidoctor/pdf/ext/core/file.rb
index 4fe96787..68da668b 100644
--- a/lib/asciidoctor/pdf/ext/core/file.rb
+++ b/lib/asciidoctor/pdf/ext/core/file.rb
@@ -9,6 +9,6 @@ File.singleton_class.prepend (Module.new do
# 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'
diff --git a/lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb b/lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
index f2af264c..421704f1 100644
--- a/lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
+++ b/lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
@@ -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]
diff --git a/lib/asciidoctor/pdf/ext/prawn/extensions.rb b/lib/asciidoctor/pdf/ext/prawn/extensions.rb
index 02d176a3..0b5e83ff 100644
--- a/lib/asciidoctor/pdf/ext/prawn/extensions.rb
+++ b/lib/asciidoctor/pdf/ext/prawn/extensions.rb
@@ -4,7 +4,7 @@ Prawn::Font::AFM.instance_variable_set :@hide_m17n_warning, true
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
diff --git a/lib/asciidoctor/pdf/theme_loader.rb b/lib/asciidoctor/pdf/theme_loader.rb
index f4a600a7..12dffc8d 100644
--- a/lib/asciidoctor/pdf/theme_loader.rb
+++ b/lib/asciidoctor/pdf/theme_loader.rb
@@ -22,7 +22,7 @@ module Asciidoctor
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$/
diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb
index e67cb3a1..86042999 100644
--- a/spec/converter_spec.rb
+++ b/spec/converter_spec.rb
@@ -1390,7 +1390,7 @@ describe Asciidoctor::PDF::Converter do
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