summaryrefslogtreecommitdiff
path: root/new/lib/crys/processors/common_functions.rb
diff options
context:
space:
mode:
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 f33c768..9cf5669 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)