Class: Gitlab::BitbucketImport::Importer

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/bitbucket_import/importer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Importer

Returns a new instance of Importer


6
7
8
9
10
# File 'lib/gitlab/bitbucket_import/importer.rb', line 6

def initialize(project)
  @project = project
  @client = Client.from_project(@project)
  @formatter = Gitlab::ImportFormatter.new
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client


4
5
6
# File 'lib/gitlab/bitbucket_import/importer.rb', line 4

def client
  @client
end

#projectObject (readonly)

Returns the value of attribute project


4
5
6
# File 'lib/gitlab/bitbucket_import/importer.rb', line 4

def project
  @project
end

Instance Method Details

#executeObject


12
13
14
15
16
17
18
19
20
# File 'lib/gitlab/bitbucket_import/importer.rb', line 12

def execute
  import_issues if has_issues?

  true
rescue ActiveRecord::RecordInvalid => e
  raise Projects::ImportService::Error.new, e.message
ensure
  Gitlab::BitbucketImport::KeyDeleter.new(project).execute
end