This module is used for defining all methods that can be used for creating output paths.
All public methods of this module are considered to be output path creation methods and must have the following parameters:
the parent node
the path for which the output name should be created
controls whether the output path name has to include the language part
Default method for creating an output path for parent and source path.
The automatically set parameter style (which uses the meta information output_path_style from the path's meta information hash) defines how the output name should be built (more information about this in the user documentation).
# File lib/webgen/sourcehandler/base.rb, line 144 def standard_output_path(parent, path, use_lang_part, style = path.meta_info['output_path_style']) result = style.collect do |part| case part when String then part when :lang then use_lang_part ? path.meta_info['lang'] : '' when :ext then path.ext.empty? ? '' : '.' + path.ext when :parent then temp = parent; temp = temp.parent while temp.is_fragment?; temp.path when :year, :month, :day ctime = path.meta_info['created_at'] if !ctime.kind_of?(Time) raise Webgen::NodeCreationError.new("Invalid meta info 'created_at', needed because of used output path style", self.class.name, path) end ctime.send(part).to_s.rjust(2, '0') when Symbol then path.send(part) when Array then part.include?(:lang) && !use_lang_part ? '' : standard_output_path(parent, path, use_lang_part, part) else '' end end result.join('') end
Generated with the Darkfish Rdoc Generator 2.