From: Tom Hughes Date: Tue, 18 Feb 2025 20:25:55 +0000 (+0000) Subject: Fix rubocop warnings X-Git-Tag: live~93 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/79f5ccca31551ecc199ef9d81fdc64bdbbfe41d4?hp=--cc Fix rubocop warnings --- 79f5ccca31551ecc199ef9d81fdc64bdbbfe41d4 diff --git a/lib/rich_text.rb b/lib/rich_text.rb index f38de7621..84e695c6e 100644 --- a/lib/rich_text.rb +++ b/lib/rich_text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RichText SPAMMY_PHRASES = [ "Business Description:", "Additional Keywords:" @@ -144,7 +146,7 @@ module RichText end def truncated_text_content(element) - text = String.new + text = +"" append_text = lambda do |child| if child.type == :text diff --git a/lib/short_link.rb b/lib/short_link.rb index 2dfb0fb58..eb73d6029 100644 --- a/lib/short_link.rb +++ b/lib/short_link.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ## # Encodes and decodes locations from Morton-coded "quad tile" strings. Each # variable-length string encodes to a precision of one pixel per tile (roughly, @@ -57,7 +59,7 @@ module ShortLink def encode(lon, lat, z) code = interleave_bits(((lon + 180.0) * (2**32) / 360.0).to_i, ((lat + 90.0) * (2**32) / 180.0).to_i) - str = String.new + str = +"" # add eight to the zoom level, which approximates an accuracy of # one pixel in a tile. ((z + 8) / 3.0).ceil.times do |i|