summaryrefslogtreecommitdiff
path: root/new/lib/crys/processors/common_functions.rb
diff options
context:
space:
mode:
authormms <git@sapka.me>2025-01-08 21:24:33 +0100
committermms <git@sapka.me>2025-01-08 21:24:33 +0100
commit4004a55b0e324c35cbc7d58b831e49efd484ab93 (patch)
tree3ff4c68c28165b6d08c1a49532e8421193433d65 /new/lib/crys/processors/common_functions.rb
parent2781360c7c25404c5a1fd03ed3472d43367ed8c6 (diff)
feat: rubocop
Diffstat (limited to 'new/lib/crys/processors/common_functions.rb')
-rw-r--r--new/lib/crys/processors/common_functions.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/new/lib/crys/processors/common_functions.rb b/new/lib/crys/processors/common_functions.rb
index f33c7681..9cf56692 100644
--- a/new/lib/crys/processors/common_functions.rb
+++ b/new/lib/crys/processors/common_functions.rb
@@ -1,13 +1,15 @@
+# frozen_string_literal: true
+
require 'rss'
module Crys
module CommonFunctions
def project_root
- "#{File.dirname(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__))))))}"
+ File.dirname(File.dirname(File.dirname(File.dirname(File.dirname(File.expand_path(__FILE__)))))).to_s
end
def process_image(file:, width: :auto)
- full_path = image_dir + "/" + file
+ full_path = "#{image_dir}/#{file}"
image = ::Crys::ImageProcessor.new(path: full_path, filename: file, width: width)
assets << image
@@ -19,10 +21,13 @@ module Crys
if name
path = case name
when :main
- "/public/index.xml"
+ '/public/index.xml'
end
rss = File.read(project_root + path)
+ else
+ puts url
+
end
RSS::Parser.parse(rss)