gitlab-org--gitlab-foss/lib/gitlab/fogbugz_import/project_creator.rb
gfyoung ebf98f27c4 Enable even more frozen string in lib/gitlab
Enables frozen string for the following:

* lib/gitlab/fogbugz_import/**/*.rb
* lib/gitlab/gfm/**/*.rb
* lib/gitlab/git/**/*.rb
* lib/gitlab/gitaly_client/**/*.rb
* lib/gitlab/gitlab_import/**/*.rb
* lib/gitlab/google_code_import/**/*.rb
* lib/gitlab/gpg/**/*.rb
* lib/gitlab/grape_logging/**/*.rb
* lib/gitlab/graphql/**/*.rb
* lib/gitlab/graphs/**/*.rb
* lib/gitlab/hashed_storage/**/*.rb
* lib/gitlab/health_checks/**/*.rb

Partially address gitlab-org/gitlab-ce#47424.
2018-11-13 11:42:15 -08:00

32 lines
972 B
Ruby

# frozen_string_literal: true
module Gitlab
module FogbugzImport
class ProjectCreator
attr_reader :repo, :fb_session, :namespace, :current_user, :user_map
def initialize(repo, fb_session, namespace, current_user, user_map = nil)
@repo = repo
@fb_session = fb_session
@namespace = namespace
@current_user = current_user
@user_map = user_map
end
def execute
::Projects::CreateService.new(
current_user,
name: repo.safe_name,
path: repo.path,
namespace: namespace,
creator: current_user,
visibility_level: Gitlab::VisibilityLevel::INTERNAL,
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
end
end
end