Class MiscPlugins::RenderedFilesPlugin
In: lib/webgen/plugins/miscplugins/rendered_files.rb
Parent: Webgen::Plugin
Webgen::Plugin RenderedFilesPlugin SmileyReplacer SyntaxHighlighter lib/webgen/plugins/miscplugins/smileyreplacer.rb lib/webgen/plugins/miscplugins/syntax_highlighter.rb lib/webgen/plugins/miscplugins/rendered_files.rb MiscPlugins dot/m_53_0.png

This plugin registers as a listener for message :after_node_written with the ‘Core/FileHandler’ plugin.

When its callback is invoked, if the node in question is a file or directory it records the nodes fully expanded path in @files

The list of files currently rendered can then be retrieved by getting a handle on this plugin and calling files.

  Example:

      @plugin_manager['Misc/RenderedFiles'].files

Methods

new   record_file  

Attributes

files  [R] 

Public Class methods

[Source]

    # File lib/webgen/plugins/miscplugins/rendered_files.rb, line 57
57:     def initialize(plugin_manager)
58:       super
59:       @plugin_manager['Core/FileHandler'].add_msg_listener(:after_node_written, method(:record_file))
60:       @files = []
61:     end

Private Instance methods

we use expand_path to remove possible environmental parameters or ../’s in the path

[Source]

    # File lib/webgen/plugins/miscplugins/rendered_files.rb, line 69
69:     def record_file(node)
70:       if node.is_file? or node.is_directory? then
71:         @files << File.expand_path(node.full_path)
72:       end
73:     end

[Validate]