Module: Gitlab::ImportSources
- Defined in:
- lib/gitlab/import_sources.rb
Defined Under Namespace
Classes: ImportSource
Constant Summary collapse
- IMPORT_TABLE =
[ ImportSource.new('github', 'GitHub', Gitlab::GithubImport::ParallelImporter), ImportSource.new('bitbucket', 'Bitbucket Cloud', Gitlab::BitbucketImport::Importer), ImportSource.new('bitbucket_server', 'Bitbucket Server', Gitlab::BitbucketServerImport::ParallelImporter), ImportSource.new('fogbugz', 'FogBugz', Gitlab::FogbugzImport::Importer), ImportSource.new('git', 'Repository by URL', nil), ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer), ImportSource.new('gitea', 'Gitea', Gitlab::LegacyGithubImport::Importer), ImportSource.new('manifest', 'Manifest file', nil) ].freeze
Class Method Summary collapse
- .import_table ⇒ Object
- .importer(name) ⇒ Object
- .importer_names ⇒ Object
- .options ⇒ Object
- .title(name) ⇒ Object
- .values ⇒ Object
Class Method Details
.import_table ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/gitlab/import_sources.rb', line 46 def import_table bitbucket_parallel_enabled = Feature.enabled?(:bitbucket_parallel_importer) return IMPORT_TABLE unless bitbucket_parallel_enabled import_table = IMPORT_TABLE.deep_dup import_table[1].importer = Gitlab::BitbucketImport::ParallelImporter if bitbucket_parallel_enabled import_table end |
.importer(name) ⇒ Object
38 39 40 |
# File 'lib/gitlab/import_sources.rb', line 38 def importer(name) import_table.find { |import_source| import_source.name == name }.importer end |
.importer_names ⇒ Object
34 35 36 |
# File 'lib/gitlab/import_sources.rb', line 34 def importer_names import_table.select(&:importer).map(&:name) end |
.options ⇒ Object
26 27 28 |
# File 'lib/gitlab/import_sources.rb', line 26 def import_table.to_h { |importer| [importer.title, importer.name] } end |
.title(name) ⇒ Object
42 43 44 |
# File 'lib/gitlab/import_sources.rb', line 42 def title(name) .key(name) end |
.values ⇒ Object
30 31 32 |
# File 'lib/gitlab/import_sources.rb', line 30 def values import_table.map(&:name) end |