From 38737079b6c1096c2517e249198b8bc0bedf4156 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 9 Feb 2013 15:26:47 +0200 Subject: ignore docs by git --- doc/code/classes/Gitlab/API.html | 76 -- doc/code/classes/Gitlab/APIHelpers.html | 703 ------------------ doc/code/classes/Gitlab/AppLogger.html | 173 ----- doc/code/classes/Gitlab/Application.html | 76 -- doc/code/classes/Gitlab/Auth.html | 315 -------- doc/code/classes/Gitlab/Entities.html | 151 ---- doc/code/classes/Gitlab/Entities/Hook.html | 76 -- doc/code/classes/Gitlab/Entities/Issue.html | 76 -- doc/code/classes/Gitlab/Entities/MRNote.html | 76 -- doc/code/classes/Gitlab/Entities/MergeRequest.html | 76 -- doc/code/classes/Gitlab/Entities/Milestone.html | 76 -- doc/code/classes/Gitlab/Entities/Note.html | 76 -- doc/code/classes/Gitlab/Entities/Project.html | 76 -- .../classes/Gitlab/Entities/ProjectMember.html | 76 -- .../classes/Gitlab/Entities/ProjectSnippet.html | 76 -- doc/code/classes/Gitlab/Entities/RepoCommit.html | 76 -- doc/code/classes/Gitlab/Entities/RepoObject.html | 76 -- doc/code/classes/Gitlab/Entities/SSHKey.html | 76 -- doc/code/classes/Gitlab/Entities/User.html | 76 -- doc/code/classes/Gitlab/Entities/UserBasic.html | 76 -- doc/code/classes/Gitlab/Entities/UserLogin.html | 76 -- doc/code/classes/Gitlab/GitLogger.html | 173 ----- doc/code/classes/Gitlab/GitStats.html | 506 ------------- doc/code/classes/Gitlab/Gitolite.html | 536 -------------- doc/code/classes/Gitlab/Gitolite/AccessDenied.html | 76 -- doc/code/classes/Gitlab/GitoliteConfig.html | 810 --------------------- .../classes/Gitlab/GitoliteConfig/PullError.html | 76 -- .../classes/Gitlab/GitoliteConfig/PushError.html | 76 -- doc/code/classes/Gitlab/Graph.html | 88 --- doc/code/classes/Gitlab/Graph/Commit.html | 337 --------- doc/code/classes/Gitlab/Graph/JsonBuilder.html | 707 ------------------ doc/code/classes/Gitlab/InlineDiff.html | 299 -------- doc/code/classes/Gitlab/Issues.html | 82 --- doc/code/classes/Gitlab/Logger.html | 315 -------- doc/code/classes/Gitlab/Markdown.html | 258 ------- doc/code/classes/Gitlab/MergeRequests.html | 82 --- doc/code/classes/Gitlab/Milestones.html | 82 --- doc/code/classes/Gitlab/Notes.html | 100 --- doc/code/classes/Gitlab/ProjectMover.html | 290 -------- .../Gitlab/ProjectMover/ProjectMoveError.html | 76 -- doc/code/classes/Gitlab/Projects.html | 82 --- doc/code/classes/Gitlab/Regex.html | 261 ------- doc/code/classes/Gitlab/Satellite.html | 102 --- doc/code/classes/Gitlab/Satellite/Action.html | 305 -------- .../classes/Gitlab/Satellite/EditFileAction.html | 284 -------- doc/code/classes/Gitlab/Satellite/MergeAction.html | 274 ------- doc/code/classes/Gitlab/Satellite/Satellite.html | 506 ------------- doc/code/classes/Gitlab/Seeder.html | 134 ---- doc/code/classes/Gitlab/Session.html | 82 --- doc/code/classes/Gitlab/Theme.html | 141 ---- doc/code/classes/Gitlab/Users.html | 82 --- 51 files changed, 9856 deletions(-) delete mode 100644 doc/code/classes/Gitlab/API.html delete mode 100644 doc/code/classes/Gitlab/APIHelpers.html delete mode 100644 doc/code/classes/Gitlab/AppLogger.html delete mode 100644 doc/code/classes/Gitlab/Application.html delete mode 100644 doc/code/classes/Gitlab/Auth.html delete mode 100644 doc/code/classes/Gitlab/Entities.html delete mode 100644 doc/code/classes/Gitlab/Entities/Hook.html delete mode 100644 doc/code/classes/Gitlab/Entities/Issue.html delete mode 100644 doc/code/classes/Gitlab/Entities/MRNote.html delete mode 100644 doc/code/classes/Gitlab/Entities/MergeRequest.html delete mode 100644 doc/code/classes/Gitlab/Entities/Milestone.html delete mode 100644 doc/code/classes/Gitlab/Entities/Note.html delete mode 100644 doc/code/classes/Gitlab/Entities/Project.html delete mode 100644 doc/code/classes/Gitlab/Entities/ProjectMember.html delete mode 100644 doc/code/classes/Gitlab/Entities/ProjectSnippet.html delete mode 100644 doc/code/classes/Gitlab/Entities/RepoCommit.html delete mode 100644 doc/code/classes/Gitlab/Entities/RepoObject.html delete mode 100644 doc/code/classes/Gitlab/Entities/SSHKey.html delete mode 100644 doc/code/classes/Gitlab/Entities/User.html delete mode 100644 doc/code/classes/Gitlab/Entities/UserBasic.html delete mode 100644 doc/code/classes/Gitlab/Entities/UserLogin.html delete mode 100644 doc/code/classes/Gitlab/GitLogger.html delete mode 100644 doc/code/classes/Gitlab/GitStats.html delete mode 100644 doc/code/classes/Gitlab/Gitolite.html delete mode 100644 doc/code/classes/Gitlab/Gitolite/AccessDenied.html delete mode 100644 doc/code/classes/Gitlab/GitoliteConfig.html delete mode 100644 doc/code/classes/Gitlab/GitoliteConfig/PullError.html delete mode 100644 doc/code/classes/Gitlab/GitoliteConfig/PushError.html delete mode 100644 doc/code/classes/Gitlab/Graph.html delete mode 100644 doc/code/classes/Gitlab/Graph/Commit.html delete mode 100644 doc/code/classes/Gitlab/Graph/JsonBuilder.html delete mode 100644 doc/code/classes/Gitlab/InlineDiff.html delete mode 100644 doc/code/classes/Gitlab/Issues.html delete mode 100644 doc/code/classes/Gitlab/Logger.html delete mode 100644 doc/code/classes/Gitlab/Markdown.html delete mode 100644 doc/code/classes/Gitlab/MergeRequests.html delete mode 100644 doc/code/classes/Gitlab/Milestones.html delete mode 100644 doc/code/classes/Gitlab/Notes.html delete mode 100644 doc/code/classes/Gitlab/ProjectMover.html delete mode 100644 doc/code/classes/Gitlab/ProjectMover/ProjectMoveError.html delete mode 100644 doc/code/classes/Gitlab/Projects.html delete mode 100644 doc/code/classes/Gitlab/Regex.html delete mode 100644 doc/code/classes/Gitlab/Satellite.html delete mode 100644 doc/code/classes/Gitlab/Satellite/Action.html delete mode 100644 doc/code/classes/Gitlab/Satellite/EditFileAction.html delete mode 100644 doc/code/classes/Gitlab/Satellite/MergeAction.html delete mode 100644 doc/code/classes/Gitlab/Satellite/Satellite.html delete mode 100644 doc/code/classes/Gitlab/Seeder.html delete mode 100644 doc/code/classes/Gitlab/Session.html delete mode 100644 doc/code/classes/Gitlab/Theme.html delete mode 100644 doc/code/classes/Gitlab/Users.html (limited to 'doc/code/classes/Gitlab') diff --git a/doc/code/classes/Gitlab/API.html b/doc/code/classes/Gitlab/API.html deleted file mode 100644 index fe2ccc76ebe..00000000000 --- a/doc/code/classes/Gitlab/API.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::API - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/APIHelpers.html b/doc/code/classes/Gitlab/APIHelpers.html deleted file mode 100644 index 603443dda2b..00000000000 --- a/doc/code/classes/Gitlab/APIHelpers.html +++ /dev/null @@ -1,703 +0,0 @@ - - - - - Gitlab::APIHelpers - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
F
-
- -
- -
N
-
- -
- -
P
-
- -
- -
R
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - attributes_for_keys(keys) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 44
-def attributes_for_keys(keys)
-  attrs = {}
-  keys.each do |key|
-    attrs[key] = params[key] if params[key].present?
-  end
-  attrs
-end
-
-
- -
- -
-
- - authenticate!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 26
-def authenticate!
-  unauthorized! unless current_user
-end
-
-
- -
- -
-
- - authenticated_as_admin!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 30
-def authenticated_as_admin!
-  forbidden! unless current_user.is_admin?
-end
-
-
- -
- -
-
- - authorize!(action, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 34
-def authorize! action, subject
-  unless abilities.allowed?(current_user, action, subject)
-    forbidden!
-  end
-end
-
-
- -
- -
-
- - can?(object, action, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 40
-def can?(object, action, subject)
-  abilities.allowed?(object, action, subject)
-end
-
-
- -
- -
-
- - current_user() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 3
-def current_user
-  @current_user ||= User.find_by_authentication_token(params[:private_token] || env["HTTP_PRIVATE_TOKEN"])
-end
-
-
- -
- -
-
- - find_project() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 12
-def find_project
-  project = Project.find_by_id(params[:id]) || Project.find_with_namespace(params[:id])
-
-  if project && can?(current_user, :read_project, project)
-    project
-  else
-    nil
-  end
-end
-
-
- -
- -
-
- - forbidden!() - - -
- - -
-

error helpers

-
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 54
-def forbidden!
-  render_api_error!('403 Forbidden', 403)
-end
-
-
- -
- -
-
- - not_allowed!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 69
-def not_allowed!
-  render_api_error!('Method Not Allowed', 405)
-end
-
-
- -
- -
-
- - not_found!(resource = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 58
-def not_found!(resource = nil)
-  message = ["404"]
-  message << resource if resource
-  message << "Not Found"
-  render_api_error!(message.join(' '), 404)
-end
-
-
- -
- -
-
- - paginate(object) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 22
-def paginate(object)
-  object.page(params[:page]).per(params[:per_page].to_i)
-end
-
-
- -
- -
-
- - render_api_error!(message, status) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 73
-def render_api_error!(message, status)
-  error!({'message' => message}, status)
-end
-
-
- -
- -
-
- - unauthorized!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 65
-def unauthorized!
-  render_api_error!('401 Unauthorized', 401)
-end
-
-
- -
- -
-
- - user_project() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/api/helpers.rb, line 7
-def user_project
-  @project ||= find_project
-  @project || not_found!
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/AppLogger.html b/doc/code/classes/Gitlab/AppLogger.html deleted file mode 100644 index 2f4dc5349e3..00000000000 --- a/doc/code/classes/Gitlab/AppLogger.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - Gitlab::AppLogger - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
F
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - file_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/app_logger.rb, line 3
-def self.file_name
-  'application.log'
-end
-
-
- -
- -
Instance Public methods
- -
-
- - format_message(severity, timestamp, progname, msg) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/app_logger.rb, line 7
-def format_message(severity, timestamp, progname, msg)
-  "#{timestamp.to_s(:long)}: #{msg}\n"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Application.html b/doc/code/classes/Gitlab/Application.html deleted file mode 100644 index c8a1e3c2698..00000000000 --- a/doc/code/classes/Gitlab/Application.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Application - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Auth.html b/doc/code/classes/Gitlab/Auth.html deleted file mode 100644 index 4eeb3fecbc5..00000000000 --- a/doc/code/classes/Gitlab/Auth.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - Gitlab::Auth - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
F
-
- -
- -
L
-
-
    - - -
  • - log -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create_from_omniauth(auth, ldap = false) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/auth.rb, line 20
-def create_from_omniauth(auth, ldap = false)
-  provider = auth.provider
-  uid = auth.info.uid || auth.uid
-  name = auth.info.name.force_encoding("utf-8")
-  email = auth.info.email.downcase unless auth.info.email.nil?
-
-  ldap_prefix = ldap ? '(LDAP) ' : ''
-  raise OmniAuth::Error, "#{ldap_prefix}#{provider} does not provide an email"         " address" if auth.info.email.blank?
-
-  log.info "#{ldap_prefix}Creating user from #{provider} login"         " {uid => #{uid}, name => #{name}, email => #{email}}"
-  password = Devise.friendly_token[0, 8].downcase
-  @user = User.new({
-    extern_uid: uid,
-    provider: provider,
-    name: name,
-    username: email.match(%r^[^@]*/)[0],
-    email: email,
-    password: password,
-    password_confirmation: password,
-    projects_limit: Gitlab.config.gitlab.default_projects_limit,
-  }, as: :admin)
-  if Gitlab.config.omniauth['block_auto_created_users'] && !ldap
-    @user.blocked = true
-  end
-  @user.save!
-  @user
-end
-
-
- -
- -
-
- - find_for_ldap_auth(auth, signed_in_resource = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/auth.rb, line 3
-def find_for_ldap_auth(auth, signed_in_resource = nil)
-  uid = auth.info.uid
-  provider = auth.provider
-  email = auth.info.email.downcase unless auth.info.email.nil?
-  raise OmniAuth::Error, "LDAP accounts must provide an uid and email address" if uid.nil? or email.nil?
-
-  if @user = User.find_by_extern_uid_and_provider(uid, provider)
-    @user
-  elsif @user = User.find_by_email(email)
-    log.info "Updating legacy LDAP user #{email} with extern_uid => #{uid}"
-    @user.update_attributes(:extern_uid => uid, :provider => provider)
-    @user
-  else
-    create_from_omniauth(auth, true)
-  end
-end
-
-
- -
- -
-
- - find_or_new_for_omniauth(auth) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/auth.rb, line 50
-def find_or_new_for_omniauth(auth)
-  provider, uid = auth.provider, auth.uid
-  email = auth.info.email.downcase unless auth.info.email.nil?
-
-  if @user = User.find_by_provider_and_extern_uid(provider, uid)
-    @user
-  elsif @user = User.find_by_email(email)
-    @user.update_attributes(:extern_uid => uid, :provider => provider)
-    @user
-  else
-    if Gitlab.config.omniauth['allow_single_sign_on']
-      @user = create_from_omniauth(auth)
-      @user
-    end
-  end
-end
-
-
- -
- -
-
- - log() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/auth.rb, line 67
-def log
-  Gitlab::AppLogger
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities.html b/doc/code/classes/Gitlab/Entities.html deleted file mode 100644 index 8cb9ed35679..00000000000 --- a/doc/code/classes/Gitlab/Entities.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - Gitlab::Entities - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/Hook.html b/doc/code/classes/Gitlab/Entities/Hook.html deleted file mode 100644 index a42cc91d4a3..00000000000 --- a/doc/code/classes/Gitlab/Entities/Hook.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::Hook - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/Issue.html b/doc/code/classes/Gitlab/Entities/Issue.html deleted file mode 100644 index 432c6f4bc14..00000000000 --- a/doc/code/classes/Gitlab/Entities/Issue.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::Issue - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/MRNote.html b/doc/code/classes/Gitlab/Entities/MRNote.html deleted file mode 100644 index e05a43b8e54..00000000000 --- a/doc/code/classes/Gitlab/Entities/MRNote.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::MRNote - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/MergeRequest.html b/doc/code/classes/Gitlab/Entities/MergeRequest.html deleted file mode 100644 index e68077163e7..00000000000 --- a/doc/code/classes/Gitlab/Entities/MergeRequest.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::MergeRequest - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/Milestone.html b/doc/code/classes/Gitlab/Entities/Milestone.html deleted file mode 100644 index 3c375faa8fb..00000000000 --- a/doc/code/classes/Gitlab/Entities/Milestone.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::Milestone - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/Note.html b/doc/code/classes/Gitlab/Entities/Note.html deleted file mode 100644 index f0ba6567df5..00000000000 --- a/doc/code/classes/Gitlab/Entities/Note.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::Note - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/Project.html b/doc/code/classes/Gitlab/Entities/Project.html deleted file mode 100644 index a111b19ffd2..00000000000 --- a/doc/code/classes/Gitlab/Entities/Project.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::Project - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/ProjectMember.html b/doc/code/classes/Gitlab/Entities/ProjectMember.html deleted file mode 100644 index 151abf270d2..00000000000 --- a/doc/code/classes/Gitlab/Entities/ProjectMember.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::ProjectMember - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/ProjectSnippet.html b/doc/code/classes/Gitlab/Entities/ProjectSnippet.html deleted file mode 100644 index 61259d0c0d1..00000000000 --- a/doc/code/classes/Gitlab/Entities/ProjectSnippet.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::ProjectSnippet - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/RepoCommit.html b/doc/code/classes/Gitlab/Entities/RepoCommit.html deleted file mode 100644 index 3d181a6f268..00000000000 --- a/doc/code/classes/Gitlab/Entities/RepoCommit.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::RepoCommit - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/RepoObject.html b/doc/code/classes/Gitlab/Entities/RepoObject.html deleted file mode 100644 index ee6a10e7a6a..00000000000 --- a/doc/code/classes/Gitlab/Entities/RepoObject.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::RepoObject - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/SSHKey.html b/doc/code/classes/Gitlab/Entities/SSHKey.html deleted file mode 100644 index cbc4d1a3a6b..00000000000 --- a/doc/code/classes/Gitlab/Entities/SSHKey.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::SSHKey - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/User.html b/doc/code/classes/Gitlab/Entities/User.html deleted file mode 100644 index 5c29667639e..00000000000 --- a/doc/code/classes/Gitlab/Entities/User.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::User - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/UserBasic.html b/doc/code/classes/Gitlab/Entities/UserBasic.html deleted file mode 100644 index a17b808def4..00000000000 --- a/doc/code/classes/Gitlab/Entities/UserBasic.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::UserBasic - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Entities/UserLogin.html b/doc/code/classes/Gitlab/Entities/UserLogin.html deleted file mode 100644 index d73be2ca6ca..00000000000 --- a/doc/code/classes/Gitlab/Entities/UserLogin.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Entities::UserLogin - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/GitLogger.html b/doc/code/classes/Gitlab/GitLogger.html deleted file mode 100644 index 19018c0fc7c..00000000000 --- a/doc/code/classes/Gitlab/GitLogger.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - Gitlab::GitLogger - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
F
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - file_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_logger.rb, line 3
-def self.file_name
-  'githost.log'
-end
-
-
- -
- -
Instance Public methods
- -
-
- - format_message(severity, timestamp, progname, msg) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_logger.rb, line 7
-def format_message(severity, timestamp, progname, msg)
-  "#{timestamp.to_s(:long)} -> #{severity} -> #{msg}\n"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/GitStats.html b/doc/code/classes/Gitlab/GitStats.html deleted file mode 100644 index fabe18bb4d7..00000000000 --- a/doc/code/classes/Gitlab/GitStats.html +++ /dev/null @@ -1,506 +0,0 @@ - - - - - Gitlab::GitStats - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
F
-
- -
- -
G
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - -
- [RW] - ref
- [RW] - repo
- - - - - -
Class Public methods
- -
-
- - new(repo, ref) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 5
-def initialize repo, ref
-  @repo, @ref = repo, ref
-end
-
-
- -
- -
Instance Public methods
- -
-
- - authors() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 9
-def authors
-  @authors ||= collect_authors
-end
-
-
- -
- -
-
- - authors_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 22
-def authors_count
-  authors.size
-end
-
-
- -
- -
-
- - commits_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 13
-def commits_count
-  @commits_count ||= repo.commit_count(ref)
-end
-
-
- -
- -
-
- - files_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 17
-def files_count
-  args = [ref, '-r', '--name-only' ]
-  repo.git.run(nil, 'ls-tree', nil, {}, args).split("\n").count
-end
-
-
- -
- -
-
- - graph() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 26
-def graph
-  @graph ||= build_graph
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - build_graph(n = 4) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 54
-def build_graph n = 4
-  from, to = (Date.today - n.weeks), Date.today
-  args = ['--all', "--since=#{from.to_s(:date)}", '--format=%ad' ]
-  rev_list = repo.git.run(nil, 'rev-list', nil, {}, args).split("\n")
-
-  commits_dates = rev_list.values_at(* rev_list.each_index.select {|i| i.odd?})
-  commits_dates = commits_dates.map { |date_str| Time.parse(date_str).to_date.to_s(:date) }
-
-  commits_per_day = from.upto(to).map do |day|
-    commits_dates.count(day.to_date.to_s(:date))
-  end
-
-  OpenStruct.new(
-    labels: from.upto(to).map { |day| day.stamp('Aug 23') },
-    commits: commits_per_day,
-    weeks: n
-  )
-end
-
-
- -
- -
-
- - collect_authors() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/git_stats.rb, line 32
-def collect_authors
-  shortlog = repo.git.shortlog({e: true, s: true }, ref)
-
-  authors = []
-
-  lines = shortlog.split("\n")
-
-  lines.each do |line|
-    data = line.split("\t")
-    commits = data.first
-    author = Grit::Actor.from_string(data.last)
-
-    authors << OpenStruct.new(
-      name: author.name,
-      email: author.email,
-      commits: commits.to_i
-    )
-  end
-
-  authors.sort_by(&:commits).reverse
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Gitolite.html b/doc/code/classes/Gitlab/Gitolite.html deleted file mode 100644 index 8cf9c58c375..00000000000 --- a/doc/code/classes/Gitlab/Gitolite.html +++ /dev/null @@ -1,536 +0,0 @@ - - - - - Gitlab::Gitolite - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
C
-
- -
- -
E
-
- -
- -
M
-
- -
- -
R
-
- -
- -
S
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - config() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 7
-def config
-  Gitlab::GitoliteConfig.new
-end
-
-
- -
- -
-
- - create_repository(project) - - -
- - -
- -
- - - - - -
- -
-
- - enable_automerge() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 44
-def enable_automerge
-  config.admin_all_repo!
-end
-
-
- -
- -
-
- - move_repository(old_repo, project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 29
-def move_repository(old_repo, project)
-  config.apply do |config|
-    config.clean_repo(old_repo)
-    config.update_project(project)
-  end
-end
-
-
- -
- -
-
- - remove_key(key_id, projects) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 18
-def remove_key key_id, projects
-  config.apply do |config|
-    config.rm_key(key_id)
-    config.update_projects(projects)
-  end
-end
-
-
- -
- -
-
- - remove_repository(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 36
-def remove_repository project
-  config.destroy_project!(project)
-end
-
-
- -
- -
-
- - set_key(key_id, key_content, projects) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 11
-def set_key key_id, key_content, projects
-  config.apply do |config|
-    config.write_key(key_id, key_content)
-    config.update_projects(projects)
-  end
-end
-
-
- -
- -
-
- - update_repositories(projects) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 48
-def update_repositories projects
-  config.apply do |config|
-    config.update_projects(projects)
-  end
-end
-
-
- -
- -
-
- - update_repository(project) - - -
- - -
- -
- - - -
- Also aliased as: create_repository -
- - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 25
-def update_repository project
-  config.update_project!(project)
-end
-
-
- -
- -
-
- - url_to_repo(path) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite.rb, line 40
-def url_to_repo path
-  Gitlab.config.gitolite.ssh_path_prefix + "#{path}.git"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Gitolite/AccessDenied.html b/doc/code/classes/Gitlab/Gitolite/AccessDenied.html deleted file mode 100644 index 8a45dae1ba2..00000000000 --- a/doc/code/classes/Gitlab/Gitolite/AccessDenied.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::Gitolite::AccessDenied - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/GitoliteConfig.html b/doc/code/classes/Gitlab/GitoliteConfig.html deleted file mode 100644 index 11026f5ca44..00000000000 --- a/doc/code/classes/Gitlab/GitoliteConfig.html +++ /dev/null @@ -1,810 +0,0 @@ - - - - - Gitlab::GitoliteConfig - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
L
-
-
    - - -
  • - log -
  • - -
-
- -
R
-
- -
- -
U
-
- -
- -
W
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - -
- [R] - conf
- [R] - config_tmp_dir
- [R] - ga_repo
- - - - - -
Instance Public methods
- -
-
- - admin_all_repo() - - -
- - -
-

Enable access to all repos for gitolite admin. We use it for accept merge -request feature

-
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 169
-def admin_all_repo
-  owner_name = Gitlab.config.gitolite.admin_key
-
-  # @ALL repos premission for gitolite owner
-  repo_name = "@all"
-  repo = if conf.has_repo?(repo_name)
-           conf.get_repo(repo_name)
-         else
-           ::Gitolite::Config::Repo.new(repo_name)
-         end
-
-  repo.add_permission("RW+", "", owner_name)
-  conf.add_repo(repo, true)
-end
-
-
- -
- -
-
- - admin_all_repo!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 184
-def admin_all_repo!
-  apply { |config| config.admin_all_repo }
-end
-
-
- -
- -
-
- - apply() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 23
-def apply
-  Timeout::timeout(30) do
-    File.open(Rails.root.join('tmp', "gitlabhq-gitolite.lock"), "w+") do |f|
-      begin
-        # Set exclusive lock
-        # to prevent race condition
-        f.flock(File::LOCK_EX)
-
-        # Pull gitolite-admin repo
-        # in tmp dir before do any changes
-        pull(config_tmp_dir)
-
-        # Build ga_repo object and @conf
-        # to access gitolite-admin configuration
-        @conf = ga_repo.config
-
-        # Do any changes
-        # in gitolite-admin
-        # config here
-        yield(self)
-
-        # Save changes in
-        # gitolite-admin repo
-        # before push it
-        ga_repo.save
-
-        # Push gitolite-admin repo
-        # to apply all changes
-        push(config_tmp_dir)
-      ensure
-        # Remove tmp dir
-        # removing the gitolite folder first is important to avoid
-        # NFS issues.
-        FileUtils.rm_rf(File.join(config_tmp_dir, 'gitolite'))
-
-        # Remove parent tmp dir
-        FileUtils.rm_rf(config_tmp_dir)
-
-        # Unlock so other task can access
-        # gitolite configuration
-        f.flock(File::LOCK_UN)
-      end
-    end
-  end
-rescue PullError => ex
-  log("Pull error ->  " + ex.message)
-  raise Gitolite::AccessDenied, ex.message
-
-rescue PushError => ex
-  log("Push error ->  " + " " + ex.message)
-  raise Gitolite::AccessDenied, ex.message
-
-rescue Exception => ex
-  log(ex.class.name + " " + ex.message)
-  raise Gitolite::AccessDenied.new("gitolite timeout")
-end
-
-
- -
- -
-
- - clean_repo(repo_name) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 89
-def clean_repo repo_name
-  conf.rm_repo(repo_name)
-end
-
-
- -
- -
-
- - destroy_project(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 84
-def destroy_project(project)
-  FileUtils.rm_rf(project.path_to_repo)
-  conf.rm_repo(project.path_with_namespace)
-end
-
-
- -
- -
-
- - destroy_project!(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 93
-def destroy_project!(project)
-  apply do |config|
-    config.destroy_project(project)
-  end
-end
-
-
- -
- -
-
- - log(message) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 80
-def log message
-  Gitlab::GitLogger.error(message)
-end
-
-
- -
- -
-
- - rm_key(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 105
-def rm_key(user)
-  key_path = File.join(config_tmp_dir, 'gitolite/keydir', "#{user}.pub")
-  ga_key = ::Gitolite::SSHKey.from_file(key_path)
-  ga_repo.rm_key(ga_key)
-end
-
-
- -
- -
-
- - update_project(project) - - -
- - -
-

update or create

-
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 112
-def update_project(project)
-  repo = update_project_config(project, conf)
-  conf.add_repo(repo, true)
-end
-
-
- -
- -
-
- - update_project!( project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 117
-def update_project!( project)
-  apply do |config|
-    config.update_project(project)
-  end
-end
-
-
- -
- -
-
- - update_project_config(project, conf) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 132
-def update_project_config(project, conf)
-  repo_name = project.path_with_namespace
-
-  repo = if conf.has_repo?(repo_name)
-           conf.get_repo(repo_name)
-         else
-           ::Gitolite::Config::Repo.new(repo_name)
-         end
-
-  name_readers = project.repository_readers
-  name_writers = project.repository_writers
-  name_masters = project.repository_masters
-
-  pr_br = project.protected_branches.map(&:name).join("$ ")
-
-  repo.clean_permissions
-
-  # Deny access to protected branches for writers
-  unless name_writers.blank? || pr_br.blank?
-    repo.add_permission("-", pr_br.strip + "$ ", name_writers)
-  end
-
-  # Add read permissions
-  repo.add_permission("R", "", name_readers) unless name_readers.blank?
-
-  # Add write permissions
-  repo.add_permission("RW+", "", name_writers) unless name_writers.blank?
-  repo.add_permission("RW+", "", name_masters) unless name_masters.blank?
-
-  # Add sharedRepository config
-  repo.set_git_config("core.sharedRepository", "0660")
-
-  repo
-end
-
-
- -
- -
-
- - update_projects(projects) - - -
- - -
-

Updates many projects and uses project.path_with_namespace as the repo path -An order of magnitude faster than #update_project

-
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 125
-def update_projects(projects)
-  projects.each do |project|
-    repo = update_project_config(project, conf)
-    conf.add_repo(repo, true)
-  end
-end
-
-
- -
- -
-
- - write_key(id, key) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/gitolite_config.rb, line 99
-def write_key(id, key)
-  File.open(File.join(config_tmp_dir, 'gitolite/keydir',"#{id}.pub"), 'w') do |f|
-    f.write(key.gsub(%r\n/,''))
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/GitoliteConfig/PullError.html b/doc/code/classes/Gitlab/GitoliteConfig/PullError.html deleted file mode 100644 index 35c46f38642..00000000000 --- a/doc/code/classes/Gitlab/GitoliteConfig/PullError.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::GitoliteConfig::PullError - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/GitoliteConfig/PushError.html b/doc/code/classes/Gitlab/GitoliteConfig/PushError.html deleted file mode 100644 index 53efe1e8a7d..00000000000 --- a/doc/code/classes/Gitlab/GitoliteConfig/PushError.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::GitoliteConfig::PushError - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Graph.html b/doc/code/classes/Gitlab/Graph.html deleted file mode 100644 index e0827c84594..00000000000 --- a/doc/code/classes/Gitlab/Graph.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Gitlab::Graph - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Graph/Commit.html b/doc/code/classes/Gitlab/Graph/Commit.html deleted file mode 100644 index 0198b3f0e3c..00000000000 --- a/doc/code/classes/Gitlab/Graph/Commit.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - Gitlab::Graph::Commit - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
T
-
- -
- -
- - - - -
Included Modules
-
    - -
  • - - ActionView::Helpers::TagHelper - -
  • - -
- - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - -
- [RW] - refs
- [RW] - space
- [RW] - time
- - - - - -
Class Public methods
- -
-
- - new(commit) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/commit.rb, line 10
-def initialize(commit)
-  @_commit = commit
-  @time = -1
-  @space = 0
-end
-
-
- -
- -
Instance Public methods
- -
-
- - add_refs(ref_cache, repo) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/commit.rb, line 36
-def add_refs(ref_cache, repo)
-  if ref_cache.empty?
-    repo.refs.each do |ref|
-      ref_cache[ref.commit.id] ||= []
-      ref_cache[ref.commit.id] << ref
-    end
-  end
-  @refs = ref_cache[@_commit.id] if ref_cache.include?(@_commit.id)
-  @refs ||= []
-end
-
-
- -
- -
-
- - method_missing(m, *args, &block) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/commit.rb, line 16
-def method_missing(m, *args, &block)
-  @_commit.send(m, *args, &block)
-end
-
-
- -
- -
-
- - to_graph_hash() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/commit.rb, line 20
-def to_graph_hash
-  h = {}
-  h[:parents] = self.parents.collect do |p|
-    [p.id,0,0]
-  end
-  h[:author]  = author.name
-  h[:time]    = time
-  h[:space]   = space
-  h[:refs]    = refs.collect{|r|r.name}.join(" ") unless refs.nil?
-  h[:id]      = sha
-  h[:date]    = date
-  h[:message] = message
-  h[:login]   = author.email
-  h
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Graph/JsonBuilder.html b/doc/code/classes/Gitlab/Graph/JsonBuilder.html deleted file mode 100644 index b410947bb85..00000000000 --- a/doc/code/classes/Gitlab/Graph/JsonBuilder.html +++ /dev/null @@ -1,707 +0,0 @@ - - - - - Gitlab::Graph::JsonBuilder - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
C
-
- -
- -
F
-
- -
- -
I
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
P
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- [RW] - commits
- [RW] - days
- [RW] - ref_cache
- [RW] - repo
- - - - - -
Class Public methods
- -
-
- - max_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 8
-def self.max_count
-  @max_count ||= 650
-end
-
-
- -
- -
-
- - new(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 12
-def initialize project
-  @project = project
-  @repo = project.repo
-  @ref_cache = {}
-
-  @commits = collect_commits
-  @days = index_commits
-end
-
-
- -
- -
Instance Public methods
- -
-
- - to_json(*args) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 21
-def to_json(*args)
-  {
-    days: @days.compact.map { |d| [d.day, d.strftime("%b")] },
-    commits: @commits.map(&:to_graph_hash)
-  }.to_json(*args)
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - base_space(leaves, map) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 148
-def base_space(leaves, map)
-  parents = []
-  leaves.each do |l|
-    parents.concat l.parents.collect.select{|p| map.include? p.id and map[p.id].space.nonzero?}
-  end
-
-  space = parents.map{|p| map[p.id].space}.max || 0
-  space += 1
-end
-
-
- -
- -
-
- - collect_commits() - - -
- - -
-

Get commits from repository

-
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 32
-def collect_commits
-  @commits = Grit::Commit.find_all(repo, nil, {max_count: self.class.max_count}).dup
-
-  # Decorate with app/models/commit.rb
-  @commits.map! { |commit| ::Commit.new(commit) }
-
-  # Decorate with lib/gitlab/graph/commit.rb
-  @commits.map! { |commit| Gitlab::Graph::Commit.new(commit) }
-
-  # add refs to each commit
-  @commits.each { |commit| commit.add_refs(ref_cache, repo) }
-
-  @commits
-end
-
-
- -
- -
-
- - find_free_space(leaves, map) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 135
-def find_free_space(leaves, map)
-  time_range = leaves.last.time..leaves.first.time
-  reserved = []
-  for day in time_range
-    reserved += @_reserved[day]
-  end
-  space = base_space(leaves, map)
-  while reserved.include? space do
-    space += 1
-  end
-  space
-end
-
-
- -
- -
-
- - index_commits() - - -
- - -
-

Method is adding time and space on the list of commits. As well as returns -date list corelated with time set on commits.

- -

@param [Array<Graph::Commit>] comits to index

- -

@return [Array<TimeDate>] list of commit dates corelated with time on -commits

-
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 54
-def index_commits
-  days, heads = [], []
-  map = {}
-
-  commits.reverse.each_with_index do |c,i|
-    c.time = i
-    days[i] = c.committed_date
-    map[c.id] = c
-    heads += c.refs unless c.refs.nil?
-  end
-
-  heads.select!{|h| h.is_a? Grit::Head or h.is_a? Grit::Remote}
-  # sort heads so the master is top and current branches are closer
-  heads.sort! do |a,b|
-    if a.name == "master"
-      -1
-    elsif b.name == "master"
-      1
-    else
-      b.commit.committed_date <=> a.commit.committed_date
-    end
-  end
-
-  @_reserved = {}
-  days.each_index do |i|
-    @_reserved[i] = []
-  end
-
-  heads.each do |h|
-    if map.include? h.commit.id then
-      place_chain(map[h.commit.id], map)
-    end
-  end
-
-  days
-end
-
-
- -
- -
-
- - mark_reserved(time_range, space) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 129
-def mark_reserved(time_range, space)
-  for day in time_range
-    @_reserved[day].push(space)
-  end
-end
-
-
- -
- -
-
- - place_chain(commit, map, parent_time = nil) - - -
- - -
-

Add space mark on commit and its parents

- -

@param [Graph::Commit] the commit object. @param -[Hash<String,Graph::Commit>] map of commits

-
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 95
-def place_chain(commit, map, parent_time = nil)
-  leaves = take_left_leaves(commit, map)
-  if leaves.empty?
-    return
-  end
-  space = find_free_space(leaves, map)
-  leaves.each{|l| l.space = space}
-  # and mark it as reserved
-  min_time = leaves.last.time
-  parents = leaves.last.parents.collect
-  parents.each do |p|
-    if map.include? p.id
-      parent = map[p.id]
-      if parent.time < min_time
-        min_time = parent.time
-      end
-    end
-  end
-  if parent_time.nil?
-    max_time = leaves.first.time
-  else
-    max_time = parent_time - 1
-  end
-  mark_reserved(min_time..max_time, space)
-
-  # Visit branching chains
-  leaves.each do |l|
-    parents = l.parents.collect.select{|p| map.include? p.id and map[p.id].space.zero?}
-    for p in parents
-      place_chain(map[p.id], map, l.time)
-    end
-  end
-end
-
-
- -
- -
-
- - take_left_leaves(commit, map) - - -
- - -
-

Takes most left subtree branch of commits which don’t have space mark yet.

- -

@param [Graph::Commit] the commit object. @param -[Hash<String,Graph::Commit>] map of commits

- -

@return [Array<Graph::Commit>] list of branch commits

-
- - - - - - -
- - -
-
# File lib/gitlab/graph/json_builder.rb, line 165
-def take_left_leaves(commit, map)
-  leaves = []
-  leaves.push(commit) if commit.space.zero?
-
-  while true
-    return leaves if commit.parents.count.zero?
-    return leaves unless map.include? commit.parents.first.id
-
-    commit = map[commit.parents.first.id]
-
-    return leaves unless commit.space.zero?
-
-    leaves.push(commit)
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/InlineDiff.html b/doc/code/classes/Gitlab/InlineDiff.html deleted file mode 100644 index cd04b7d018d..00000000000 --- a/doc/code/classes/Gitlab/InlineDiff.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - Gitlab::InlineDiff - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
#
-
- -
- -
P
-
- -
- -
R
-
- -
- -
- - - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - - - - - - - - - - - - - -
START="#!idiff-start!#"
 
FINISH="#!idiff-finish!#"
 
- - - - - - - - -
Class Public methods
- -
-
- - _indexes_of_changed_lines(diff_arr) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/inline_diff.rb, line 42
-def _indexes_of_changed_lines diff_arr
-  chain_of_first_symbols = ""
-  diff_arr.each_with_index do |line, i|
-    chain_of_first_symbols += line[0]
-  end
-  chain_of_first_symbols.gsub!(%r[^\-\+]/, "#")
-
-  offset = 0
-  indexes = []
-  while index = chain_of_first_symbols.index("#-+#", offset)
-    indexes << index
-    offset = index + 1
-  end
-  indexes
-end
-
-
- -
- -
-
- - processing(diff_arr) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/inline_diff.rb, line 8
-def processing diff_arr
-  indexes = _indexes_of_changed_lines diff_arr
-
-  indexes.each do |index|
-    first_line = diff_arr[index+1]
-    second_line = diff_arr[index+2]
-    max_length = [first_line.size, second_line.size].max
-
-    first_the_same_symbols = 0
-    (0..max_length + 1).each do |i|
-      first_the_same_symbols = i - 1
-      if first_line[i] != second_line[i] && i > 0
-        break
-      end
-    end
-    first_token = first_line[0..first_the_same_symbols][1..-1]
-    diff_arr[index+1].sub!(first_token, first_token + START)
-    diff_arr[index+2].sub!(first_token, first_token + START)
-    last_the_same_symbols = 0
-    (1..max_length + 1).each do |i|
-      last_the_same_symbols = -i
-      shortest_line = second_line.size > first_line.size ? first_line : second_line
-      if ( first_line[-i] != second_line[-i] ) || "#{first_token}#{START}".size == shortest_line[1..-i].size
-        break
-      end
-    end
-    last_the_same_symbols += 1
-    last_token = first_line[last_the_same_symbols..-1]
-    diff_arr[index+1].sub!(%r#{Regexp.escape(last_token)}$/, FINISH + last_token)
-    diff_arr[index+2].sub!(%r#{Regexp.escape(last_token)}$/, FINISH + last_token)
-  end
-  diff_arr
-end
-
-
- -
- -
-
- - replace_markers(line) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/inline_diff.rb, line 58
-def replace_markers line
-  line.gsub!(START, "<span class='idiff'>")
-  line.gsub!(FINISH, "</span>")
-  line
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Issues.html b/doc/code/classes/Gitlab/Issues.html deleted file mode 100644 index 91c6dead2a6..00000000000 --- a/doc/code/classes/Gitlab/Issues.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Gitlab::Issues - - - - - - - - - - - - - -
-
- -
- -

Issues API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Logger.html b/doc/code/classes/Gitlab/Logger.html deleted file mode 100644 index 2c523c19219..00000000000 --- a/doc/code/classes/Gitlab/Logger.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - Gitlab::Logger - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
E
-
- -
- -
I
-
-
    - - -
  • - info -
  • - -
-
- -
R
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - build() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/logger.rb, line 22
-def self.build
-  new(Rails.root.join("log", file_name))
-end
-
-
- -
- -
-
- - error(message) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/logger.rb, line 3
-def self.error(message)
-  build.error(message)
-end
-
-
- -
- -
-
- - info(message) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/logger.rb, line 7
-def self.info(message)
-  build.info(message)
-end
-
-
- -
- -
-
- - read_latest() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/logger.rb, line 11
-def self.read_latest
-  path = Rails.root.join("log", file_name)
-  self.build unless File.exist?(path)
-  logs = %xtail -n 2000 #{path}`.split("\n")
-end
-
-
- -
- -
-
- - read_latest_for(filename) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/logger.rb, line 17
-def self.read_latest_for filename
-  path = Rails.root.join("log", filename)
-  logs = %xtail -n 2000 #{path}`.split("\n")
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Markdown.html b/doc/code/classes/Gitlab/Markdown.html deleted file mode 100644 index 45d853f3684..00000000000 --- a/doc/code/classes/Gitlab/Markdown.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - Gitlab::Markdown - - - - - - - - - - - - - -
-
- -
- -

Custom parser for GitLab-flavored Markdown

- -

It replaces references in the text with links to the appropriate items in -GitLab.

- -

Supported reference formats are:

- -
* @foo for team members
-* #123 for issues
-* !123 for merge requests
-* $123 for snippets
-* 123456 for commits
- -

It also parses Emoji codes to insert images. See www.emoji-cheat-sheet.com/ for -a list of the supported icons.

- -

Examples

- -
>> gfm("Hey @david, can you fix this?")
-=> "Hey <a href="/gitlab/team_members/1">@david</a>, can you fix this?"
-
->> gfm("Commit 35d5f7c closes #1234")
-=> "Commit <a href="/gitlab/commits/35d5f7c">35d5f7c</a> closes <a href="/gitlab/issues/1234">#1234</a>"
-
->> gfm(":trollface:")
-=> "<img alt=\":trollface:\" class=\"emoji\" src=\"/images/trollface.png" title=\":trollface:\" />
-
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
G
-
-
    - - -
  • - gfm -
  • - -
-
- -
- - - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REFERENCE_PATTERN=%r{ -(?<prefix>\W)? # Prefix -( # Reference -@(?<user>[a-zA-Z][a-zA-Z0-9_\-\.]*) # User name -|\#(?<issue>\d+) # Issue ID -|!(?<merge_request>\d+) # MR ID -|\$(?<snippet>\d+) # Snippet ID -|(?<commit>[\h]{6,40}) # Commit ID -) -(?<suffix>\W)? # Suffix -}x.freeze
 
TYPES=[:user, :issue, :merge_request, :snippet, :commit].freeze
 
EMOJI_PATTERN=%r{(:(\S+):)}.freeze
 
- - - - - -
Attributes
- - - - - - - - -
- [R] - html_options
- - - - - -
Instance Public methods
- -
-
- - gfm(text, html_options = {}) - - -
- - -
-

Public: Parse the provided text with GitLab-Flavored Markdown

- -

text - the source text #html_options - extra -options for the reference links as given to link_to

- -

Note: reference links will only be generated if @project is set

-
- - - - - - -
- - -
-
# File lib/gitlab/markdown.rb, line 52
-def gfm(text, html_options = {})
-  return text if text.nil?
-
-  # Duplicate the string so we don't alter the original, then call to_str
-  # to cast it back to a String instead of a SafeBuffer. This is required
-  # for gsub calls to work as we need them to.
-  text = text.dup.to_str
-
-  @html_options = html_options
-
-  # Extract pre blocks so they are not altered
-  # from http://github.github.com/github-flavored-markdown/
-  extractions = {}
-  text.gsub!(%r{<pre>.*?</pre>|<code>.*?</code>}) do |match|
-    md5 = Digest::MD5.hexdigest(match)
-    extractions[md5] = match
-    "{gfm-extraction-#{md5}}"
-  end
-
-  # TODO: add popups with additional information
-
-  text = parse(text)
-
-  # Insert pre block extractions
-  text.gsub!(%r\{gfm-extraction-(\h{32})\}/) do
-    extractions[$1]
-  end
-
-  sanitize text.html_safe, attributes: ActionView::Base.sanitized_allowed_attributes + %w(id class)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/MergeRequests.html b/doc/code/classes/Gitlab/MergeRequests.html deleted file mode 100644 index 556f2b01604..00000000000 --- a/doc/code/classes/Gitlab/MergeRequests.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Gitlab::MergeRequests - - - - - - - - - - - - - -
-
- -
- -

MergeRequest API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Milestones.html b/doc/code/classes/Gitlab/Milestones.html deleted file mode 100644 index 4226dab3d56..00000000000 --- a/doc/code/classes/Gitlab/Milestones.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Gitlab::Milestones - - - - - - - - - - - - - -
-
- -
- -

Milestones API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Notes.html b/doc/code/classes/Gitlab/Notes.html deleted file mode 100644 index 90d3e7af53a..00000000000 --- a/doc/code/classes/Gitlab/Notes.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Gitlab::Notes - - - - - - - - - - - - - -
-
- -
- -

Notes API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - -
NOTEABLE_TYPES=[Issue, Snippet]
 
- - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/ProjectMover.html b/doc/code/classes/Gitlab/ProjectMover.html deleted file mode 100644 index d13cf13d375..00000000000 --- a/doc/code/classes/Gitlab/ProjectMover.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - Gitlab::ProjectMover - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
E
-
- -
- -
L
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - -
- [R] - new_dir
- [R] - old_dir
- [R] - project
- - - - - -
Class Public methods
- -
-
- - new(project, old_dir, new_dir) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/project_mover.rb, line 10
-def initialize(project, old_dir, new_dir)
-  @project = project
-  @old_dir = old_dir
-  @new_dir = new_dir
-end
-
-
- -
- -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/project_mover.rb, line 16
-def execute
-  # Create new dir if missing
-  new_dir_path = File.join(Gitlab.config.gitolite.repos_path, new_dir)
-  system("mkdir -m 770 #{new_dir_path}") unless File.exists?(new_dir_path)
-
-  old_path = File.join(Gitlab.config.gitolite.repos_path, old_dir, "#{project.path}.git")
-  new_path = File.join(new_dir_path, "#{project.path}.git")
-
-  if File.exists? new_path
-    raise ProjectMoveError.new("Destination #{new_path} already exists")
-  end
-
-  if system("mv #{old_path} #{new_path}")
-    log_info "Project #{project.name} was moved from #{old_path} to #{new_path}"
-    true
-  else
-    message = "Project #{project.name} cannot be moved from #{old_path} to #{new_path}"
-    log_info "Error! #{message}"
-    raise ProjectMoveError.new(message)
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - log_info(message) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/project_mover.rb, line 40
-def log_info message
-  Gitlab::AppLogger.info message
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/ProjectMover/ProjectMoveError.html b/doc/code/classes/Gitlab/ProjectMover/ProjectMoveError.html deleted file mode 100644 index 0071ba0c636..00000000000 --- a/doc/code/classes/Gitlab/ProjectMover/ProjectMoveError.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Gitlab::ProjectMover::ProjectMoveError - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Projects.html b/doc/code/classes/Gitlab/Projects.html deleted file mode 100644 index 9005134ee6c..00000000000 --- a/doc/code/classes/Gitlab/Projects.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Gitlab::Projects - - - - - - - - - - - - - -
-
- -
- -

Projects API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Regex.html b/doc/code/classes/Gitlab/Regex.html deleted file mode 100644 index 674df3227af..00000000000 --- a/doc/code/classes/Gitlab/Regex.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - Gitlab::Regex - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
P
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - path_regex() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/regex.rb, line 13
-def path_regex
-  default_regex
-end
-
-
- -
- -
-
- - project_name_regex() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/regex.rb, line 9
-def project_name_regex
-  %r\A[a-zA-Z][a-zA-Z0-9_\-\. ]*\z/
-end
-
-
- -
- -
-
- - username_regex() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/regex.rb, line 5
-def username_regex
-  default_regex
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - default_regex() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/regex.rb, line 19
-def default_regex
-  %r\A[a-zA-Z][a-zA-Z0-9_\-\.]*\z/
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Satellite.html b/doc/code/classes/Gitlab/Satellite.html deleted file mode 100644 index 943bbf8eeab..00000000000 --- a/doc/code/classes/Gitlab/Satellite.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Gitlab::Satellite - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Satellite/Action.html b/doc/code/classes/Gitlab/Satellite/Action.html deleted file mode 100644 index abe7411ef1f..00000000000 --- a/doc/code/classes/Gitlab/Satellite/Action.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - Gitlab::Satellite::Action - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
P
-
- -
- -
- - - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - -
DEFAULT_OPTIONS={ git_timeout: 30.seconds }
 
- - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - -
- [RW] - options
- [RW] - project
- [RW] - user
- - - - - -
Class Public methods
- -
-
- - new(user, project, options = {}) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/action.rb, line 8
-def initialize(user, project, options = {})
-  @options = DEFAULT_OPTIONS.merge(options)
-  @project = project
-  @user = user
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - in_locked_and_timed_satellite() - - -
- - -
-
  • -

    Sets a 30s timeout for Git

    -
  • -

    Locks the satellite repo

    -
  • -

    Yields the prepared satellite repo

    -
-
- - - - - - -
- - -
-
# File lib/gitlab/satellite/action.rb, line 19
-def in_locked_and_timed_satellite
-  Grit::Git.with_timeout(options[:git_timeout]) do
-    project.satellite.lock do
-      return yield project.satellite.repo
-    end
-  end
-rescue Errno::ENOMEM => ex
-  Gitlab::GitLogger.error(ex.message)
-  return false
-rescue Grit::Git::GitTimeout => ex
-  Gitlab::GitLogger.error(ex.message)
-  return false
-end
-
-
- -
- -
-
- - prepare_satellite!(repo) - - -
- - -
-
  • -

    Clears the satellite

    -
  • -

    Updates the satellite from Gitolite

    -
  • -

    Sets up Git variables for the user

    -
- -

Note: use this within in_locked_and_timed_satellite

-
- - - - - - -
- - -
-
# File lib/gitlab/satellite/action.rb, line 38
-def prepare_satellite!(repo)
-  project.satellite.clear_and_update!
-
-  repo.git.config({}, "user.name", user.name)
-  repo.git.config({}, "user.email", user.email)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Satellite/EditFileAction.html b/doc/code/classes/Gitlab/Satellite/EditFileAction.html deleted file mode 100644 index 3a35aa22632..00000000000 --- a/doc/code/classes/Gitlab/Satellite/EditFileAction.html +++ /dev/null @@ -1,284 +0,0 @@ - - - - - Gitlab::Satellite::EditFileAction - - - - - - - - - - - - - -
-
- -
- -

GitLab server-side file update and commit

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - -
- [RW] - file_path
- [RW] - ref
- - - - - -
Class Public methods
- -
-
- - new(user, project, ref, file_path) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/edit_file_action.rb, line 7
-def initialize(user, project, ref, file_path)
-  super user, project, git_timeout: 10.seconds
-  @file_path = file_path
-  @ref = ref
-end
-
-
- -
- -
Instance Public methods
- -
-
- - commit!(content, commit_message, last_commit) - - -
- - -
-

Updates the files content and creates a new commit for it

- -

Returns false if the ref has been updated while editing the file Returns -false if commiting the change fails Returns false if pushing from the -satellite to Gitolite failed or was rejected -Returns true otherwise

-
- - - - - - -
- - -
-
# File lib/gitlab/satellite/edit_file_action.rb, line 19
-def commit!(content, commit_message, last_commit)
-  return false unless can_edit?(last_commit)
-
-  in_locked_and_timed_satellite do |repo|
-    prepare_satellite!(repo)
-
-    # create target branch in satellite at the corresponding commit from Gitolite
-    repo.git.checkout({raise: true, timeout: true, b: true}, ref, "origin/#{ref}")
-
-    # update the file in the satellite's working dir
-    file_path_in_satellite = File.join(repo.working_dir, file_path)
-    File.open(file_path_in_satellite, 'w') { |f| f.write(content) }
-
-    # commit the changes
-    # will raise CommandFailed when commit fails
-    repo.git.commit(raise: true, timeout: true, a: true, m: commit_message)
-
-
-    # push commit back to Gitolite
-    # will raise CommandFailed when push fails
-    repo.git.push({raise: true, timeout: true}, :origin, ref)
-
-    # everything worked
-    true
-  end
-rescue Grit::Git::CommandFailed => ex
-  Gitlab::GitLogger.error(ex.message)
-  false
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - can_edit?(last_commit) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/edit_file_action.rb, line 51
-def can_edit?(last_commit)
-  current_last_commit = @project.last_commit_for(ref, file_path).sha
-  last_commit == current_last_commit
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Satellite/MergeAction.html b/doc/code/classes/Gitlab/Satellite/MergeAction.html deleted file mode 100644 index 064c4f06e60..00000000000 --- a/doc/code/classes/Gitlab/Satellite/MergeAction.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - Gitlab::Satellite::MergeAction - - - - - - - - - - - - - -
-
- -
- -

GitLab server-side merge

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - -
- [RW] - merge_request
- - - - - -
Class Public methods
- -
-
- - new(user, merge_request) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/merge_action.rb, line 7
-def initialize(user, merge_request)
-  super user, merge_request.project
-  @merge_request = merge_request
-end
-
-
- -
- -
Instance Public methods
- -
-
- - can_be_merged?() - - -
- - -
-

Checks if a merge request can be executed without user interaction

-
- - - - - - -
- - -
-
# File lib/gitlab/satellite/merge_action.rb, line 13
-def can_be_merged?
-  in_locked_and_timed_satellite do |merge_repo|
-    merge_in_satellite!(merge_repo)
-  end
-end
-
-
- -
- -
-
- - merge!() - - -
- - -
-

Merges the source branch into the target branch in the satellite and pushes -it back to Gitolite. It also removes the -source branch if requested in the merge request.

- -

Returns false if the merge produced conflicts Returns false if pushing from -the satellite to Gitolite failed or was -rejected Returns true otherwise

-
- - - - - - -
- - -
-
# File lib/gitlab/satellite/merge_action.rb, line 26
-def merge!
-  in_locked_and_timed_satellite do |merge_repo|
-    if merge_in_satellite!(merge_repo)
-      # push merge back to Gitolite
-      # will raise CommandFailed when push fails
-      merge_repo.git.push({raise: true, timeout: true}, :origin, merge_request.target_branch)
-
-      # remove source branch
-      if merge_request.should_remove_source_branch && !project.root_ref?(merge_request.source_branch)
-        # will raise CommandFailed when push fails
-        merge_repo.git.push({raise: true, timeout: true}, :origin, ":#{merge_request.source_branch}")
-      end
-
-      # merge, push and branch removal successful
-      true
-    end
-  end
-rescue Grit::Git::CommandFailed => ex
-  Gitlab::GitLogger.error(ex.message)
-  false
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Satellite/Satellite.html b/doc/code/classes/Gitlab/Satellite/Satellite.html deleted file mode 100644 index 86d82e6ab33..00000000000 --- a/doc/code/classes/Gitlab/Satellite/Satellite.html +++ /dev/null @@ -1,506 +0,0 @@ - - - - - Gitlab::Satellite::Satellite - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
E
-
- -
- -
L
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
P
-
-
    - - -
  • - path -
  • - -
-
- -
R
-
-
    - - -
  • - repo -
  • - -
-
- -
- - - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - -
PARKING_BRANCH="__parking_branch"
 
- - - - - -
Attributes
- - - - - - - - -
- [RW] - project
- - - - - -
Class Public methods
- -
-
- - new(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 8
-def initialize(project)
-  @project = project
-end
-
-
- -
- -
Instance Public methods
- -
-
- - clear_and_update!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 12
-def clear_and_update!
-  raise "Satellite doesn't exist" unless exists?
-
-  delete_heads!
-  clear_working_dir!
-  update_from_source!
-end
-
-
- -
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 20
-def create
-  create_cmd = "git clone #{project.url_to_repo} #{path}"
-  if system(create_cmd)
-    true
-  else
-    Gitlab::GitLogger.error("Failed to create satellite for #{project.name_with_namespace}")
-    false
-  end
-end
-
-
- -
- -
-
- - exists?() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 30
-def exists?
-  File.exists? path
-end
-
-
- -
- -
-
- - lock() - - -
- - -
-
  • -

    Locks the satellite

    -
  • -

    Changes the current directory to the satellite’s working dir

    -
  • -

    Yields

    -
-
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 37
-def lock
-  raise "Satellite doesn't exist" unless exists?
-
-  File.open(lock_file, "w+") do |f|
-    f.flock(File::LOCK_EX)
-
-    Dir.chdir(path) do
-      return yield
-    end
-  end
-end
-
-
- -
- -
-
- - lock_file() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 49
-def lock_file
-  Rails.root.join("tmp", "satellite_#{project.id}.lock")
-end
-
-
- -
- -
-
- - path() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 53
-def path
-  Rails.root.join("tmp", "repo_satellites", project.path_with_namespace)
-end
-
-
- -
- -
-
- - repo() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/satellite/satellite.rb, line 57
-def repo
-  raise "Satellite doesn't exist" unless exists?
-
-  @repo ||= Grit::Repo.new(path)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Seeder.html b/doc/code/classes/Gitlab/Seeder.html deleted file mode 100644 index a62c96a5526..00000000000 --- a/doc/code/classes/Gitlab/Seeder.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Gitlab::Seeder - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
Q
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - quiet() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/seeder.rb, line 3
-def self.quiet
-  SeedFu.quiet = true
-  yield
-  SeedFu.quiet = false
-  puts "\nOK".green
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Session.html b/doc/code/classes/Gitlab/Session.html deleted file mode 100644 index ad14adc0d50..00000000000 --- a/doc/code/classes/Gitlab/Session.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Gitlab::Session - - - - - - - - - - - - - -
-
- -
- -

Users API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Theme.html b/doc/code/classes/Gitlab/Theme.html deleted file mode 100644 index 8f918b35ce4..00000000000 --- a/doc/code/classes/Gitlab/Theme.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - Gitlab::Theme - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - css_class_by_id(id) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/theme.rb, line 3
-def self.css_class_by_id(id)
-  themes = {
-    1 => "ui_basic",
-    2 => "ui_mars",
-    3 => "ui_modern",
-    4 => "ui_gray",
-    5 => "ui_color"
-  }
-
-  id ||= 1
-
-  return themes[id]
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab/Users.html b/doc/code/classes/Gitlab/Users.html deleted file mode 100644 index 50ba3131240..00000000000 --- a/doc/code/classes/Gitlab/Users.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Gitlab::Users - - - - - - - - - - - - - -
-
- -
- -

Users API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file -- cgit v1.2.1