Method: Puppet::Pal::ScriptCompiler#list_tasks

Defined in:
lib/puppet/pal/script_compiler.rb

#list_tasks(filter_regex = nil, error_collector = nil) ⇒ Array<Puppet::Pops::Loader::TypedName>

Returns an array of TypedName objects for all tasks, optionally filtered by a regular expression. The returned array has more information than just the leaf name - the typical thing is to just get the name as showing the following example.

Errors that occur during task discovery will either be logged as warnings or collected by the optional ‘error_collector` array. When provided, it will receive DataTypes::Error instances describing each error in detail and no warnings will be logged.

Examples:

getting the names of all tasks

compiler.list_tasks.map {|tn| tn.name }

Parameters:

  • filter_regex (Regexp) (defaults to: nil)

    an optional regexp that filters based on name (matching names are included in the result)

  • error_collector (Array<Puppet::DataTypes::Error>) (defaults to: nil)

    an optional array that will receive errors during load

Returns:



70
71
72
# File 'lib/puppet/pal/script_compiler.rb', line 70

def list_tasks(filter_regex = nil, error_collector = nil)
  list_loadable_kind(:task, filter_regex, error_collector)
end