From a85c876dbe0b345c1ae713e8e38d701fc3d04469 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Thu, 14 Oct 2021 23:17:47 +0200 Subject: [PATCH] DEV: Remove warnings on console (#14608) We don't use oxipng from the image_optim gem and rake tasks complained that constants have already been initialized. --- lib/file_helper.rb | 3 ++- lib/file_store/base_store.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/file_helper.rb b/lib/file_helper.rb index d87da5a85e0..acdf958f361 100644 --- a/lib/file_helper.rb +++ b/lib/file_helper.rb @@ -127,7 +127,8 @@ class FileHelper jpegrecompress: false, # Skip looking for gifsicle, svgo binaries gifsicle: false, - svgo: false + svgo: false, + oxipng: false ) end end diff --git a/lib/file_store/base_store.rb b/lib/file_store/base_store.rb index 788e6cd5936..f3d948f45a1 100644 --- a/lib/file_store/base_store.rb +++ b/lib/file_store/base_store.rb @@ -3,8 +3,8 @@ module FileStore class BaseStore - UPLOAD_PATH_REGEX = %r|/(original/\d+X/.*)| - OPTIMIZED_IMAGE_PATH_REGEX = %r|/(optimized/\d+X/.*)| + UPLOAD_PATH_REGEX ||= %r|/(original/\d+X/.*)| + OPTIMIZED_IMAGE_PATH_REGEX ||= %r|/(optimized/\d+X/.*)| TEMPORARY_UPLOAD_PREFIX ||= "temp/" def store_upload(file, upload, content_type = nil)