Method: Webgen::PathHandler::Virtual#create_nodes
- Defined in:
- lib/webgen/path_handler/virtual.rb
#create_nodes(path, blocks) ⇒ Object
Create all virtual nodes which are specified in path.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/webgen/path_handler/virtual.rb', line 22 def create_nodes(path, blocks) if path..delete(:virtual) create_node(path) else read_entries(blocks) do |key, | ['modified_at'] = path.['modified_at'] ['no_output'] = true key = Webgen::Path.append(path.parent_path, key) parent_path = create_directories(File.dirname(key), 'modified_at' => ['modified_at']) dest_path = .delete('dest_path') || key dest_path = if Webgen::Path.absolute?(dest_path) dest_path elsif dest_path =~ /^\// "webgen:#{dest_path}" else "webgen:#{File.join(parent_path, dest_path)}" end ['dest_path'] = dest_path entry_path = Webgen::Path.new(key, ) if key =~ /\/$/ entry_path['handler'] = 'directory' @website.ext.path_handler.create_secondary_nodes(entry_path) else entry_path[:virtual] = true entry_path['handler'] = 'virtual' entry_path['node_class'] ||= Webgen::PathHandler::Base::Node.to_s @website.ext.path_handler.create_secondary_nodes(entry_path) end end nil end end |