Class: Puppet::Pops::Validation::TasksChecker Private
- Inherits:
-
Checker4_0
- Object
- Evaluator::LiteralEvaluator
- Checker4_0
- Puppet::Pops::Validation::TasksChecker
- Defined in:
- lib/puppet/pops/validation/tasks_checker.rb
Overview
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.
Validator that limits the set of allowed expressions to not include catalog related operations
Constant Summary
Constants inherited from Checker4_0
Checker4_0::BAD_MODULE_FILE, Checker4_0::FUTURE_RESERVED_WORDS, Checker4_0::NO_NAMESPACE, Checker4_0::NO_PATH, Checker4_0::RESERVED_PARAMETERS, Checker4_0::RESERVED_TYPE_NAMES
Constants inherited from Evaluator::LiteralEvaluator
Evaluator::LiteralEvaluator::COMMA_SEPARATOR
Instance Attribute Summary
Attributes inherited from Checker4_0
Instance Method Summary collapse
- #check_ApplyExpression(o) ⇒ Object private
- #check_CollectExpression(o) ⇒ Object private
- #check_HostClassDefinition(o) ⇒ Object private
- #check_NodeDefinition(o) ⇒ Object private
- #check_RelationshipExpression(o) ⇒ Object private
- #check_ResourceDefaultsExpression(o) ⇒ Object private
- #check_ResourceExpression(o) ⇒ Object private
- #check_ResourceOverrideExpression(o) ⇒ Object private
- #check_ResourceTypeDefinition(o) ⇒ Object private
- #illegalTasksExpression(o) ⇒ Object private
- #in_ApplyExpression? ⇒ Boolean private
- #resource_without_title?(o) ⇒ Boolean private
Methods inherited from Checker4_0
#assign, #assign_AccessExpression, #assign_LiteralList, #assign_Object, #assign_VariableExpression, #check, #check_AccessExpression, #check_AssignmentExpression, #check_AttributeOperation, #check_AttributesOperation, #check_BinaryExpression, #check_BlockExpression, #check_CallNamedFunctionExpression, #check_CaseExpression, #check_CaseOption, #check_EppExpression, #check_Factory, #check_FunctionDefinition, #check_HeredocExpression, #check_IfExpression, #check_KeyedEntry, #check_LambdaExpression, #check_LiteralHash, #check_LiteralInteger, #check_LiteralList, #check_MethodCallExpression, #check_NamedAccessExpression, #check_NamedDefinition, #check_Object, #check_Parameter, #check_QualifiedName, #check_QualifiedReference, #check_QueryExpression, #check_ReservedWord, #check_ResourceBody, #check_SelectorEntry, #check_SelectorExpression, #check_TypeAlias, #check_TypeDefinition, #check_TypeMapping, #check_UnaryExpression, #check_UnlessExpression, #check_VariableExpression, check_visitor, #container, #dir_to_names, #ends_with_idem, #hostname, #hostname_Array, #hostname_ConcatenatedString, #hostname_LiteralDefault, #hostname_LiteralNumber, #hostname_LiteralRegularExpression, #hostname_LiteralValue, #hostname_Object, #hostname_QualifiedName, #hostname_QualifiedReference, #hostname_String, #idem, #idem_AccessExpression, #idem_ApplyExpression, #idem_AssignmentExpression, #idem_BinaryExpression, #idem_BlockExpression, #idem_CaseExpression, #idem_CaseOption, #idem_ConcatenatedString, #idem_Factory, #idem_HeredocExpression, #idem_IfExpression, #idem_Literal, #idem_LiteralHash, #idem_LiteralList, #idem_MatchExpression, #idem_NilClass, #idem_Nop, #idem_Object, #idem_ParenthesizedExpression, #idem_RelationshipExpression, #idem_RenderExpression, #idem_RenderStringExpression, #idem_SelectorExpression, #idem_UnaryExpression, #initial_manifest?, #initialize, #internal_check_capture_last, #internal_check_file_namespace, #internal_check_future_reserved_word, #internal_check_illegal_assignment, #internal_check_no_capture, #internal_check_no_idem_last, #internal_check_parameter_name_uniqueness, #internal_check_parameter_type_literal, #internal_check_reserved_params, #internal_check_reserved_type_name, #internal_check_return_type, #internal_check_top_construct_in_module, #internal_check_type_ref, #namespace_for_file, #pattern_with_replacement?, #query, #query_BooleanExpression, #query_ComparisonExpression, #query_LiteralBoolean, #query_LiteralNumber, #query_LiteralString, #query_Object, #query_ParenthesizedExpression, #query_QualifiedName, #query_VariableExpression, #relation, #relation_CollectExpression, #relation_Object, #relation_RelationshipExpression, #rvalue, #rvalue_CollectExpression, #rvalue_Definition, #rvalue_Expression, #rvalue_NodeDefinition, #rvalue_UnaryExpression, #top, #type_ref?, #valid_top_construct?, #validate, #varname_to_s
Methods included from Evaluator::ExternalSyntaxSupport
#assert_external_syntax, #checker_for_syntax, #lookup_keys_for_syntax
Methods inherited from Evaluator::LiteralEvaluator
#initialize, #literal, #literal_AccessExpression, #literal_ConcatenatedString, #literal_Factory, #literal_LiteralBoolean, #literal_LiteralDefault, #literal_LiteralHash, #literal_LiteralList, #literal_LiteralNumber, #literal_LiteralRegularExpression, #literal_LiteralString, #literal_LiteralUndef, #literal_Object, #literal_Program, #literal_QualifiedName, #literal_QualifiedReference, #literal_UnaryMinusExpression
Constructor Details
This class inherits a constructor from Puppet::Pops::Validation::Checker4_0
Instance Method Details
#check_ApplyExpression(o) ⇒ Object
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.
78 79 80 81 82 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 78 def check_ApplyExpression(o) if in_ApplyExpression? acceptor.accept(Issues::EXPRESSION_NOT_SUPPORTED_WHEN_COMPILING, o, {:klass => o}) end end |
#check_CollectExpression(o) ⇒ Object
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.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 16 def check_CollectExpression(o) # Only virtual resource queries are allowed in apply blocks, not exported # resource queries if in_ApplyExpression? if o.query.is_a?(Puppet::Pops::Model::VirtualQuery) super(o) else acceptor.accept(Issues::EXPRESSION_NOT_SUPPORTED_WHEN_COMPILING, o, {:klass => o}) end else illegalTasksExpression(o) end end |
#check_HostClassDefinition(o) ⇒ Object
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.
30 31 32 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 30 def check_HostClassDefinition(o) illegalTasksExpression(o) end |
#check_NodeDefinition(o) ⇒ Object
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.
34 35 36 37 38 39 40 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 34 def check_NodeDefinition(o) if in_ApplyExpression? super(o) else illegalTasksExpression(o) end end |
#check_RelationshipExpression(o) ⇒ Object
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.
42 43 44 45 46 47 48 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 42 def check_RelationshipExpression(o) if in_ApplyExpression? super(o) else illegalTasksExpression(o) end end |
#check_ResourceDefaultsExpression(o) ⇒ Object
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.
50 51 52 53 54 55 56 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 50 def check_ResourceDefaultsExpression(o) if in_ApplyExpression? super(o) else illegalTasksExpression(o) end end |
#check_ResourceExpression(o) ⇒ Object
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.
58 59 60 61 62 63 64 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 58 def check_ResourceExpression(o) if in_ApplyExpression? super(o) else illegalTasksExpression(o) end end |
#check_ResourceOverrideExpression(o) ⇒ Object
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.
66 67 68 69 70 71 72 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 66 def check_ResourceOverrideExpression(o) if in_ApplyExpression? super(o) else illegalTasksExpression(o) end end |
#check_ResourceTypeDefinition(o) ⇒ Object
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.
74 75 76 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 74 def check_ResourceTypeDefinition(o) illegalTasksExpression(o) end |
#illegalTasksExpression(o) ⇒ Object
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.
84 85 86 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 84 def illegalTasksExpression(o) acceptor.accept(Issues::EXPRESSION_NOT_SUPPORTED_WHEN_SCRIPTING, o, {:klass => o}) end |
#in_ApplyExpression? ⇒ Boolean
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.
7 8 9 10 11 12 13 14 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 7 def in_ApplyExpression? top = container(0) step = -1 until container(step) == top do return true if container(step).is_a? Puppet::Pops::Model::ApplyBlockExpression step -= 1 end end |
#resource_without_title?(o) ⇒ Boolean
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.
88 89 90 |
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 88 def resource_without_title?(o) false end |