lib/rack/blogengine/doc_parser.rb in rack-blogengine-0.0.1 vs lib/rack/blogengine/doc_parser.rb in rack-blogengine-0.0.2
- old
+ new
@@ -7,10 +7,13 @@
# path: "foo",
# html: HTML
# }]
#
# HTML contains Content, Style, JS etc...
+
+ # Parse in .content Documents.
+ # @param target.
def self.parseInDocuments(target)
@target = target
documents = []
@@ -33,10 +36,12 @@
end
return documents
end
+ # Get File Contents (path, title, content)
+ # @param file
def self.getFileContents(file)
# do work on real items
content_file = ::File.open("#{@target}/#{file}");
content = content_file.read
@@ -58,9 +63,11 @@
@content = contentblock
end
end
end
+ # Replace layout placeholder with content from .content file
+ # @param layout
def self.fillFileContents(layout)
layout.gsub! "{title}", @title
layout["{content}"] = @content
end
end
\ No newline at end of file