Fix `Style/FormatStringToken` cop in paperclip color extractor

This commit is contained in:
Matt Jankowski 2024-03-14 12:32:20 -04:00
parent d9eee9bf9a
commit 8cce1a8c80
2 changed files with 1 additions and 2 deletions

View File

@ -91,7 +91,6 @@ Style/FetchEnvVar:
Style/FormatStringToken:
Exclude:
- 'config/initializers/devise.rb'
- 'lib/paperclip/color_extractor.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream:

View File

@ -183,7 +183,7 @@ module Paperclip
end
def rgb_to_hex(rgb)
format('#%02x%02x%02x', rgb.r, rgb.g, rgb.b)
format('#%<red>02x%<green>02x%<blue>02x', red: rgb.r, green: rgb.g, blue: rgb.b)
end
end
end