Class: Gitlab::FogbugzImport::ProjectCreator
- Inherits:
-
Object
- Object
- Gitlab::FogbugzImport::ProjectCreator
- Defined in:
- lib/gitlab/fogbugz_import/project_creator.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#fb_session ⇒ Object
readonly
Returns the value of attribute fb_session.
-
#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.
-
#user_map ⇒ Object
readonly
Returns the value of attribute user_map.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(repo, name, namespace, current_user, fb_session, user_map = nil) ⇒ ProjectCreator
constructor
A new instance of ProjectCreator.
Constructor Details
#initialize(repo, name, namespace, current_user, fb_session, user_map = nil) ⇒ ProjectCreator
Returns a new instance of ProjectCreator.
8 9 10 11 12 13 14 15 |
# File 'lib/gitlab/fogbugz_import/project_creator.rb', line 8 def initialize(repo, name, namespace, current_user, fb_session, user_map = nil) @repo = repo @name = name @namespace = namespace @current_user = current_user @fb_session = fb_session @user_map = user_map end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'lib/gitlab/fogbugz_import/project_creator.rb', line 6 def current_user @current_user end |
#fb_session ⇒ Object (readonly)
Returns the value of attribute fb_session.
6 7 8 |
# File 'lib/gitlab/fogbugz_import/project_creator.rb', line 6 def fb_session @fb_session end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gitlab/fogbugz_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/fogbugz_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/fogbugz_import/project_creator.rb', line 6 def repo @repo end |
#user_map ⇒ Object (readonly)
Returns the value of attribute user_map.
6 7 8 |
# File 'lib/gitlab/fogbugz_import/project_creator.rb', line 6 def user_map @user_map end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/gitlab/fogbugz_import/project_creator.rb', line 17 def execute ::Projects::CreateService.new( current_user, name: name, path: name, namespace_id: namespace.id, creator: current_user, visibility_level: Gitlab::VisibilityLevel::PRIVATE, import_type: 'fogbugz', import_source: repo.name, import_url: Project::UNKNOWN_IMPORT_URL, import_data: { data: { 'repo' => repo.raw_data, 'user_map' => user_map }, credentials: { fb_session: fb_session } } ).execute end |