Class: Gitlab::GoogleCodeImport::Importer
- Inherits:
-
Object
- Object
- Gitlab::GoogleCodeImport::Importer
- Defined in:
- lib/gitlab/google_code_import/importer.rb
Constant Summary collapse
- NICE_LABEL_COLOR_HASH =
{ 'Status: New' => '#428bca', 'Status: Accepted' => '#5cb85c', 'Status: Started' => '#8e44ad', 'Priority: Critical' => '#ffcfcf', 'Priority: High' => '#deffcf', 'Priority: Medium' => '#fff5cc', 'Priority: Low' => '#cfe9ff', 'Type: Defect' => '#d9534f', 'Type: Enhancement' => '#44ad8e', 'Type: Task' => '#4b6dd0', 'Type: Review' => '#8e44ad', 'Type: Other' => '#7f8c8d' }.freeze
Instance Attribute Summary collapse
-
#closed_statuses ⇒ Object
readonly
Returns the value of attribute closed_statuses.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project) ⇒ Importer
constructor
A new instance of Importer.
Constructor Details
#initialize(project) ⇒ Importer
Returns a new instance of Importer.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gitlab/google_code_import/importer.rb', line 24 def initialize(project) @project = project import_data = project.import_data.try(:data) repo_data = import_data["repo"] if import_data @repo = GoogleCodeImport::Repository.new(repo_data) @closed_statuses = [] @known_labels = Set.new end |
Instance Attribute Details
#closed_statuses ⇒ Object (readonly)
Returns the value of attribute closed_statuses
6 7 8 |
# File 'lib/gitlab/google_code_import/importer.rb', line 6 def closed_statuses @closed_statuses end |
#project ⇒ Object (readonly)
Returns the value of attribute project
6 7 8 |
# File 'lib/gitlab/google_code_import/importer.rb', line 6 def project @project end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo
6 7 8 |
# File 'lib/gitlab/google_code_import/importer.rb', line 6 def repo @repo end |
Instance Method Details
#execute ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/gitlab/google_code_import/importer.rb', line 35 def execute return true unless repo.valid? import_status_labels import_labels import_issues true end |