Parent

Methods

Included Modules

Class Index [+]

Quicksearch

Webgen::Tag::ExecuteCommand

Executes the given command and returns the standard output. All special HTML characters are escaped.

Constants

BIT_BUCKET

Public Instance Methods

call(tag, body, context) click to toggle source

Execute the command and return the standard output.

    # File lib/webgen/tag/executecommand.rb, line 18
18:     def call(tag, body, context)
19:       command = param('tag.executecommand.command')
20:       output = `#{command} 2> #{BIT_BUCKET}`
21:       if $?.exitstatus != 0
22:         raise Webgen::RenderError.new("Command '#{command}' has return value != 0: #{output}",
23:                                       self.class.name, context.dest_node, context.ref_node)
24:       end
25:       output = CGI::escapeHTML(output) if param('tag.executecommand.escape_html')
26:       [output, param('tag.executecommand.process_output')]
27:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.