Parent

Class/Module Index [+]

Quicksearch

Webgen::SourceHandler::Directory

Handles directory source paths.

Public Instance Methods

create_directories(parent, dirname, path) click to toggle source

Recursively create the directories specified in dirname under parent (a leading slash is ignored). The path path is the path that lead to the creation of these directories.

# File lib/webgen/sourcehandler/directory.rb, line 16
def create_directories(parent, dirname, path)
  dirname.sub(/^\//, '').split('/').each do |dir|
    dir_path = Webgen::Path.new(File.join(parent.alcn, dir, '/'), path)
    nodes = website.blackboard.invoke(:create_nodes, dir_path, self) do |dir_path|
      node_exists?(dir_path) || create_node(dir_path)
    end
    parent = nodes.first
  end
  parent
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.