Class: Webgen::SourceHandler::Directory
- Inherits:
-
Object
- Object
- Webgen::SourceHandler::Directory
- Includes:
- Base
- Defined in:
- lib/webgen/sourcehandler/directory.rb
Overview
Handles directory source paths.
Instance Method Summary collapse
-
#content(node) ⇒ Object
Return an empty string to signal that the directory should be written to the output.
-
#create_node(parent, path) ⇒ Object
Creation of directory nodes is special because once they are created, they are only deleted when the source path gets deleted.
Methods included from Base
#node_exists?, #output_path, #page_from_path
Methods included from Base::OutputPathHelpers
Methods included from Loggable
Instance Method Details
#content(node) ⇒ Object
Return an empty string to signal that the directory should be written to the output.
25 26 27 |
# File 'lib/webgen/sourcehandler/directory.rb', line 25 def content(node) '' end |
#create_node(parent, path) ⇒ Object
Creation of directory nodes is special because once they are created, they are only deleted when the source path gets deleted. Otherwise, only the meta information of the node gets updated.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/webgen/sourcehandler/directory.rb', line 13 def create_node(parent, path) if node = node_exists?(parent, path) node..clear node..update(path.) node.dirty = true node else super(parent, path) end end |