Welcome to mirror list, hosted at ThFree Co, Russian Federation.

file_transfer.rb « bulk_imports « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c6af4e0c8331439e348585e4071d53834af3befa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module BulkImports
  module FileTransfer
    extend self

    UnsupportedObjectType = Class.new(StandardError)

    def config_for(portable)
      case portable
      when ::Project
        ::BulkImports::FileTransfer::ProjectConfig.new(portable)
      when ::Group
        ::BulkImports::FileTransfer::GroupConfig.new(portable)
      else
        raise(UnsupportedObjectType, "Unsupported object type: #{portable.class}")
      end
    end
  end
end