Class: Puppet::Pal::ScriptCompiler Private
- Defined in:
- lib/puppet/pal/script_compiler.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#list_plans(filter_regex = nil, error_collector = nil) ⇒ Array<Puppet::Pops::Loader::TypedName>
private
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>
private
Returns an array of TypedName objects for all tasks, optionally filtered by a regular expression.
-
#plan_signature(plan_name) ⇒ Puppet::Pal::PlanSignature?
private
Returns the signature of the given plan name.
-
#task_signature(task_name) ⇒ Puppet::Pal::TaskSignature?
private
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>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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.
34 35 36 |
# File 'lib/puppet/pal/script_compiler.rb', line 34 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>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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.
67 68 69 |
# File 'lib/puppet/pal/script_compiler.rb', line 67 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?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the signature of the given plan name
9 10 11 12 13 14 15 16 17 |
# File 'lib/puppet/pal/script_compiler.rb', line 9 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?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the signature callable of the given task (the arguments it accepts, and the data type it returns)
42 43 44 45 46 47 48 49 50 |
# File 'lib/puppet/pal/script_compiler.rb', line 42 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 |