debian-mirror-gitlab/lib/bulk_imports/stage.rb

28 lines
557 B
Ruby
Raw Normal View History

2021-04-29 21:17:54 +05:30
# frozen_string_literal: true
module BulkImports
class Stage
2021-11-18 22:05:49 +05:30
def initialize(bulk_import)
raise(ArgumentError, 'Expected an argument of type ::BulkImport') unless bulk_import.is_a?(::BulkImport)
@bulk_import = bulk_import
2021-04-29 21:17:54 +05:30
end
def pipelines
@pipelines ||= config
.values
.sort_by { |entry| entry[:stage] }
.map do |entry|
[entry[:stage], entry[:pipeline]]
end
end
private
def config
2021-11-11 11:23:49 +05:30
# To be implemented in a sub-class
NotImplementedError
2021-04-29 21:17:54 +05:30
end
end
end