Class: PactBroker::Matrix::RowIgnorer
- Inherits:
-
Object
- Object
- PactBroker::Matrix::RowIgnorer
- Defined in:
- lib/pact_broker/matrix/row_ignorer.rb
Class Method Summary collapse
- .ignore_row?(resolved_ignore_selectors, row) ⇒ Boolean
-
.split_rows_into_considered_and_ignored(rows, resolved_ignore_selectors) ⇒ Array<MatrixRow, EveryRow>
Splits the matrix rows into considered rows and ignored rows, based on the ignore selectors specified by the user in the can-i-deploy command (eg. –ignore SomeProviderThatIsNotReadyYet).
Class Method Details
.ignore_row?(resolved_ignore_selectors, row) ⇒ Boolean
27 28 29 30 31 32 |
# File 'lib/pact_broker/matrix/row_ignorer.rb', line 27 def ignore_row?(resolved_ignore_selectors, row) resolved_ignore_selectors.any? do | s | s.pacticipant_id == row.consumer_id && (s.only_pacticipant_name_specified? || s.pacticipant_version_id == row.consumer_version_id) || s.pacticipant_id == row.provider_id && (s.only_pacticipant_name_specified? || s.pacticipant_version_id == row.provider_version_id) end end |
.split_rows_into_considered_and_ignored(rows, resolved_ignore_selectors) ⇒ Array<MatrixRow, EveryRow>
Splits the matrix rows into considered rows and ignored rows, based on the ignore selectors specified by the user in the can-i-deploy command (eg. –ignore SomeProviderThatIsNotReadyYet).
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pact_broker/matrix/row_ignorer.rb', line 11 def split_rows_into_considered_and_ignored(rows, resolved_ignore_selectors) if resolved_ignore_selectors.any? considered, ignored = [], [] rows.each do | row | if ignore_row?(resolved_ignore_selectors, row) ignored << row else considered << row end end return considered, ignored else return rows, [] end end |