Class: Gitlab::LegacyGithubImport::ProjectCreator
- Inherits:
-
Object
- Object
- Gitlab::LegacyGithubImport::ProjectCreator
- Defined in:
- lib/gitlab/legacy_github_import/project_creator.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#session_data ⇒ Object
readonly
Returns the value of attribute session_data.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #execute(extra_attrs = {}) ⇒ Object
-
#initialize(repo, name, namespace, current_user, type: 'github', **session_data) ⇒ ProjectCreator
constructor
A new instance of ProjectCreator.
Constructor Details
#initialize(repo, name, namespace, current_user, type: 'github', **session_data) ⇒ ProjectCreator
Returns a new instance of ProjectCreator.
8 9 10 11 12 13 14 15 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 8 def initialize(repo, name, namespace, current_user, type: 'github', **session_data) @repo = repo @name = name @namespace = namespace @current_user = current_user @session_data = session_data @type = type end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 6 def current_user @current_user end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 6 def name @name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 6 def namespace @namespace end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 6 def repo @repo end |
#session_data ⇒ Object (readonly)
Returns the value of attribute session_data.
6 7 8 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 6 def session_data @session_data end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 6 def type @type end |
Instance Method Details
#execute(extra_attrs = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/gitlab/legacy_github_import/project_creator.rb', line 17 def execute(extra_attrs = {}) attrs = { name: name, path: name, description: repo[:description], namespace_id: namespace.id, visibility_level: visibility_level, import_type: type, import_source: repo[:full_name], import_url: import_url, skip_wiki: skip_wiki }.merge!(extra_attrs) ::Projects::CreateService.new(current_user, attrs).execute end |