From 5a0eb7b6495e600c3a94c05375b143a36e3fb1a8 Mon Sep 17 00:00:00 2001 From: Igor Depolli Date: Mon, 8 Jul 2024 09:52:47 -0300 Subject: [PATCH] Improve truncate uri path method --- lib/vitals_image/analyzer/url_analyzer.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vitals_image/analyzer/url_analyzer.rb b/lib/vitals_image/analyzer/url_analyzer.rb index 0eb421d..d80df44 100644 --- a/lib/vitals_image/analyzer/url_analyzer.rb +++ b/lib/vitals_image/analyzer/url_analyzer.rb @@ -48,8 +48,9 @@ def download end def truncate_uri_path(uri_path) - filename, extension = uri_path.split(".") - filename = filename[0..200] + parts = uri_path.split(".") + filename = parts.first[0..200] + extension = parts.last [filename, extension].join(".") end