Class: PactBroker::Matrix::ResolvedSelectorsBuilder
- Inherits:
-
Object
- Object
- PactBroker::Matrix::ResolvedSelectorsBuilder
- Defined in:
- lib/pact_broker/matrix/resolved_selectors_builder.rb
Instance Attribute Summary collapse
-
#ignore_selectors ⇒ Object
readonly
Returns the value of attribute ignore_selectors.
-
#inferred_selectors ⇒ Object
readonly
Returns the value of attribute inferred_selectors.
-
#specified_selectors ⇒ Object
readonly
Returns the value of attribute specified_selectors.
Instance Method Summary collapse
-
#all_selectors ⇒ Array<PactBroker::Matrix::ResolvedSelector>
All the resolved selectors to be used in the matrix query, specified and inferred (if any).
-
#initialize ⇒ ResolvedSelectorsBuilder
constructor
A new instance of ResolvedSelectorsBuilder.
-
#resolve_inferred_selectors(integrations, options) ⇒ Object
Use the given Integrations to work out what the selectors are for the versions that the versions for the specified selectors should be deployed with.
- #resolve_selectors(unresolved_specified_selectors, unresolved_ignore_selectors) ⇒ Object
Constructor Details
#initialize ⇒ ResolvedSelectorsBuilder
Returns a new instance of ResolvedSelectorsBuilder.
11 12 13 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 11 def initialize @inferred_selectors = [] end |
Instance Attribute Details
#ignore_selectors ⇒ Object (readonly)
Returns the value of attribute ignore_selectors.
9 10 11 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 9 def ignore_selectors @ignore_selectors end |
#inferred_selectors ⇒ Object (readonly)
Returns the value of attribute inferred_selectors.
9 10 11 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 9 def inferred_selectors @inferred_selectors end |
#specified_selectors ⇒ Object (readonly)
Returns the value of attribute specified_selectors.
9 10 11 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 9 def specified_selectors @specified_selectors end |
Instance Method Details
#all_selectors ⇒ Array<PactBroker::Matrix::ResolvedSelector>
All the resolved selectors to be used in the matrix query, specified and inferred (if any)
34 35 36 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 34 def all_selectors specified_selectors + inferred_selectors end |
#resolve_inferred_selectors(integrations, options) ⇒ Object
Use the given Integrations to work out what the selectors are for the versions that the versions for the specified selectors should be deployed with. eg. For ‘can-i-deploy –pacticipant Foo –version adfjkwejr –to-environment prod`, work out the selectors for the integrated application versions in the prod environment.
28 29 30 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 28 def resolve_inferred_selectors(integrations, ) @inferred_selectors = SelectorResolver.resolve_inferred_selectors(specified_selectors, ignore_selectors, integrations, ) end |
#resolve_selectors(unresolved_specified_selectors, unresolved_ignore_selectors) ⇒ Object
17 18 19 20 21 |
# File 'lib/pact_broker/matrix/resolved_selectors_builder.rb', line 17 def resolve_selectors(unresolved_specified_selectors, unresolved_ignore_selectors) # must do this first because we need the ignore selectors to resolve the specified selectors @ignore_selectors = SelectorResolver.resolved_ignore_selectors(unresolved_ignore_selectors) @specified_selectors = SelectorResolver.resolve_specified_selectors(unresolved_specified_selectors, ignore_selectors) end |