Class: Gitlab::GithubImport::ContributionsMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/github_import/contributions_mapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ ContributionsMapper

Returns a new instance of ContributionsMapper.



6
7
8
# File 'lib/gitlab/github_import/contributions_mapper.rb', line 6

def initialize(project)
  @project = project
end

Instance Method Details

#user_mapperObject



10
11
12
13
14
15
16
# File 'lib/gitlab/github_import/contributions_mapper.rb', line 10

def user_mapper
  ::Gitlab::Import::SourceUserMapper.new(
    namespace: project.root_ancestor,
    source_hostname: project.import_url,
    import_type: ::Import::SOURCE_GITHUB
  )
end

#user_mapping_enabled?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/gitlab/github_import/contributions_mapper.rb', line 18

def user_mapping_enabled?
  Gitlab::GithubImport::Settings.new(project).user_mapping_enabled?
end