Skip to content

Commit af53285

Browse files
committed
Fix RuboCop offenses
1 parent 3bfb469 commit af53285

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/prawn_html/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def convert_color(value, options: nil)
4545

4646
if val.match /\A#([a-f0-9]{3})\Z/ # rubocop:disable Performance/RedundantMatch
4747
r, g, b = Regexp.last_match[1].chars
48-
return r * 2 + g * 2 + b * 2
48+
return (r * 2) + (g * 2) + (b * 2)
4949
end
5050
if val.match /\Argb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\Z/ # rubocop:disable Performance/RedundantMatch
5151
r, g, b = Regexp.last_match[1..3].map { |v| v.to_i.to_s(16) }

spec/integrations/lists_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
expected_array = [
5252
[x, y.round(5)],
5353
[x, (y - font.height - TestUtils.adjust_leading).round(5)],
54-
[x, (y - font.height * 2 - TestUtils.adjust_leading * 2).round(5)]
54+
[x, (y - (font.height * 2) - (TestUtils.adjust_leading * 2)).round(5)]
5555
]
5656

5757
expect(text_analysis.positions).to match_array(expected_array)

spec/integrations/styles_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
let(:expected_content) { ['Some content'] }
3030
let(:expected_positions) do
3131
[[
32-
(pdf.page.margins[:left] + (pdf.bounds.width - content_width) / 2).round(4),
32+
(pdf.page.margins[:left] + ((pdf.bounds.width - content_width) / 2)).round(4),
3333
(pdf.y - TestUtils.default_font.ascender).round(4)
3434
]]
3535
end
@@ -151,7 +151,7 @@
151151
text_analysis = PDF::Inspector::Text.analyze(pdf.render)
152152

153153
expect(text_analysis.strings).to eq(['aaa', 'bbb', 'ccc'])
154-
expect(text_analysis.character_spacing).to eq([1.5, 0.0] * 3 + [2.0, 0.0] * 3)
154+
expect(text_analysis.character_spacing).to eq(([1.5, 0.0] * 3) + ([2.0, 0.0] * 3))
155155
end
156156
end
157157

0 commit comments

Comments
 (0)