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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
593 B
Ruby
Raw Normal View History

2021-04-29 21:17:54 +05:30
# frozen_string_literal: true
module BulkImports
class Stage
2022-06-21 17:19:12 +05:30
def initialize(bulk_import_entity)
unless bulk_import_entity.is_a?(::BulkImports::Entity)
raise(ArgumentError, 'Expected an argument of type ::BulkImports::Entity')
end
2021-11-18 22:05:49 +05:30
2022-06-21 17:19:12 +05:30
@bulk_import_entity = bulk_import_entity
@bulk_import = bulk_import_entity.bulk_import
2021-04-29 21:17:54 +05:30
end
def pipelines
@pipelines ||= config
.values
.sort_by { |entry| entry[:stage] }
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