summaryrefslogtreecommitdiff
path: root/new/lib/crys/builder.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/builder.rb
parent2781360c7c25404c5a1fd03ed3472d43367ed8c6 (diff)
feat: rubocop
Diffstat (limited to 'new/lib/crys/builder.rb')
-rw-r--r--new/lib/crys/builder.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/new/lib/crys/builder.rb b/new/lib/crys/builder.rb
index b8135c77..3b1ed388 100644
--- a/new/lib/crys/builder.rb
+++ b/new/lib/crys/builder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Crys
class Builder
def initialize(file_path:, output_dir:, image_dir:)
@@ -20,20 +22,20 @@ module Crys
def pages_db_manager
Crys::PagesDbManager.new
end
-
+
def process_assets
processor.assets.each do |asset|
- output_path = output_dir + "/" + asset.relative_path
- File.open(output_path, 'w') { |file| file.write(asset.processed_asset) }
+ output_path = "#{output_dir}/#{asset.relative_path}"
+ File.write(output_path, asset.processed_asset)
end
end
def process_content
content = processor.parsed_content
filename = processor.filename
- output_path = output_dir + "/" + filename
+ output_path = "#{output_dir}/#{filename}"
- File.open(output_path, 'w') { |file| file.write(content) }
+ File.write(output_path, content)
end
def processor_class
@@ -43,7 +45,7 @@ module Crys
when /xml.rb$/
rss_processor
else
- raise StandardError.new("No processor for #{file_path}")
+ raise StandardError, "No processor for #{file_path}"
end
end