Class: Puppet::Pal::ScriptCompiler
- Defined in:
- lib/puppet_pal.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.
275 276 277 |
# File 'lib/puppet_pal.rb', line 275 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.
307 308 309 |
# File 'lib/puppet_pal.rb', line 307 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
251 252 253 254 255 256 257 258 |
# File 'lib/puppet_pal.rb', line 251 def plan_signature(plan_name) loader = internal_compiler.loaders.private_environment_loader if func = loader.load(:plan, plan_name) 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)
283 284 285 286 287 288 289 290 |
# File 'lib/puppet_pal.rb', line 283 def task_signature(task_name) loader = internal_compiler.loaders.private_environment_loader if task = loader.load(:task, task_name) return TaskSignature.new(task) end # Could not find task nil end |