summaryrefslogtreecommitdiff
path: root/new/lib/crys/processors/html_processor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'new/lib/crys/processors/html_processor.rb')
-rw-r--r--new/lib/crys/processors/html_processor.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/new/lib/crys/processors/html_processor.rb b/new/lib/crys/processors/html_processor.rb
index 33116cef..5dd1387f 100644
--- a/new/lib/crys/processors/html_processor.rb
+++ b/new/lib/crys/processors/html_processor.rb
@@ -1,8 +1,7 @@
# frozen_string_literal: true
-require 'erb'
-require_relative 'common_functions'
-require_relative 'common_parts'
+require_relative 'mixins/common_functions'
+require_relative 'mixins/common_parts'
module Crys
class HtmlProcessor
@@ -15,15 +14,24 @@ module Crys
@assets = []
end
- def parsed_content
- html_file = ERB.new(File.read(file_path))
- html_file.result(local_binding)
+ def parsed_pages
+ [
+ ProcessedPage.new(
+ filename: filename,
+ content: html_content
+ )
+ ]
end
def filename
file_path.scan(%r{.*/(.*)\.erb}).flatten.first
end
+ def html_content
+ html_file = ERB.new(File.read(file_path))
+ html_file.result(local_binding)
+ end
+
attr_reader :assets, :file_path
private