diff options
Diffstat (limited to 'new/lib/crys/builder.rb')
-rw-r--r-- | new/lib/crys/builder.rb | 14 |
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 |