Class: Puppet::Pal::ScriptCompiler
- Defined in:
- lib/puppet/pal/script_compiler.rb
Instance Method Summary collapse
-
#list_plans(filter_regex = nil, error_collector = nil) ⇒ Array<Puppet::Pops::Loader::TypedName>
Returns an array of TypedName objects for all plans, optionally filtered by a regular expression.
-
#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.
-
#plan_signature(plan_name) ⇒ Puppet::Pal::PlanSignature?
Returns the signature of the given plan name.
-
#task_signature(task_name) ⇒ Puppet::Pal::TaskSignature?
Returns the signature callable of the given task (the arguments it accepts, and the data type it returns).
Methods inherited from Compiler
#call_function, #create, #evaluate, #evaluate_file, #evaluate_literal, #evaluate_string, #function_signature, #has_catalog?, #initialize, #list_functions, #parse_file, #parse_string, #type
Constructor Details
This class inherits a constructor from Puppet::Pal::Compiler
Instance Method Details
#list_plans(filter_regex = nil, error_collector = nil) ⇒ Array<Puppet::Pops::Loader::TypedName>
Returns an array of TypedName objects for all plans, 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 plan 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.
36 37 38 |
# File 'lib/puppet/pal/script_compiler.rb', line 36 def list_plans(filter_regex = nil, error_collector = nil) list_loadable_kind(:plan, filter_regex, error_collector) end |
#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.
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 |
#plan_signature(plan_name) ⇒ Puppet::Pal::PlanSignature?
Returns the signature of the given plan name
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/puppet/pal/script_compiler.rb', line 10 def plan_signature(plan_name) loader = internal_compiler.loaders.private_environment_loader func = loader.load(:plan, plan_name) if func return PlanSignature.new(func) end # Could not find plan nil end |
#task_signature(task_name) ⇒ Puppet::Pal::TaskSignature?
Returns the signature callable of the given task (the arguments it accepts, and the data type it returns)
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/puppet/pal/script_compiler.rb', line 44 def task_signature(task_name) loader = internal_compiler.loaders.private_environment_loader task = loader.load(:task, task_name) if task return TaskSignature.new(task) end # Could not find task nil end |