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/Ability.html | 507 ------ doc/code/classes/Account.html | 1032 ------------ doc/code/classes/ActiveRecord.html | 79 - .../classes/ActiveRecord/ConnectionAdapters.html | 86 - .../ConnectionAdapters/Mysql2Adapter.html | 167 -- .../ConnectionAdapters/PostgreSQLAdapter.html | 191 --- .../PostgreSQLAdapter/TableDefinition.html | 135 -- doc/code/classes/ActivityObserver.html | 194 --- doc/code/classes/Admin.html | 114 -- doc/code/classes/Admin/DashboardController.html | 139 -- doc/code/classes/Admin/GroupsController.html | 586 ------- doc/code/classes/Admin/HooksController.html | 294 ---- doc/code/classes/Admin/LogsController.html | 76 - doc/code/classes/Admin/ProjectsController.html | 436 ----- doc/code/classes/Admin/ResqueController.html | 130 -- doc/code/classes/Admin/TeamMembersController.html | 234 --- doc/code/classes/Admin/UsersController.html | 616 ------- doc/code/classes/AdminController.html | 140 -- doc/code/classes/ApplicationController.html | 942 ----------- doc/code/classes/ApplicationDecorator.html | 76 - doc/code/classes/ApplicationHelper.html | 890 ---------- doc/code/classes/AttachmentUploader.html | 132 -- doc/code/classes/Authority.html | 528 ------ doc/code/classes/BaseContext.html | 261 --- doc/code/classes/BlameController.html | 152 -- doc/code/classes/BlobController.html | 160 -- doc/code/classes/Commit.html | 1077 ------------ doc/code/classes/CommitController.html | 160 -- doc/code/classes/CommitDecorator.html | 472 ------ doc/code/classes/CommitLoadContext.html | 159 -- doc/code/classes/CommitsController.html | 155 -- doc/code/classes/CommitsHelper.html | 409 ----- doc/code/classes/CompareController.html | 232 --- doc/code/classes/DashboardController.html | 411 ----- doc/code/classes/DashboardHelper.html | 195 --- doc/code/classes/DeployKeysController.html | 332 ---- doc/code/classes/ErrorsController.html | 131 -- doc/code/classes/Event.html | 1266 -------------- doc/code/classes/EventDecorator.html | 240 --- doc/code/classes/EventFilter.html | 543 ------ doc/code/classes/EventsHelper.html | 289 ---- doc/code/classes/ExtractsPath.html | 300 ---- .../classes/ExtractsPath/InvalidPathError.html | 82 - doc/code/classes/FileSizeValidator.html | 376 ----- doc/code/classes/FileSizeValidator/Helper.html | 94 -- doc/code/classes/GitHost.html | 125 -- doc/code/classes/Gitlab.html | 265 --- 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 - doc/code/classes/GitlabCiService.html | 371 ----- doc/code/classes/GitlabMarkdownHelper.html | 222 --- doc/code/classes/Grack.html | 81 - doc/code/classes/Grack/Auth.html | 419 ----- doc/code/classes/Group.html | 294 ---- doc/code/classes/GroupsController.html | 566 ------- doc/code/classes/HelpController.html | 130 -- doc/code/classes/HooksController.html | 286 ---- doc/code/classes/Issue.html | 174 -- doc/code/classes/IssueCommonality.html | 356 ---- .../classes/IssueCommonality/ClassMethods.html | 125 -- doc/code/classes/IssueObserver.html | 236 --- doc/code/classes/IssuesBulkUpdateContext.html | 149 -- doc/code/classes/IssuesController.html | 761 --------- doc/code/classes/IssuesHelper.html | 401 ----- doc/code/classes/IssuesListContext.html | 179 -- doc/code/classes/Key.html | 429 ----- doc/code/classes/KeyObserver.html | 186 --- doc/code/classes/KeysController.html | 330 ---- doc/code/classes/LabelsController.html | 180 -- doc/code/classes/MergeRequest.html | 1569 ------------------ doc/code/classes/MergeRequestObserver.html | 234 --- doc/code/classes/MergeRequestsController.html | 932 ----------- doc/code/classes/MergeRequestsHelper.html | 229 --- doc/code/classes/MergeRequestsLoadContext.html | 162 -- doc/code/classes/Milestone.html | 616 ------- doc/code/classes/MilestonesController.html | 589 ------- doc/code/classes/Namespace.html | 629 ------- doc/code/classes/NamespacedProject.html | 344 ---- doc/code/classes/NamespacesHelper.html | 146 -- doc/code/classes/Note.html | 536 ------ doc/code/classes/NoteEvent.html | 380 ----- doc/code/classes/NoteObserver.html | 290 ---- doc/code/classes/Notes.html | 88 - doc/code/classes/Notes/CreateContext.html | 136 -- doc/code/classes/Notes/LoadContext.html | 157 -- doc/code/classes/NotesController.html | 338 ---- doc/code/classes/NotesHelper.html | 258 --- doc/code/classes/Notify.html | 639 ------- doc/code/classes/Object.html | 88 - doc/code/classes/OmniauthCallbacksController.html | 188 --- doc/code/classes/PostReceive.html | 149 -- doc/code/classes/ProfileHelper.html | 127 -- doc/code/classes/ProfilesController.html | 513 ------ doc/code/classes/Project.html | 1392 ---------------- doc/code/classes/Project/TransferError.html | 76 - doc/code/classes/ProjectHook.html | 92 -- doc/code/classes/ProjectObserver.html | 262 --- doc/code/classes/ProjectResourceController.html | 76 - doc/code/classes/ProjectUpdateContext.html | 148 -- doc/code/classes/ProjectsController.html | 566 ------- doc/code/classes/ProjectsHelper.html | 384 ----- doc/code/classes/ProtectedBranch.html | 206 --- doc/code/classes/ProtectedBranchesController.html | 232 --- doc/code/classes/PushEvent.html | 959 ----------- doc/code/classes/PushObserver.html | 512 ------ doc/code/classes/Redcarpet.html | 79 - doc/code/classes/Redcarpet/Render.html | 79 - doc/code/classes/Redcarpet/Render/GitlabHTML.html | 264 --- doc/code/classes/RefsController.html | 313 ---- doc/code/classes/RepositoriesController.html | 325 ---- doc/code/classes/Repository.html | 1737 -------------------- doc/code/classes/ResqueAuthentication.html | 182 -- doc/code/classes/SearchContext.html | 262 --- doc/code/classes/SearchController.html | 136 -- doc/code/classes/Service.html | 94 -- doc/code/classes/ServiceHook.html | 92 -- doc/code/classes/ServicesController.html | 287 ---- doc/code/classes/Settings.html | 131 -- doc/code/classes/Snippet.html | 402 ----- doc/code/classes/SnippetsController.html | 611 ------- doc/code/classes/SnippetsHelper.html | 131 -- doc/code/classes/StaticModel.html | 377 ----- doc/code/classes/StaticModel/ClassMethods.html | 172 -- doc/code/classes/SystemHook.html | 191 --- doc/code/classes/SystemHookObserver.html | 227 --- doc/code/classes/SystemHookWorker.html | 131 -- doc/code/classes/TabHelper.html | 346 ---- doc/code/classes/TagsHelper.html | 170 -- doc/code/classes/Team.html | 470 ------ doc/code/classes/TeamMembersController.html | 438 ----- doc/code/classes/TestHookContext.html | 134 -- doc/code/classes/Tree.html | 322 ---- doc/code/classes/TreeController.html | 264 --- doc/code/classes/TreeDecorator.html | 281 ---- doc/code/classes/TreeHelper.html | 541 ------ doc/code/classes/User.html | 566 ------- doc/code/classes/UserDecorator.html | 178 -- doc/code/classes/UserObserver.html | 268 --- doc/code/classes/UsersProject.html | 871 ---------- doc/code/classes/UsersProjectObserver.html | 220 --- doc/code/classes/Votes.html | 307 ---- doc/code/classes/WebHook.html | 168 -- doc/code/classes/Wiki.html | 294 ---- doc/code/classes/WikisController.html | 397 ----- 193 files changed, 58041 deletions(-) delete mode 100644 doc/code/classes/Ability.html delete mode 100644 doc/code/classes/Account.html delete mode 100644 doc/code/classes/ActiveRecord.html delete mode 100644 doc/code/classes/ActiveRecord/ConnectionAdapters.html delete mode 100644 doc/code/classes/ActiveRecord/ConnectionAdapters/Mysql2Adapter.html delete mode 100644 doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html delete mode 100644 doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html delete mode 100644 doc/code/classes/ActivityObserver.html delete mode 100644 doc/code/classes/Admin.html delete mode 100644 doc/code/classes/Admin/DashboardController.html delete mode 100644 doc/code/classes/Admin/GroupsController.html delete mode 100644 doc/code/classes/Admin/HooksController.html delete mode 100644 doc/code/classes/Admin/LogsController.html delete mode 100644 doc/code/classes/Admin/ProjectsController.html delete mode 100644 doc/code/classes/Admin/ResqueController.html delete mode 100644 doc/code/classes/Admin/TeamMembersController.html delete mode 100644 doc/code/classes/Admin/UsersController.html delete mode 100644 doc/code/classes/AdminController.html delete mode 100644 doc/code/classes/ApplicationController.html delete mode 100644 doc/code/classes/ApplicationDecorator.html delete mode 100644 doc/code/classes/ApplicationHelper.html delete mode 100644 doc/code/classes/AttachmentUploader.html delete mode 100644 doc/code/classes/Authority.html delete mode 100644 doc/code/classes/BaseContext.html delete mode 100644 doc/code/classes/BlameController.html delete mode 100644 doc/code/classes/BlobController.html delete mode 100644 doc/code/classes/Commit.html delete mode 100644 doc/code/classes/CommitController.html delete mode 100644 doc/code/classes/CommitDecorator.html delete mode 100644 doc/code/classes/CommitLoadContext.html delete mode 100644 doc/code/classes/CommitsController.html delete mode 100644 doc/code/classes/CommitsHelper.html delete mode 100644 doc/code/classes/CompareController.html delete mode 100644 doc/code/classes/DashboardController.html delete mode 100644 doc/code/classes/DashboardHelper.html delete mode 100644 doc/code/classes/DeployKeysController.html delete mode 100644 doc/code/classes/ErrorsController.html delete mode 100644 doc/code/classes/Event.html delete mode 100644 doc/code/classes/EventDecorator.html delete mode 100644 doc/code/classes/EventFilter.html delete mode 100644 doc/code/classes/EventsHelper.html delete mode 100644 doc/code/classes/ExtractsPath.html delete mode 100644 doc/code/classes/ExtractsPath/InvalidPathError.html delete mode 100644 doc/code/classes/FileSizeValidator.html delete mode 100644 doc/code/classes/FileSizeValidator/Helper.html delete mode 100644 doc/code/classes/GitHost.html delete mode 100644 doc/code/classes/Gitlab.html 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 delete mode 100644 doc/code/classes/GitlabCiService.html delete mode 100644 doc/code/classes/GitlabMarkdownHelper.html delete mode 100644 doc/code/classes/Grack.html delete mode 100644 doc/code/classes/Grack/Auth.html delete mode 100644 doc/code/classes/Group.html delete mode 100644 doc/code/classes/GroupsController.html delete mode 100644 doc/code/classes/HelpController.html delete mode 100644 doc/code/classes/HooksController.html delete mode 100644 doc/code/classes/Issue.html delete mode 100644 doc/code/classes/IssueCommonality.html delete mode 100644 doc/code/classes/IssueCommonality/ClassMethods.html delete mode 100644 doc/code/classes/IssueObserver.html delete mode 100644 doc/code/classes/IssuesBulkUpdateContext.html delete mode 100644 doc/code/classes/IssuesController.html delete mode 100644 doc/code/classes/IssuesHelper.html delete mode 100644 doc/code/classes/IssuesListContext.html delete mode 100644 doc/code/classes/Key.html delete mode 100644 doc/code/classes/KeyObserver.html delete mode 100644 doc/code/classes/KeysController.html delete mode 100644 doc/code/classes/LabelsController.html delete mode 100644 doc/code/classes/MergeRequest.html delete mode 100644 doc/code/classes/MergeRequestObserver.html delete mode 100644 doc/code/classes/MergeRequestsController.html delete mode 100644 doc/code/classes/MergeRequestsHelper.html delete mode 100644 doc/code/classes/MergeRequestsLoadContext.html delete mode 100644 doc/code/classes/Milestone.html delete mode 100644 doc/code/classes/MilestonesController.html delete mode 100644 doc/code/classes/Namespace.html delete mode 100644 doc/code/classes/NamespacedProject.html delete mode 100644 doc/code/classes/NamespacesHelper.html delete mode 100644 doc/code/classes/Note.html delete mode 100644 doc/code/classes/NoteEvent.html delete mode 100644 doc/code/classes/NoteObserver.html delete mode 100644 doc/code/classes/Notes.html delete mode 100644 doc/code/classes/Notes/CreateContext.html delete mode 100644 doc/code/classes/Notes/LoadContext.html delete mode 100644 doc/code/classes/NotesController.html delete mode 100644 doc/code/classes/NotesHelper.html delete mode 100644 doc/code/classes/Notify.html delete mode 100644 doc/code/classes/Object.html delete mode 100644 doc/code/classes/OmniauthCallbacksController.html delete mode 100644 doc/code/classes/PostReceive.html delete mode 100644 doc/code/classes/ProfileHelper.html delete mode 100644 doc/code/classes/ProfilesController.html delete mode 100644 doc/code/classes/Project.html delete mode 100644 doc/code/classes/Project/TransferError.html delete mode 100644 doc/code/classes/ProjectHook.html delete mode 100644 doc/code/classes/ProjectObserver.html delete mode 100644 doc/code/classes/ProjectResourceController.html delete mode 100644 doc/code/classes/ProjectUpdateContext.html delete mode 100644 doc/code/classes/ProjectsController.html delete mode 100644 doc/code/classes/ProjectsHelper.html delete mode 100644 doc/code/classes/ProtectedBranch.html delete mode 100644 doc/code/classes/ProtectedBranchesController.html delete mode 100644 doc/code/classes/PushEvent.html delete mode 100644 doc/code/classes/PushObserver.html delete mode 100644 doc/code/classes/Redcarpet.html delete mode 100644 doc/code/classes/Redcarpet/Render.html delete mode 100644 doc/code/classes/Redcarpet/Render/GitlabHTML.html delete mode 100644 doc/code/classes/RefsController.html delete mode 100644 doc/code/classes/RepositoriesController.html delete mode 100644 doc/code/classes/Repository.html delete mode 100644 doc/code/classes/ResqueAuthentication.html delete mode 100644 doc/code/classes/SearchContext.html delete mode 100644 doc/code/classes/SearchController.html delete mode 100644 doc/code/classes/Service.html delete mode 100644 doc/code/classes/ServiceHook.html delete mode 100644 doc/code/classes/ServicesController.html delete mode 100644 doc/code/classes/Settings.html delete mode 100644 doc/code/classes/Snippet.html delete mode 100644 doc/code/classes/SnippetsController.html delete mode 100644 doc/code/classes/SnippetsHelper.html delete mode 100644 doc/code/classes/StaticModel.html delete mode 100644 doc/code/classes/StaticModel/ClassMethods.html delete mode 100644 doc/code/classes/SystemHook.html delete mode 100644 doc/code/classes/SystemHookObserver.html delete mode 100644 doc/code/classes/SystemHookWorker.html delete mode 100644 doc/code/classes/TabHelper.html delete mode 100644 doc/code/classes/TagsHelper.html delete mode 100644 doc/code/classes/Team.html delete mode 100644 doc/code/classes/TeamMembersController.html delete mode 100644 doc/code/classes/TestHookContext.html delete mode 100644 doc/code/classes/Tree.html delete mode 100644 doc/code/classes/TreeController.html delete mode 100644 doc/code/classes/TreeDecorator.html delete mode 100644 doc/code/classes/TreeHelper.html delete mode 100644 doc/code/classes/User.html delete mode 100644 doc/code/classes/UserDecorator.html delete mode 100644 doc/code/classes/UserObserver.html delete mode 100644 doc/code/classes/UsersProject.html delete mode 100644 doc/code/classes/UsersProjectObserver.html delete mode 100644 doc/code/classes/Votes.html delete mode 100644 doc/code/classes/WebHook.html delete mode 100644 doc/code/classes/Wiki.html delete mode 100644 doc/code/classes/WikisController.html (limited to 'doc/code/classes') diff --git a/doc/code/classes/Ability.html b/doc/code/classes/Ability.html deleted file mode 100644 index c50e5d3e708..00000000000 --- a/doc/code/classes/Ability.html +++ /dev/null @@ -1,507 +0,0 @@ - - - - - Ability - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
G
-
- -
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - allowed(object, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 3
-def allowed(object, subject)
-  case subject.class.name
-  when "Project" then project_abilities(object, subject)
-  when "Issue" then issue_abilities(object, subject)
-  when "Note" then note_abilities(object, subject)
-  when "Snippet" then snippet_abilities(object, subject)
-  when "MergeRequest" then merge_request_abilities(object, subject)
-  when "Group" then group_abilities(object, subject)
-  else []
-  end
-end
-
-
- -
- -
-
- - group_abilities(user, group) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 107
-def group_abilities user, group
-  rules = []
-
-  rules << [
-    :manage_group
-  ] if group.owner == user
-
-  rules.flatten
-end
-
-
- -
- -
-
- - project_abilities(user, project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 15
-def project_abilities(user, project)
-  rules = []
-
-  # Rules based on role in project
-  if project.master_access_for?(user)
-    rules << project_master_rules
-
-  elsif project.dev_access_for?(user)
-    rules << project_dev_rules
-
-  elsif project.report_access_for?(user)
-    rules << project_report_rules
-
-  elsif project.guest_access_for?(user)
-    rules << project_guest_rules
-  end
-
-  if project.namespace
-    # If user own project namespace
-    # (Ex. group owner or account owner)
-    if project.namespace.owner == user
-      rules << project_admin_rules
-    end
-  else
-    # For compatibility with global projects
-    # use projects.owner_id
-    if project.owner == user
-      rules << project_admin_rules
-    end
-  end
-
-
-  rules.flatten
-end
-
-
- -
- -
-
- - project_admin_rules() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 99
-def project_admin_rules
-  project_master_rules + [
-    :change_namespace,
-    :rename_project,
-    :remove_project
-  ]
-end
-
-
- -
- -
-
- - project_dev_rules() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 74
-def project_dev_rules
-  project_report_rules + [
-    :write_wiki,
-    :push_code
-  ]
-end
-
-
- -
- -
-
- - project_guest_rules() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 50
-def project_guest_rules
-  [
-    :read_project,
-    :read_wiki,
-    :read_issue,
-    :read_milestone,
-    :read_snippet,
-    :read_team_member,
-    :read_merge_request,
-    :read_note,
-    :write_project,
-    :write_issue,
-    :write_note
-  ]
-end
-
-
- -
- -
-
- - project_master_rules() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 81
-def project_master_rules
-  project_dev_rules + [
-    :push_code_to_protected_branches,
-    :modify_issue,
-    :modify_snippet,
-    :modify_merge_request,
-    :admin_issue,
-    :admin_milestone,
-    :admin_snippet,
-    :admin_team_member,
-    :admin_merge_request,
-    :admin_note,
-    :accept_mr,
-    :admin_wiki,
-    :admin_project
-  ]
-end
-
-
- -
- -
-
- - project_report_rules() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/ability.rb, line 66
-def project_report_rules
-  project_guest_rules + [
-    :download_code,
-    :write_merge_request,
-    :write_snippet
-  ]
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Account.html b/doc/code/classes/Account.html deleted file mode 100644 index 21119cc8462..00000000000 --- a/doc/code/classes/Account.html +++ /dev/null @@ -1,1032 +0,0 @@ - - - - - Account - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
F
-
- -
- -
I
-
- -
- -
L
-
- -
- -
M
-
- -
- -
N
-
- -
- -
P
-
- -
- -
R
-
- -
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - abilities() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 29
-def abilities
-  @abilities ||= begin
-                   abilities = Six.new
-                   abilities << Ability
-                   abilities
-                 end
-end
-
-
- -
- -
-
- - authorized_groups() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 109
-def authorized_groups
-  @authorized_groups ||= begin
-                         groups = Group.where(id: self.projects.pluck(:namespace_id)).all
-                         groups = groups + self.groups
-                         groups.uniq
-                       end
-end
-
-
- -
- -
-
- - authorized_projects() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 117
-def authorized_projects
-  Project.authorized_for(self)
-end
-
-
- -
- -
-
- - block() - - -
- - -
-

Remove user from all projects and set blocked attribute to true

-
- - - - - - -
- - -
-
# File app/roles/account.rb, line 59
-def block
-  users_projects.find_each do |membership|
-    return false unless membership.destroy
-  end
-
-  self.blocked = true
-  save
-end
-
-
- -
- -
-
- - can?(action, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 37
-def can? action, subject
-  abilities.allowed?(self, action, subject)
-end
-
-
- -
- -
-
- - can_create_group?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 25
-def can_create_group?
-  is_admin?
-end
-
-
- -
- -
-
- - can_create_project?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 21
-def can_create_project?
-  projects_limit > my_own_projects.count
-end
-
-
- -
- -
-
- - cared_merge_requests() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 49
-def cared_merge_requests
-  MergeRequest.where("author_id = :id or assignee_id = :id", id: self.id)
-end
-
-
- -
- -
-
- - first_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 45
-def first_name
-  name.split.first unless name.blank?
-end
-
-
- -
- -
-
- - identifier() - - -
- - -
-

Returns a string for use as a Gitolite user identifier

- -

Note that Gitolite 2.x requires the following -pattern for users:

- -
^@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$
-
- - - - - - -
- - -
-
# File app/roles/account.rb, line 7
-def identifier
-  # Replace non-word chars with underscores, then make sure it starts with
-  # valid chars
-  email.gsub(%r\W/, '_').gsub(%r\A([\W\_])+/, '')
-end
-
-
- -
- -
-
- - is_admin?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 13
-def is_admin?
-  admin
-end
-
-
- -
- -
-
- - last_activity_project() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 41
-def last_activity_project
-  projects.first
-end
-
-
- -
- -
-
- - my_own_projects() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 121
-def my_own_projects
-  Project.personal(self)
-end
-
-
- -
- -
-
- - namespace_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 105
-def namespace_id
-  namespace.try :id
-end
-
-
- -
- -
-
- - namespaces() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 86
-def namespaces
-  namespaces = []
-
-  # Add user account namespace
-  namespaces << self.namespace if self.namespace
-
-  # Add groups you can manage
-  namespaces += if admin
-                  Group.all
-                else
-                  groups.all
-                end
-  namespaces
-end
-
-
- -
- -
-
- - project_ids() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 53
-def project_ids
-  projects.map(&:id)
-end
-
-
- -
- -
-
- - projects_limit_percent() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 68
-def projects_limit_percent
-  return 100 if projects_limit.zero?
-  (my_own_projects.count.to_f / projects_limit) * 100
-end
-
-
- -
- -
-
- - projects_sorted_by_activity() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 82
-def projects_sorted_by_activity
-  projects.sorted_by_activity
-end
-
-
- -
- -
-
- - recent_push(project_id = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 73
-def recent_push project_id = nil
-  # Get push events not earlier than 2 hours ago
-  events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours)
-  events = events.where(project_id: project_id) if project_id
-
-  # Take only latest one
-  events = events.recent.limit(1).first
-end
-
-
- -
- -
-
- - require_ssh_key?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 17
-def require_ssh_key?
-  keys.count == 0
-end
-
-
- -
- -
-
- - several_namespaces?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/account.rb, line 101
-def several_namespaces?
-  namespaces.size > 1
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ActiveRecord.html b/doc/code/classes/ActiveRecord.html deleted file mode 100644 index fdf88c1cf34..00000000000 --- a/doc/code/classes/ActiveRecord.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - ActiveRecord - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ActiveRecord/ConnectionAdapters.html b/doc/code/classes/ActiveRecord/ConnectionAdapters.html deleted file mode 100644 index ec3891660ab..00000000000 --- a/doc/code/classes/ActiveRecord/ConnectionAdapters.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - ActiveRecord::ConnectionAdapters - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ActiveRecord/ConnectionAdapters/Mysql2Adapter.html b/doc/code/classes/ActiveRecord/ConnectionAdapters/Mysql2Adapter.html deleted file mode 100644 index 2c8d740a69a..00000000000 --- a/doc/code/classes/ActiveRecord/ConnectionAdapters/Mysql2Adapter.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - ActiveRecord::ConnectionAdapters::Mysql2Adapter - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute(*args) - - -
- - -
- -
- - - -
- Also aliased as: execute_without_retry -
- - - - -
- - -
-
# File config/initializers/connection_fix.rb, line 21
-def execute(*args)
-  execute_without_retry(*args)
-rescue ActiveRecord::StatementInvalid => e
-  if e.message =~ %rserver has gone away/
-    warn "Server timed out, retrying"
-    reconnect!
-    retry
-  else
-    raise e
-  end
-end
-
-
- -
- -
-
- - execute_without_retry(*args) - - -
- - -
- -
- - - - - -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html b/doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html deleted file mode 100644 index 0ee82105cd4..00000000000 --- a/doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - ActiveRecord::ConnectionAdapters::PostgreSQLAdapter - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - add_column_with_limit_filter(table_name, column_name, type, options = {}) - - -
- - -
- -
- - - - - - -
- - -
-
# File config/initializers/postgresql_limit_fix.rb, line 13
-def add_column_with_limit_filter(table_name, column_name, type, options = {})
-  options.delete(:limit) if type == :text
-  add_column_without_limit_filter(table_name, column_name, type, options)
-end
-
-
- -
- -
-
- - change_column_with_limit_filter(table_name, column_name, type, options = {}) - - -
- - -
- -
- - - - - - -
- - -
-
# File config/initializers/postgresql_limit_fix.rb, line 18
-def change_column_with_limit_filter(table_name, column_name, type, options = {})
-  options.delete(:limit) if type == :text
-  change_column_without_limit_filter(table_name, column_name, type, options)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html b/doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html deleted file mode 100644 index f2ea0db417a..00000000000 --- a/doc/code/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
T
-
-
    - - -
  • - text -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - text(*args) - - -
- - -
- -
- - - - - - -
- - -
-
# File config/initializers/postgresql_limit_fix.rb, line 4
-def text(*args)
-  options = args.extract_options!
-  options.delete(:limit)
-  column_names = args
-  type = :text
-  column_names.each { |name| column(name, type, options) }
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ActivityObserver.html b/doc/code/classes/ActivityObserver.html deleted file mode 100644 index 31f4982edd0..00000000000 --- a/doc/code/classes/ActivityObserver.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - ActivityObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(record) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/activity_observer.rb, line 4
-def after_create(record)
-  event_author_id = record.author_id
-
-  # Skip status notes
-  if record.kind_of?(Note) && record.note.include?("_Status changed to ")
-    return true
-  end
-
-  if event_author_id
-    Event.create(
-      project: record.project,
-      target_id: record.id,
-      target_type: record.class.name,
-      action: Event.determine_action(record),
-      author_id: event_author_id
-    )
-  end
-end
-
-
- -
- -
-
- - after_save(record) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/activity_observer.rb, line 23
-def after_save(record)
-  if record.changed.include?("closed") && record.author_id_of_changes
-    Event.create(
-      project: record.project,
-      target_id: record.id,
-      target_type: record.class.name,
-      action: (record.closed ? Event::Closed : Event::Reopened),
-      author_id: record.author_id_of_changes
-    )
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin.html b/doc/code/classes/Admin.html deleted file mode 100644 index ba82287d551..00000000000 --- a/doc/code/classes/Admin.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - Admin - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/DashboardController.html b/doc/code/classes/Admin/DashboardController.html deleted file mode 100644 index 02643b7fe39..00000000000 --- a/doc/code/classes/Admin/DashboardController.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - Admin::DashboardController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
I
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/dashboard_controller.rb, line 2
-def index
-  @projects = Project.order("created_at DESC").limit(10)
-  @users = User.order("created_at DESC").limit(10)
-
-  @resque_accessible = true
-  @workers = Resque.workers
-  @pending_jobs = Resque.size(:post_receive)
-
-rescue Redis::InheritedError
-  @resque_accessible = false
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/GroupsController.html b/doc/code/classes/Admin/GroupsController.html deleted file mode 100644 index b3651e8b98e..00000000000 --- a/doc/code/classes/Admin/GroupsController.html +++ /dev/null @@ -1,586 +0,0 @@ - - - - - Admin::GroupsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
P
-
- -
- -
R
-
- -
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 26
-def create
-  @group = Group.new(params[:group])
-  @group.path = @group.name.dup.parameterize if @group.name
-  @group.owner = current_user
-
-  if @group.save
-    redirect_to [:admin, @group], notice: 'Group was successfully created.'
-  else
-    render action: "new"
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 75
-def destroy
-  @group.truncate_teams
-
-  @group.destroy
-
-  redirect_to admin_groups_path, notice: 'Group was successfully deleted.'
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 23
-def edit
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 4
-def index
-  @groups = Group.order('name ASC')
-  @groups = @groups.search(params[:name]) if params[:name].present?
-  @groups = @groups.page(params[:page]).per(20)
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 19
-def new
-  @group = Group.new
-end
-
-
- -
- -
-
- - project_teams_update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 70
-def project_teams_update
-  @group.add_users_to_project_teams(params[:user_ids], params[:project_access])
-  redirect_to [:admin, @group], notice: 'Users was successfully added.'
-end
-
-
- -
- -
-
- - project_update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 53
-def project_update
-  project_ids = params[:project_ids]
-
-  Project.where(id: project_ids).each do |project|
-    project.transfer(@group)
-  end
-
-  redirect_to :back, notice: 'Group was successfully updated.'
-end
-
-
- -
- -
-
- - remove_project() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 63
-def remove_project
-  @project = Project.find(params[:project_id])
-  @project.transfer(nil)
-
-  redirect_to :back, notice: 'Group was successfully updated.'
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 10
-def show
-  @projects = Project.scoped
-  @projects = @projects.not_in_group(@group) if @group.projects.present?
-  @projects = @projects.all
-  @projects.reject!(&:empty_repo?)
-
-  @users = User.active
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/groups_controller.rb, line 38
-def update
-  group_params = params[:group].dup
-  owner_id =group_params.delete(:owner_id)
-
-  if owner_id
-    @group.owner = User.find(owner_id)
-  end
-
-  if @group.update_attributes(group_params)
-    redirect_to [:admin, @group], notice: 'Group was successfully updated.'
-  else
-    render action: "edit"
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/HooksController.html b/doc/code/classes/Admin/HooksController.html deleted file mode 100644 index 1d56fbc7b98..00000000000 --- a/doc/code/classes/Admin/HooksController.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Admin::HooksController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
T
-
-
    - - -
  • - test -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/hooks_controller.rb, line 7
-def create
-  @hook = SystemHook.new(params[:hook])
-
-  if @hook.save
-    redirect_to admin_hooks_path, notice: 'Hook was successfully created.'
-  else
-    @hooks = SystemHook.all
-    render :index
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/hooks_controller.rb, line 18
-def destroy
-  @hook = SystemHook.find(params[:id])
-  @hook.destroy
-
-  redirect_to admin_hooks_path
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/hooks_controller.rb, line 2
-def index
-  @hooks = SystemHook.all
-  @hook = SystemHook.new
-end
-
-
- -
- -
-
- - test() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/hooks_controller.rb, line 26
-def test
-  @hook = SystemHook.find(params[:hook_id])
-  data = {
-    event_name: "project_create",
-    name: "Ruby",
-    path: "ruby",
-    project_id: 1,
-    owner_name: "Someone",
-    owner_email: "example@gitlabhq.com"
-  }
-  @hook.execute(data)
-
-  redirect_to :back
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/LogsController.html b/doc/code/classes/Admin/LogsController.html deleted file mode 100644 index 8782d95f5ac..00000000000 --- a/doc/code/classes/Admin/LogsController.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Admin::LogsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/ProjectsController.html b/doc/code/classes/Admin/ProjectsController.html deleted file mode 100644 index 1a0bd492112..00000000000 --- a/doc/code/classes/Admin/ProjectsController.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - - Admin::ProjectsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
P
-
- -
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 37
-def destroy
-  # Delete team first in order to prevent multiple gitolite calls
-  @project.truncate_team
-
-  @project.destroy
-
-  redirect_to admin_projects_path, notice: 'Project was successfully deleted.'
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 18
-def edit
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 4
-def index
-  @projects = Project.scoped
-  @projects = @projects.where(namespace_id: params[:namespace_id]) if params[:namespace_id].present?
-  @projects = @projects.where(namespace_id: nil) if params[:namespace_id] == Namespace.global_id
-  @projects = @projects.search(params[:name]) if params[:name].present?
-  @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 12
-def show
-  @users = User.active
-  @users = @users.not_in_project(@project) if @project.users.present?
-  @users = @users.all
-end
-
-
- -
- -
-
- - team_update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 21
-def team_update
-  @project.add_users_ids_to_team(params[:user_ids], params[:project_access])
-
-  redirect_to [:admin, @project], notice: 'Project was successfully updated.'
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 27
-def update
-  status = ProjectUpdateContext.new(project, current_user, params).execute(:admin)
-
-  if status
-    redirect_to [:admin, @project], notice: 'Project was successfully updated.'
-  else
-    render action: "edit"
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - project() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/projects_controller.rb, line 48
-def project
-  id = params[:project_id] || params[:id]
-
-  @project = Project.find_with_namespace(id)
-  @project || render_404
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/ResqueController.html b/doc/code/classes/Admin/ResqueController.html deleted file mode 100644 index 52cb2f870e9..00000000000 --- a/doc/code/classes/Admin/ResqueController.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - Admin::ResqueController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/resque_controller.rb, line 2
-def show
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/TeamMembersController.html b/doc/code/classes/Admin/TeamMembersController.html deleted file mode 100644 index b055f509137..00000000000 --- a/doc/code/classes/Admin/TeamMembersController.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Admin::TeamMembersController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/team_members_controller.rb, line 16
-def destroy
-  @admin_team_member = UsersProject.find(params[:id])
-  @admin_team_member.destroy
-
-  redirect_to :back
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/team_members_controller.rb, line 2
-def edit
-  @admin_team_member = UsersProject.find(params[:id])
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/team_members_controller.rb, line 6
-def update
-  @admin_team_member = UsersProject.find(params[:id])
-
-  if @admin_team_member.update_attributes(params[:team_member])
-    redirect_to [:admin, @admin_team_member.project],  notice: 'Project Access was successfully updated.'
-  else
-    render action: "edit"
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Admin/UsersController.html b/doc/code/classes/Admin/UsersController.html deleted file mode 100644 index cfe1e514ae8..00000000000 --- a/doc/code/classes/Admin/UsersController.html +++ /dev/null @@ -1,616 +0,0 @@ - - - - - Admin::UsersController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - block() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 40
-def block
-  @admin_user = User.find(params[:id])
-
-  if @admin_user.block
-    redirect_to :back, alert: "Successfully blocked"
-  else
-    redirect_to :back, alert: "Error occured. User was not blocked"
-  end
-end
-
-
- -
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 60
-def create
-  admin = params[:user].delete("admin")
-
-  @admin_user = User.new(params[:user], as: :admin)
-  @admin_user.admin = (admin && admin.to_i > 0)
-
-  respond_to do |format|
-    if @admin_user.save
-      format.html { redirect_to [:admin, @admin_user], notice: 'User was successfully created.' }
-      format.json { render json: @admin_user, status: :created, location: @admin_user }
-    else
-      format.html { render action: "new" }
-      format.json { render json: @admin_user.errors, status: :unprocessable_entity }
-    end
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 99
-def destroy
-  @admin_user = User.find(params[:id])
-  if @admin_user.my_own_projects.count > 0
-    redirect_to admin_users_path, alert: "User is a project owner and can't be removed." and return
-  end
-  @admin_user.destroy
-
-  respond_to do |format|
-    format.html { redirect_to admin_users_url }
-    format.json { head :ok }
-  end
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 36
-def edit
-  @admin_user = User.find(params[:id])
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 2
-def index
-  @admin_users = User.scoped
-  @admin_users = @admin_users.filter(params[:filter])
-  @admin_users = @admin_users.search(params[:name]) if params[:name].present?
-  @admin_users = @admin_users.alphabetically.page(params[:page])
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 32
-def new
-  @admin_user = User.new({ projects_limit: Gitlab.config.gitlab.default_projects_limit }, as: :admin)
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 9
-def show
-  @admin_user = User.find(params[:id])
-
-  @projects = if @admin_user.projects.empty?
-             Project
-           else
-             Project.without_user(@admin_user)
-           end.all
-end
-
-
- -
- -
-
- - team_update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 19
-def team_update
-  @admin_user = User.find(params[:id])
-
-  UsersProject.user_bulk_import(
-    @admin_user,
-    params[:project_ids],
-    params[:project_access]
-  )
-
-  redirect_to [:admin, @admin_user], notice: 'Teams were successfully updated.'
-end
-
-
- -
- -
-
- - unblock() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 50
-def unblock
-  @admin_user = User.find(params[:id])
-
-  if @admin_user.update_attribute(:blocked, false)
-    redirect_to :back, alert: "Successfully unblocked"
-  else
-    redirect_to :back, alert: "Error occured. User was not unblocked"
-  end
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin/users_controller.rb, line 77
-def update
-  admin = params[:user].delete("admin")
-
-  if params[:user][:password].blank?
-    params[:user].delete(:password)
-    params[:user].delete(:password_confirmation)
-  end
-
-  @admin_user = User.find(params[:id])
-  @admin_user.admin = (admin && admin.to_i > 0)
-
-  respond_to do |format|
-    if @admin_user.update_attributes(params[:user], as: :admin)
-      format.html { redirect_to [:admin, @admin_user], notice: 'User was successfully updated.' }
-      format.json { head :ok }
-    else
-      format.html { render action: "edit" }
-      format.json { render json: @admin_user.errors, status: :unprocessable_entity }
-    end
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/AdminController.html b/doc/code/classes/AdminController.html deleted file mode 100644 index 629a30fe62c..00000000000 --- a/doc/code/classes/AdminController.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - AdminController - - - - - - - - - - - - - -
-
- -
- -

Provides a base class for Admin controllers to -subclass

- -

Automatically sets the layout and ensures an administrator is logged in

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - authenticate_admin!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/admin_controller.rb, line 8
-def authenticate_admin!
-  return render_404 unless current_user.is_admin?
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ApplicationController.html b/doc/code/classes/ApplicationController.html deleted file mode 100644 index f1c3bed954e..00000000000 --- a/doc/code/classes/ApplicationController.html +++ /dev/null @@ -1,942 +0,0 @@ - - - - - ApplicationController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
-
    - - -
  • - can? -
  • - -
-
- -
D
-
- -
- -
G
-
- -
- -
L
-
- -
- -
M
-
- -
- -
N
-
- -
- -
P
-
- -
- -
R
-
- -
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Protected methods
- -
-
- - abilities() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 58
-def abilities
-  @abilities ||= Six.new
-end
-
-
- -
- -
-
- - access_denied!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 91
-def access_denied!
-  render "errors/access_denied", layout: "errors", status: 404
-end
-
-
- -
- -
-
- - add_abilities() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 79
-def add_abilities
-  abilities << Ability
-end
-
-
- -
- -
-
- - after_sign_in_path_for(resource) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 43
-def after_sign_in_path_for resource
-  if resource.is_a?(User) && resource.respond_to?(:blocked) && resource.blocked
-    sign_out resource
-    flash[:alert] = "Your account is blocked. Retry when an admin unblock it."
-    new_user_session_path
-  else
-    super
-  end
-end
-
-
- -
- -
-
- - authorize_code_access!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 87
-def authorize_code_access!
-  return access_denied! unless can?(current_user, :download_code, project)
-end
-
-
- -
- -
-
- - authorize_project!(action) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 83
-def authorize_project!(action)
-  return access_denied! unless can?(current_user, action, project)
-end
-
-
- -
- -
-
- - can?(object, action, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 62
-def can?(object, action, subject)
-  abilities.allowed?(object, action, subject)
-end
-
-
- -
- -
-
- - dev_tools() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 129
-def dev_tools
-  Rack::MiniProfiler.authorize_request
-end
-
-
- -
- -
-
- - git_not_found!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 99
-def git_not_found!
-  render "errors/git_not_found", layout: "errors", status: 404
-end
-
-
- -
- -
-
- - log_exception(exception) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 29
-def log_exception(exception)
-  application_trace = ActionDispatch::ExceptionWrapper.new(env, exception).application_trace
-  application_trace.map!{ |t| "  #{t}\n" }
-  logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"
-end
-
-
- -
- -
-
- - method_missing(method_sym, *arguments, &block) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 103
-def method_missing(method_sym, *arguments, &block)
-  if method_sym.to_s =~ %r^authorize_(.*)!$/
-    authorize_project!($1.to_sym)
-  else
-    super
-  end
-end
-
-
- -
- -
-
- - no_cache_headers() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 123
-def no_cache_headers
-  response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
-  response.headers["Pragma"] = "no-cache"
-  response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
-end
-
-
- -
- -
-
- - not_found!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 95
-def not_found!
-  render "errors/not_found", layout: "errors", status: 404
-end
-
-
- -
- -
-
- - project() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 66
-def project
-  id = params[:project_id] || params[:id]
-
-  @project = Project.find_with_namespace(id)
-
-  if @project and can?(current_user, :read_project, @project)
-    @project
-  else
-    @project = nil
-    render_404
-  end
-end
-
-
- -
- -
-
- - reject_blocked!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 35
-def reject_blocked!
-  if current_user && current_user.blocked
-    sign_out current_user
-    flash[:alert] = "Your account is blocked. Retry when an admin unblock it."
-    redirect_to new_user_session_path
-  end
-end
-
-
- -
- -
-
- - render_403() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 115
-def render_403
-  render file: Rails.root.join("public", "403"), layout: false, status: "403"
-end
-
-
- -
- -
-
- - render_404() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 111
-def render_404
-  render file: Rails.root.join("public", "404"), layout: false, status: "404"
-end
-
-
- -
- -
-
- - require_non_empty_project() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 119
-def require_non_empty_project
-  redirect_to @project if @project.empty_repo?
-end
-
-
- -
- -
-
- - set_current_user_for_observers() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/application_controller.rb, line 53
-def set_current_user_for_observers
-  MergeRequestObserver.current_user = current_user
-  IssueObserver.current_user = current_user
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ApplicationDecorator.html b/doc/code/classes/ApplicationDecorator.html deleted file mode 100644 index 348cf42a0c9..00000000000 --- a/doc/code/classes/ApplicationDecorator.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - ApplicationDecorator - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ApplicationHelper.html b/doc/code/classes/ApplicationHelper.html deleted file mode 100644 index 2c3a82bb7b1..00000000000 --- a/doc/code/classes/ApplicationHelper.html +++ /dev/null @@ -1,890 +0,0 @@ - - - - - ApplicationHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
E
-
- -
- -
G
-
- -
- -
H
-
- -
- -
L
-
- -
- -
P
-
- -
- -
R
-
- -
- -
S
-
- -
- -
U
-
- -
- -
W
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - app_theme() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 130
-def app_theme
-  Gitlab::Theme.css_class_by_id(current_user.try(:theme_id))
-end
-
-
- -
- -
-
- - authbutton(provider, size = 64) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 159
-def authbutton(provider, size = 64)
-  file_name = "#{provider.to_s.split('_').first}_#{size}.png"
-  image_tag("authbuttons/#{file_name}",
-            alt: "Sign in with #{provider.to_s.titleize}")
-end
-
-
- -
- -
-
- - current_action?(*args) - - -
- - -
-

Check if a partcular action is the current one

- -

args - One or more action names to check

- -

Examples

- -
# On Projects#new
-current_action?(:new)           # => true
-current_action?(:create)        # => false
-current_action?(:new, :create)  # => true
-
-
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 30
-def current_action?(*args)
-  args.any? { |v| v.to_s.downcase == action_name }
-end
-
-
- -
- -
-
- - current_controller?(*args) - - -
- - -
-

Check if a particular controller is the current one

- -

args - One or more controller names to check

- -

Examples

- -
# On TreeController
-current_controller?(:tree)           # => true
-current_controller?(:commits)        # => false
-current_controller?(:commits, :tree) # => true
-
-
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 16
-def current_controller?(*args)
-  args.any? { |v| v.to_s.downcase == controller.controller_name }
-end
-
-
- -
- -
-
- - emoji_autocomplete_source() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 120
-def emoji_autocomplete_source
-  # should be an array of strings
-  # so to_s can be called, because it is sufficient and to_json is too slow
-  Emoji.names.to_s
-end
-
-
- -
- -
-
- - gravatar_icon(user_email = '', size = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 34
-def gravatar_icon(user_email = '', size = nil)
-  size = 40 if size.nil? || size <= 0
-
-  if !Gitlab.config.gravatar.enabled || user_email.blank?
-    'no_avatar.png'
-  else
-    gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
-    user_email.strip!
-    sprintf(gravatar_url, {:hash => Digest::MD5.hexdigest(user_email.downcase), :email => URI.escape(user_email), :size => size})
-  end
-end
-
-
- -
- -
-
- - grouped_options_refs(destination = :tree) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 64
-def grouped_options_refs(destination = :tree)
-  options = [
-    ["Branch", @project.branch_names ],
-    [ "Tag", @project.tag_names ]
-  ]
-
-  # If reference is commit id -
-  # we should add it to branch/tag selectbox
-  if(@ref && !options.flatten.include?(@ref) &&
-     @ref =~ %r^[0-9a-zA-Z]{6,52}$/)
-    options << ["Commit", [@ref]]
-  end
-
-  grouped_options_for_select(options, @ref || @project.default_branch)
-end
-
-
- -
- -
-
- - hexdigest(string) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 146
-def hexdigest(string)
-  Digest::SHA1.hexdigest string
-end
-
-
- -
- -
-
- - last_commit(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 54
-def last_commit(project)
-  if project.repo_exists?
-    time_ago_in_words(project.commit.committed_date) + " ago"
-  else
-    "Never"
-  end
-rescue
-  "Never"
-end
-
-
- -
- -
-
- - ldap_enable?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 126
-def ldap_enable?
-  Devise.omniauth_providers.include?(:ldap)
-end
-
-
- -
- -
-
- - project_last_activity(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 150
-def project_last_activity project
-  activity = project.last_activity
-  if activity && activity.created_at
-    time_ago_in_words(activity.created_at) + " ago"
-  else
-    "Never"
-  end
-end
-
-
- -
- -
-
- - request_protocol() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 46
-def request_protocol
-  request.ssl? ? "https" : "http"
-end
-
-
- -
- -
-
- - search_autocomplete_source() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 80
-def search_autocomplete_source
-  projects = current_user.authorized_projects.map { |p| { label: p.name_with_namespace, url: project_path(p) } }
-  groups = current_user.authorized_groups.map { |group| { label: "<group> #{group.name}", url: group_path(group) } }
-
-  default_nav = [
-    { label: "My Profile", url: profile_path },
-    { label: "My SSH Keys", url: keys_path },
-    { label: "My Dashboard", url: root_path },
-    { label: "Admin Section", url: admin_root_path },
-  ]
-
-  help_nav = [
-    { label: "Workflow Help", url: help_workflow_path },
-    { label: "Permissions Help", url: help_permissions_path },
-    { label: "Web Hooks Help", url: help_web_hooks_path },
-    { label: "System Hooks Help", url: help_system_hooks_path },
-    { label: "API Help", url: help_api_path },
-    { label: "Markdown Help", url: help_markdown_path },
-    { label: "SSH Keys Help", url: help_ssh_path },
-    { label: "Gitlab Rake Tasks Help", url: help_raketasks_path },
-  ]
-
-  project_nav = []
-  if @project && !@project.new_record?
-    project_nav = [
-      { label: "#{@project.name} Issues",   url: project_issues_path(@project) },
-      { label: "#{@project.name} Commits",  url: project_commits_path(@project, @ref || @project.root_ref) },
-      { label: "#{@project.name} Merge Requests", url: project_merge_requests_path(@project) },
-      { label: "#{@project.name} Milestones", url: project_milestones_path(@project) },
-      { label: "#{@project.name} Snippets", url: project_snippets_path(@project) },
-      { label: "#{@project.name} Team",     url: project_team_index_path(@project) },
-      { label: "#{@project.name} Tree",     url: project_tree_path(@project, @ref || @project.root_ref) },
-      { label: "#{@project.name} Wall",     url: wall_project_path(@project) },
-      { label: "#{@project.name} Wiki",     url: project_wikis_path(@project) },
-    ]
-  end
-
-  [groups, projects, default_nav, project_nav, help_nav].flatten.to_json
-end
-
-
- -
- -
-
- - show_last_push_widget?(event) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 138
-def show_last_push_widget?(event)
-  event &&
-    event.last_push_to_non_root? &&
-    !event.rm_ref? &&
-    event.project &&
-    event.project.merge_requests_enabled
-end
-
-
- -
- -
-
- - user_color_scheme_class() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 134
-def user_color_scheme_class
-  current_user.dark_scheme ? :black : :white
-end
-
-
- -
- -
-
- - web_app_url() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/application_helper.rb, line 50
-def web_app_url
-  "#{request_protocol}://#{Gitlab.config.gitlab.host}/"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/AttachmentUploader.html b/doc/code/classes/AttachmentUploader.html deleted file mode 100644 index 79bc7c989c5..00000000000 --- a/doc/code/classes/AttachmentUploader.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - AttachmentUploader - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - store_dir() - - -
- - -
-

Override the directory where uploaded files will be stored. This is a -sensible default for uploaders that are meant to be mounted:

-
- - - - - - -
- - -
-
# File app/uploaders/attachment_uploader.rb, line 15
-def store_dir
-  "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Authority.html b/doc/code/classes/Authority.html deleted file mode 100644 index fc93f4bea1a..00000000000 --- a/doc/code/classes/Authority.html +++ /dev/null @@ -1,528 +0,0 @@ - - - - - Authority - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
D
-
- -
- -
G
-
- -
- -
M
-
- -
- -
R
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - add_access(user, *access) - - -
- - -
-

Compatible with all access rights Should be rewrited for new access rights

-
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 4
-def add_access(user, *access)
-  access = if access.include?(:admin)
-             { project_access: UsersProject::MASTER }
-           elsif access.include?(:write)
-             { project_access: UsersProject::DEVELOPER }
-           else
-             { project_access: UsersProject::REPORTER }
-           end
-  opts = { user: user }
-  opts.merge!(access)
-  users_projects.create(opts)
-end
-
-
- -
- -
-
- - allow_read_for?(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 39
-def allow_read_for?(user)
-  !users_projects.where(user_id: user.id).empty?
-end
-
-
- -
- -
-
- - dev_access_for?(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 51
-def dev_access_for?(user)
-  !users_projects.where(user_id: user.id, project_access: [UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
-end
-
-
- -
- -
-
- - guest_access_for?(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 43
-def guest_access_for?(user)
-  !users_projects.where(user_id: user.id).empty?
-end
-
-
- -
- -
-
- - master_access_for?(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 55
-def master_access_for?(user)
-  !users_projects.where(user_id: user.id, project_access: [UsersProject::MASTER]).empty?
-end
-
-
- -
- -
-
- - report_access_for?(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 47
-def report_access_for?(user)
-  !users_projects.where(user_id: user.id, project_access: [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
-end
-
-
- -
- -
-
- - repository_masters() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 33
-def repository_masters
-  keys = Key.joins({user: :users_projects}).
-    where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER)
-  keys.map(&:identifier)
-end
-
-
- -
- -
-
- - repository_readers() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 21
-def repository_readers
-  keys = Key.joins({user: :users_projects}).
-    where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER)
-  keys.map(&:identifier) + deploy_keys.map(&:identifier)
-end
-
-
- -
- -
-
- - repository_writers() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 27
-def repository_writers
-  keys = Key.joins({user: :users_projects}).
-    where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER)
-  keys.map(&:identifier)
-end
-
-
- -
- -
-
- - reset_access(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/authority.rb, line 17
-def reset_access(user)
-  users_projects.where(project_id: self.id, user_id: user.id).destroy if self.id
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/BaseContext.html b/doc/code/classes/BaseContext.html deleted file mode 100644 index 3fbc76bf7e0..00000000000 --- a/doc/code/classes/BaseContext.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - BaseContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
-
    - - -
  • - can? -
  • - -
-
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - -
- [RW] - current_user
- [RW] - params
- [RW] - project
- - - - - -
Class Public methods
- -
-
- - new(project, user, params) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/base_context.rb, line 4
-def initialize(project, user, params)
-  @project, @current_user, @params = project, user, params.dup
-end
-
-
- -
- -
Instance Public methods
- -
-
- - abilities() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/base_context.rb, line 8
-def abilities
-  @abilities ||= begin
-                   abilities = Six.new
-                   abilities << Ability
-                   abilities
-                 end
-end
-
-
- -
- -
-
- - can?(object, action, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/base_context.rb, line 16
-def can?(object, action, subject)
-  abilities.allowed?(object, action, subject)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/BlameController.html b/doc/code/classes/BlameController.html deleted file mode 100644 index 2d641cb099b..00000000000 --- a/doc/code/classes/BlameController.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - BlameController - - - - - - - - - - - - - -
-
- -
- -

Controller for viewing a file’s blame

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/blame_controller.rb, line 12
-def show
-  @repo = @project.repo
-  @blame = Grit::Blob.blame(@repo, @commit.id, @path)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/BlobController.html b/doc/code/classes/BlobController.html deleted file mode 100644 index 22df013f475..00000000000 --- a/doc/code/classes/BlobController.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - BlobController - - - - - - - - - - - - - -
-
- -
- -

Controller for viewing a file’s blame

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/blob_controller.rb, line 12
-def show
-  if @tree.is_blob?
-    send_data(
-      @tree.data,
-      type: @tree.mime_type,
-      disposition: 'inline',
-      filename: @tree.name
-    )
-  else
-    not_found!
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Commit.html b/doc/code/classes/Commit.html deleted file mode 100644 index 15369b8981a..00000000000 --- a/doc/code/classes/Commit.html +++ /dev/null @@ -1,1077 +0,0 @@ - - - - - Commit - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
F
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
P
-
- -
- -
S
-
- -
- -
T
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - -
DIFF_SAFE_SIZE=100
 

Safe amount of files with diffs in one commit to render Used to prevent 500 -error on huge commits by suppressing diff

- - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - -
- [RW] - commit
- [RW] - head
- [RW] - refs
- - - - - -
Class Public methods
- -
-
- - commits(repo, ref, path = nil, limit = nil, offset = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 62
-def commits(repo, ref, path = nil, limit = nil, offset = nil)
-  if path
-    repo.log(ref, path, max_count: limit, skip: offset)
-  elsif limit && offset
-    repo.commits(ref, limit, offset)
-  else
-    repo.commits(ref)
-  end.map{ |c| Commit.new(c) }
-end
-
-
- -
- -
-
- - commits_between(repo, from, to) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 72
-def commits_between(repo, from, to)
-  repo.commits_between(from, to).map { |c| Commit.new(c) }
-end
-
-
- -
- -
-
- - commits_since(repo, date) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 50
-def commits_since(repo, date)
-  commits = repo.heads.map do |h|
-    repo.log(h.name, nil, since: date).each { |c| Commit.new(c, h) }
-  end.flatten.uniq { |c| c.id }
-
-  commits.sort! do |x, y|
-    y.committed_date <=> x.committed_date
-  end
-
-  commits
-end
-
-
- -
- -
-
- - commits_with_refs(repo, n = 20) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 40
-def commits_with_refs(repo, n = 20)
-  commits = repo.branches.map { |ref| Commit.new(ref.commit, ref) }
-
-  commits.sort! do |x, y|
-    y.committed_date <=> x.committed_date
-  end
-
-  commits[0..n]
-end
-
-
- -
- -
-
- - compare(project, from, to) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 76
-def compare(project, from, to)
-  result = {
-    commits: [],
-    diffs: [],
-    commit: nil,
-    same: false
-  }
-
-  return result unless from && to
-
-  first = project.commit(to.try(:strip))
-  last = project.commit(from.try(:strip))
-
-  if first && last
-    result[:same] = (first.id == last.id)
-    result[:commits] = project.repo.commits_between(last.id, first.id).map {|c| Commit.new(c)}
-    result[:diffs] = project.repo.diff(last.id, first.id) rescue []
-    result[:commit] = Commit.new(first)
-  end
-
-  result
-end
-
-
- -
- -
-
- - find_or_first(repo, commit_id = nil, root_ref) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 18
-def find_or_first(repo, commit_id = nil, root_ref)
-  commit = if commit_id
-             repo.commit(commit_id)
-           else
-             repo.commits(root_ref).first
-           end
-
-  Commit.new(commit) if commit
-end
-
-
- -
- -
-
- - fresh_commits(repo, n = 10) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 28
-def fresh_commits(repo, n = 10)
-  commits = repo.heads.map do |h|
-    repo.commits(h.name, n).map { |c| Commit.new(c, h) }
-  end.flatten.uniq { |c| c.id }
-
-  commits.sort! do |x, y|
-    y.committed_date <=> x.committed_date
-  end
-
-  commits[0...n]
-end
-
-
- -
- -
-
- - new(raw_commit, head = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 100
-def initialize(raw_commit, head = nil)
-  @commit = raw_commit
-  @head = head
-end
-
-
- -
- -
Instance Public methods
- -
-
- - author_email() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 117
-def author_email
-  author.email
-end
-
-
- -
- -
-
- - author_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 121
-def author_name
-  author.name
-end
-
-
- -
- -
-
- - committer_email() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 134
-def committer_email
-  committer.email
-end
-
-
- -
- -
-
- - committer_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 130
-def committer_name
-  committer.name
-end
-
-
- -
- -
-
- - created_at() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 113
-def created_at
-  committed_date
-end
-
-
- -
- -
-
- - different_committer?() - - -
- - -
-

Was this commit committed by a different person than the original author?

-
- - - - - - -
- - -
-
# File app/models/commit.rb, line 126
-def different_committer?
-  author_name != committer_name || author_email != committer_email
-end
-
-
- -
- -
-
- - parents_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 146
-def parents_count
-  parents && parents.count || 0
-end
-
-
- -
- -
-
- - prev_commit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 138
-def prev_commit
-  parents.try :first
-end
-
-
- -
- -
-
- - prev_commit_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 142
-def prev_commit_id
-  prev_commit.try :id
-end
-
-
- -
- -
-
- - safe_message() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 109
-def safe_message
-  @safe_message ||= message
-end
-
-
- -
- -
-
- - short_id(length = 10) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/commit.rb, line 105
-def short_id(length = 10)
-  id.to_s[0..length]
-end
-
-
- -
- -
-
- - to_diff() - - -
- - -
-

Shows the diff between the commit’s parent and the commit.

- -

Cuts out the header and stats from to_patch and returns only the diff.

-
- - - - - - -
- - -
-
# File app/models/commit.rb, line 153
-def to_diff
-  # see Grit::Commit#show
-  patch = to_patch
-
-  # discard lines before the diff
-  lines = patch.split("\n")
-  while !lines.first.start_with?("diff --git") do
-    lines.shift
-  end
-  lines.pop if lines.last =~ %r^[\d.]+$/ # Git version
-  lines.pop if lines.last == "-- "      # end of diff
-  lines.join("\n")
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/CommitController.html b/doc/code/classes/CommitController.html deleted file mode 100644 index 5f0bbe9e9f3..00000000000 --- a/doc/code/classes/CommitController.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - CommitController - - - - - - - - - - - - - -
-
- -
- -

Controller for a specific Commit

- -

Not to be confused with CommitsController, plural.

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/commit_controller.rb, line 10
-def show
-  result = CommitLoadContext.new(project, current_user, params).execute
-
-  @commit = result[:commit]
-  git_not_found! unless @commit
-
-  @suppress_diff    = result[:suppress_diff]
-  @note             = result[:note]
-  @line_notes       = result[:line_notes]
-  @notes_count      = result[:notes_count]
-  @comments_allowed = true
-
-  respond_to do |format|
-    format.html do
-      if result[:status] == :huge_commit
-        render "huge_commit" and return
-      end
-    end
-
-    format.diff  { render text: @commit.to_diff }
-    format.patch { render text: @commit.to_patch }
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/CommitDecorator.html b/doc/code/classes/CommitDecorator.html deleted file mode 100644 index 9063057850c..00000000000 --- a/doc/code/classes/CommitDecorator.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - - CommitDecorator - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
L
-
- -
- -
N
-
- -
- -
P
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
- - - -
-

Returns a link to the commit author. If the author has a matching user and -is a member of the current @project it will link to the team member page. -Otherwise it will link to the author email as specified in the commit.

- -

options:

- -
avatar: true will prepend the avatar image
-size:   size of the avatar image in px
-
- - - - - - -
- - - -
- -
- -
- - - -
-

Just like author_link but for -the committer.

-
- - - - - - -
- - - -
- -
- -
-
- - description() - - -
- - -
-

Returns the commits description

- -

cut off, ellipses (`&hellp;`) are prepended to the commit message.

-
- - - - - - -
- - -
-
# File app/decorators/commit_decorator.rb, line 34
-def description
-  description = safe_message
-
-  title_end = description.index(%r\n/)
-  if (!title_end && description.length > 80) || (title_end && title_end > 80)
-    "&hellip;".html_safe << description[70..-1]
-  else
-    description.split(%r\n/, 2)[1].try(:chomp)
-  end
-end
-
-
- -
- -
- - - -
-

Returns a string describing the commit for use in a link title

- -

Example

- -
"Commit: Alex Denisov - Project git clone panel"
-
- - - - - - -
- - - -
- -
- -
-
- - title() - - -
- - -
-

Returns the commits title.

- -

Usually, the commit title is the first line of the commit message. In case -this first line is longer than 80 characters, it is cut off after 70 -characters and ellipses (`&hellp;`) are appended.

-
- - - - - - -
- - -
-
# File app/decorators/commit_decorator.rb, line 18
-def title
-  title = safe_message
-
-  return no_commit_message if title.blank?
-
-  title_end = title.index(%r\n/)
-  if (!title_end && title.length > 80) || (title_end && title_end > 80)
-    title[0..69] << "&hellip;".html_safe
-  else
-    title.split(%r\n/, 2).first
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - no_commit_message() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/commit_decorator.rb, line 63
-def no_commit_message
-  "--no commit message"
-end
-
-
- -
- -
- - - -
-

Private: Returns a link to a person. If the person has a matching user and -is a member of the current @project it will link to the team member page. -Otherwise it will link to the person email as specified in the commit.

- -

options:

- -
source: one of :author or :committer
-avatar: true will prepend the avatar image
-size:   size of the avatar image in px
-
- - - - - - -
- - - -
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/CommitLoadContext.html b/doc/code/classes/CommitLoadContext.html deleted file mode 100644 index 82c04febe6b..00000000000 --- a/doc/code/classes/CommitLoadContext.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - CommitLoadContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/commit_load_context.rb, line 2
-def execute
-  result = {
-    commit: nil,
-    suppress_diff: false,
-    line_notes: [],
-    notes_count: 0,
-    note: nil,
-    status: :ok
-  }
-
-  commit = project.commit(params[:id])
-
-  if commit
-    commit = CommitDecorator.decorate(commit)
-    line_notes = project.commit_line_notes(commit)
-
-    result[:commit] = commit
-    result[:note] = project.build_commit_note(commit)
-    result[:line_notes] = line_notes
-    result[:notes_count] = line_notes.count + project.commit_notes(commit).count
-
-    begin
-      result[:suppress_diff] = true if commit.diffs.size > Commit::DIFF_SAFE_SIZE && !params[:force_show_diff]
-    rescue Grit::Git::GitTimeout
-      result[:suppress_diff] = true
-      result[:status] = :huge_commit
-    end
-  end
-
-  result
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/CommitsController.html b/doc/code/classes/CommitsController.html deleted file mode 100644 index 53d329673f8..00000000000 --- a/doc/code/classes/CommitsController.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - CommitsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/commits_controller.rb, line 11
-def show
-  @repo = @project.repo
-  @limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
-
-  @commits = @project.commits(@ref, @path, @limit, @offset)
-  @commits = CommitDecorator.decorate(@commits)
-
-  respond_to do |format|
-    format.html # index.html.erb
-    format.js
-    format.atom { render layout: false }
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/CommitsHelper.html b/doc/code/classes/CommitsHelper.html deleted file mode 100644 index 4e4addfb8ac..00000000000 --- a/doc/code/classes/CommitsHelper.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - CommitsHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
C
-
- -
- -
D
-
- -
- -
E
-
- -
- -
I
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - build_line_anchor(index, line_new, line_old) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/commits_helper.rb, line 12
-def build_line_anchor(index, line_new, line_old)
-  "#{index}_#{line_old}_#{line_new}"
-end
-
-
- -
- -
-
- - commit_to_html(commit) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/commits_helper.rb, line 68
-def commit_to_html commit
-  if commit.model
-    escape_javascript(render 'commits/commit', commit: commit)
-  end
-end
-
-
- -
- -
-
- - diff_line_content(line) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/commits_helper.rb, line 74
-def diff_line_content(line)
-  if line.blank?
-    " &nbsp;"
-  else
-    line
-  end
-end
-
-
- -
- -
-
- - each_diff_line(diff_arr, index) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/commits_helper.rb, line 16
-def each_diff_line(diff_arr, index)
-  line_old = 1
-  line_new = 1
-  type = nil
-
-  lines_arr = ::Gitlab::InlineDiff.processing diff_arr
-  lines_arr.each do |line|
-    next if line.match(%r^\-\-\- \/dev\/null/)
-    next if line.match(%r^\+\+\+ \/dev\/null/)
-    next if line.match(%r^\-\-\- a/)
-    next if line.match(%r^\+\+\+ b/)
-
-    full_line = html_escape(line.gsub(%r\n/, ''))
-    full_line = ::Gitlab::InlineDiff.replace_markers full_line
-
-    if line.match(%r^@@ -/)
-      type = "match"
-
-      line_old = line.match(%r\-[0-9]*/)[0].to_i.abs rescue 0
-      line_new = line.match(%r\+[0-9]*/)[0].to_i.abs rescue 0
-
-      next if line_old == 1 && line_new == 1 #top of file
-      yield(full_line, type, nil, nil, nil)
-      next
-    else
-      type = identification_type(line)
-      line_code = build_line_anchor(index, line_new, line_old)
-      yield(full_line, type, line_code, line_new, line_old)
-    end
-
-
-    if line[0] == "+"
-      line_new += 1
-    elsif line[0] == "-"
-      line_old += 1
-    else
-      line_new += 1
-      line_old += 1
-    end
-  end
-end
-
-
- -
- -
-
- - identification_type(line) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/commits_helper.rb, line 2
-def identification_type(line)
-  if line[0] == "+"
-    "new"
-  elsif line[0] == "-"
-    "old"
-  else
-    nil
-  end
-end
-
-
- -
- -
-
- - image_diff_class(diff) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/commits_helper.rb, line 58
-def image_diff_class(diff)
-  if diff.deleted_file
-    "diff_removed"
-  elsif diff.new_file
-    "diff_added"
-  else
-    nil
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/CompareController.html b/doc/code/classes/CompareController.html deleted file mode 100644 index 3db60f969f4..00000000000 --- a/doc/code/classes/CompareController.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - CompareController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
I
-
- -
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/compare_controller.rb, line 22
-def create
-  redirect_to project_compare_path(@project, params[:from], params[:to])
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/compare_controller.rb, line 7
-def index
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/compare_controller.rb, line 10
-def show
-  result = Commit.compare(project, params[:from], params[:to])
-
-  @commits       = result[:commits]
-  @commit        = result[:commit]
-  @diffs         = result[:diffs]
-  @refs_are_same = result[:same]
-  @line_notes    = []
-
-  @commits = CommitDecorator.decorate(@commits)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/DashboardController.html b/doc/code/classes/DashboardController.html deleted file mode 100644 index ae8b126da1c..00000000000 --- a/doc/code/classes/DashboardController.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - - DashboardController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
E
-
- -
- -
I
-
- -
- -
M
-
- -
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/dashboard_controller.rb, line 7
-def index
-  @groups = current_user.authorized_groups
-
-  @has_authorized_projects = @projects.count > 0
-
-  @projects = case params[:scope]
-              when 'personal' then
-                @projects.personal(current_user)
-              when 'joined' then
-                @projects.joined(current_user)
-              else
-                @projects
-              end
-
-  @projects = @projects.page(params[:page]).per(30)
-
-  @events = Event.in_projects(current_user.project_ids)
-  @events = @event_filter.apply_filter(@events)
-  @events = @events.limit(20).offset(params[:offset] || 0)
-
-  @last_push = current_user.recent_push
-
-  respond_to do |format|
-    format.html
-    format.js
-    format.atom { render layout: false }
-  end
-end
-
-
- -
- -
-
- - issues() - - -
- - -
-

Get only assigned issues

-
- - - - - - -
- - -
-
# File app/controllers/dashboard_controller.rb, line 44
-def issues
-  @issues = current_user.assigned_issues
-  @issues = dashboard_filter(@issues)
-  @issues = @issues.recent.page(params[:page]).per(20)
-  @issues = @issues.includes(:author, :project)
-
-  respond_to do |format|
-    format.html
-    format.atom { render layout: false }
-  end
-end
-
-
- -
- -
-
- - merge_requests() - - -
- - -
-

Get authored or assigned open merge requests

-
- - - - - - -
- - -
-
# File app/controllers/dashboard_controller.rb, line 37
-def merge_requests
-  @merge_requests = current_user.cared_merge_requests
-  @merge_requests = dashboard_filter(@merge_requests)
-  @merge_requests = @merge_requests.recent.page(params[:page]).per(20)
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - dashboard_filter(items) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/dashboard_controller.rb, line 66
-def dashboard_filter items
-  if params[:project_id]
-    items = items.where(project_id: params[:project_id])
-  end
-
-  if params[:search].present?
-    items = items.search(params[:search])
-  end
-
-  case params[:status]
-  when 'closed'
-    items.closed
-  when 'all'
-    items
-  else
-    items.opened
-  end
-end
-
-
- -
- -
-
- - event_filter() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/dashboard_controller.rb, line 62
-def event_filter
-  @event_filter ||= EventFilter.new(params[:event_filter])
-end
-
-
- -
- -
-
- - projects() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/dashboard_controller.rb, line 58
-def projects
-  @projects = current_user.authorized_projects.sorted_by_activity
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/DashboardHelper.html b/doc/code/classes/DashboardHelper.html deleted file mode 100644 index 6fcb426cf13..00000000000 --- a/doc/code/classes/DashboardHelper.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - DashboardHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - dashboard_filter_path(entity, options={}) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/dashboard_helper.rb, line 2
-def dashboard_filter_path(entity, options={})
-  exist_opts = {
-    status: params[:status],
-    project_id: params[:project_id],
-  }
-
-  options = exist_opts.merge(options)
-
-  case entity
-  when 'issue' then
-    dashboard_issues_path(options)
-  when 'merge_request'
-    dashboard_merge_requests_path(options)
-  end
-end
-
-
- -
- -
-
- - entities_per_project(project, entity) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/dashboard_helper.rb, line 18
-def entities_per_project project, entity
-  items = project.items_for(entity)
-
-  items = case params[:status]
-          when 'closed'
-            items.closed
-          when 'all'
-            items
-          else
-            items.opened
-          end
-
-  items.where(assignee_id: current_user.id).count
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/DeployKeysController.html b/doc/code/classes/DeployKeysController.html deleted file mode 100644 index 952d295cded..00000000000 --- a/doc/code/classes/DeployKeysController.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - DeployKeysController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/deploy_keys_controller.rb, line 21
-def create
-  @key = @project.deploy_keys.new(params[:key])
-  if @key.save
-    redirect_to project_deploy_keys_path(@project)
-  else
-    render "new"
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/deploy_keys_controller.rb, line 30
-def destroy
-  @key = @project.deploy_keys.find(params[:id])
-  @key.destroy
-
-  respond_to do |format|
-    format.html { redirect_to project_deploy_keys_url }
-    format.js { render nothing: true }
-  end
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/deploy_keys_controller.rb, line 7
-def index
-  @keys = @project.deploy_keys.all
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/deploy_keys_controller.rb, line 15
-def new
-  @key = @project.deploy_keys.new
-
-  respond_with(@key)
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/deploy_keys_controller.rb, line 11
-def show
-  @key = @project.deploy_keys.find(params[:id])
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ErrorsController.html b/doc/code/classes/ErrorsController.html deleted file mode 100644 index b03cc04c9bd..00000000000 --- a/doc/code/classes/ErrorsController.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - ErrorsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
G
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - githost() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/errors_controller.rb, line 2
-def githost
-  render "errors/gitolite"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Event.html b/doc/code/classes/Event.html deleted file mode 100644 index 608db59979c..00000000000 --- a/doc/code/classes/Event.html +++ /dev/null @@ -1,1266 +0,0 @@ - - - - - Event - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: events

- -
id          :integer          not null, primary key
-target_type :string(255)
-target_id   :integer
-title       :string(255)
-data        :text
-project_id  :integer
-created_at  :datetime         not null
-updated_at  :datetime         not null
-action      :integer
-author_id   :integer
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
J
-
- -
- -
L
-
- -
- -
M
-
- -
- -
N
-
- -
- -
P
-
- -
- -
R
-
- -
- -
T
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Created=1
 
Updated=2
 
Closed=3
 
Reopened=4
 
Pushed=5
 
Commented=6
 
Merged=7
 
Joined=8
 
Left=9
 
- - - - - - - - -
Class Public methods
- -
-
- - determine_action(record) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 53
-def determine_action(record)
-  if [Issue, MergeRequest].include? record.class
-    Event::Created
-  elsif record.kind_of? Note
-    Event::Commented
-  end
-end
-
-
- -
- -
Instance Public methods
- -
-
- - action_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 160
-def action_name
-  if closed?
-    "closed"
-  elsif merged?
-    "merged"
-  elsif joined?
-    'joined'
-  elsif left?
-    'left'
-  else
-    "opened"
-  end
-end
-
-
- -
- -
-
- - author() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 156
-def author
-  @author ||= User.find(author_id)
-end
-
-
- -
- -
-
- - changed_issue?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 131
-def changed_issue?
-  target_type == "Issue" &&
-    [Closed, Reopened].include?(action)
-end
-
-
- -
- -
-
- - changed_merge_request?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 126
-def changed_merge_request?
-  target_type == "MergeRequest" &&
-    [Closed, Reopened].include?(action)
-end
-
-
- -
- -
-
- - closed?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 92
-def closed?
-  action == self.class::Closed
-end
-
-
- -
- -
-
- - issue() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 148
-def issue
-  target if target_type == "Issue"
-end
-
-
- -
- -
-
- - issue?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 108
-def issue?
-  target_type == "Issue"
-end
-
-
- -
- -
-
- - joined?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 136
-def joined?
-  action == Joined
-end
-
-
- -
- -
-
- - left?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 140
-def left?
-  action == Left
-end
-
-
- -
- -
-
- - membership_changed?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 144
-def membership_changed?
-  joined? || left?
-end
-
-
- -
- -
-
- - merge_request() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 152
-def merge_request
-  target if target_type == "MergeRequest"
-end
-
-
- -
- -
-
- - merge_request?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 112
-def merge_request?
-  target_type == "MergeRequest"
-end
-
-
- -
- -
-
- - merged?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 88
-def merged?
-  action == self.class::Merged
-end
-
-
- -
- -
-
- - milestone?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 100
-def milestone?
-  target_type == "Milestone"
-end
-
-
- -
- -
-
- - new_issue?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 116
-def new_issue?
-  target_type == "Issue" &&
-    action == Created
-end
-
-
- -
- -
-
- - new_merge_request?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 121
-def new_merge_request?
-  target_type == "MergeRequest" &&
-    action == Created
-end
-
-
- -
- -
-
- - note?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 104
-def note?
-  target_type == "Note"
-end
-
-
- -
- -
-
- - project_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 72
-def project_name
-  if project
-    project.name
-  else
-    "(deleted project)"
-  end
-end
-
-
- -
- -
-
- - proper?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 62
-def proper?
-  if push?
-    true
-  elsif membership_changed?
-    true
-  else
-    (issue? || merge_request? || note? || milestone?) && target
-  end
-end
-
-
- -
- -
-
- - push?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 84
-def push?
-  action == self.class::Pushed && valid_push?
-end
-
-
- -
- -
-
- - reopened?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 96
-def reopened?
-  action == self.class::Reopened
-end
-
-
- -
- -
-
- - target_title() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/event.rb, line 80
-def target_title
-  target.try :title
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/EventDecorator.html b/doc/code/classes/EventDecorator.html deleted file mode 100644 index 1fdf7f5c4e4..00000000000 --- a/doc/code/classes/EventDecorator.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - EventDecorator - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
F
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - feed_summary() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/event_decorator.rb, line 37
-def feed_summary
-  if self.issue?
-    h.render "events/event_issue", issue: self.issue
-  elsif self.push?
-    h.render "events/event_push", event: self
-  end
-end
-
-
- -
- -
-
- - feed_title() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/event_decorator.rb, line 4
-def feed_title
-  if self.issue?
-    "#{self.author_name} #{self.action_name} issue ##{self.target_id}: #{self.issue_title} at #{self.project.name}"
-  elsif self.merge_request?
-    "#{self.author_name} #{self.action_name} MR ##{self.target_id}: #{self.merge_request_title} at #{self.project.name}"
-  elsif self.push?
-    "#{self.author_name} #{self.push_action_name} #{self.ref_type} #{self.ref_name} at #{self.project.name}"
-  elsif self.membership_changed?
-    "#{self.author_name} #{self.action_name} #{self.project.name}"
-  else
-    ""
-  end
-end
-
-
- -
- -
-
- - feed_url() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/event_decorator.rb, line 18
-def feed_url
-  if self.issue?
-    h.project_issue_url(self.project, self.issue)
-  elsif self.merge_request?
-    h.project_merge_request_url(self.project, self.merge_request)
-
-  elsif self.push?
-    if self.push_with_commits?
-      if self.commits_count > 1
-        h.project_compare_url(self.project, :from => self.parent_commit.id, :to => self.last_commit.id)
-      else
-        h.project_commit_url(self.project, :id => self.last_commit.id)
-      end
-    else
-      h.project_commits_url(self.project, self.ref_name)
-    end
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/EventFilter.html b/doc/code/classes/EventFilter.html deleted file mode 100644 index 5bf01133d6e..00000000000 --- a/doc/code/classes/EventFilter.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - EventFilter - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
O
-
- -
- -
P
-
-
    - - -
  • - push -
  • - -
-
- -
T
-
-
    - - -
  • - team -
  • - -
-
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - -
- [RW] - params
- - - - - -
Class Public methods
- -
-
- - comments() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 17
-def comments
-  'comments'
-end
-
-
- -
- -
-
- - default_filter() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 5
-def default_filter
-  %w{ push issues merge_requests team}
-end
-
-
- -
- -
-
- - merged() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 13
-def merged
-  'merged'
-end
-
-
- -
- -
-
- - new(params) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 26
-def initialize params
-  @params = if params
-              params.dup
-            else
-              []#EventFilter.default_filter
-            end
-end
-
-
- -
- -
-
- - push() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 9
-def push
-  'push'
-end
-
-
- -
- -
-
- - team() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 21
-def team
-  'team'
-end
-
-
- -
- -
Instance Public methods
- -
-
- - active?(key) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 65
-def active? key
-  params.include? key
-end
-
-
- -
- -
-
- - apply_filter(events) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 34
-def apply_filter events
-  return events unless params.present?
-
-  filter = params.dup
-
-  actions = []
-  actions << Event::Pushed if filter.include? 'push'
-  actions << Event::Merged if filter.include? 'merged'
-
-  if filter.include? 'team'
-    actions << Event::Joined
-    actions << Event::Left
-  end
-
-  actions << Event::Commented if filter.include? 'comments'
-
-  events = events.where(action: actions)
-end
-
-
- -
- -
-
- - options(key) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/event_filter.rb, line 53
-def options key
-  filter = params.dup
-
-  if filter.include? key
-    filter.delete key
-  else
-    filter << key
-  end
-
-  filter
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/EventsHelper.html b/doc/code/classes/EventsHelper.html deleted file mode 100644 index 7c7041c6698..00000000000 --- a/doc/code/classes/EventsHelper.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - EventsHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
L
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - event_action_name(event) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/events_helper.rb, line 13
-def event_action_name(event)
-  target = if event.target_type
-             event.target_type.titleize.downcase
-           else
-             'project'
-           end
-
-  [event.action_name, target].join(" ")
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - - -
- -
- -
-
- - event_image(event) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/events_helper.rb, line 23
-def event_image event
-  event_image_path = if event.push?
-                 "event_push.png"
-               elsif event.merged?
-                 "event_mr_merged.png"
-               end
-
-  return nil unless event_image_path
-
-  content_tag :div, class: 'event_icon' do
-    image_tag event_image_path
-  end
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - - -
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ExtractsPath.html b/doc/code/classes/ExtractsPath.html deleted file mode 100644 index 0b8c0c26f99..00000000000 --- a/doc/code/classes/ExtractsPath.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - ExtractsPath - - - - - - - - - - - - - -
-
- -
- -

Module providing methods for dealing with separating a tree-ish string and -a file path string when combined in a request parameter

- -
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
A
-
- -
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - assign_ref_vars() - - -
- - -
-

Assigns common instance variables for views working with Git tree-ish -objects

- -

Assignments are:

-
  • -

    @id - A string representing the joined ref and path

    -
  • -

    @ref - A string representing the ref (e.g., the branch, tag, or commit -SHA)

    -
  • -

    @path - A string representing the filesystem path

    -
  • -

    @commit - A CommitDecorator representing -the commit from the given ref

    -
  • -

    @tree - A TreeDecorator representing the -tree at the given ref/path

    -
- -

If the :id parameter appears to be requesting a specific response format, -that will be handled as well.

- -

Automatically renders `not_found!` if a valid tree path could not be -resolved (e.g., when a user inserts an invalid path or ref).

-
- - - - - - -
- - -
-
# File lib/extracts_path.rb, line 104
-def assign_ref_vars
-  # Handle formats embedded in the id
-  if params[:id].ends_with?('.atom')
-    params[:id].gsub!(%r\.atom$/, '')
-    request.format = :atom
-  end
-
-  @ref, @path = extract_ref(request.fullpath)
-
-  @id = File.join(@ref, @path)
-
-  @commit = CommitDecorator.decorate(@project.commit(@ref))
-
-  @tree = Tree.new(@commit.tree, @project, @ref, @path)
-  @tree = TreeDecorator.new(@tree)
-
-  raise InvalidPathError if @tree.invalid?
-rescue NoMethodError, InvalidPathError
-  not_found!
-end
-
-
- -
- -
-
- - extract_ref(input) - - -
- - -
-

Given a string containing both a Git tree-ish, such as a branch or tag, and -a filesystem path joined by forward slashes, attempts to separate the two.

- -

Expects a @project instance variable to contain the active project. This is -used to check the input against a list of valid repository refs.

- -

Examples

- -
# No @project available
-extract_ref('master')
-# => ['', '']
-
-extract_ref('master')
-# => ['master', '']
-
-extract_ref("f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG")
-# => ['f4b14494ef6abf3d144c28e4af0c20143383e062', 'CHANGELOG']
-
-extract_ref("v2.0.0/README.md")
-# => ['v2.0.0', 'README.md']
-
-extract_ref('/gitlab/vagrant/tree/master/app/models/project.rb')
-# => ['master', 'app/models/project.rb']
-
-extract_ref('issues/1234/app/models/project.rb')
-# => ['issues/1234', 'app/models/project.rb']
-
-# Given an invalid branch, we fall back to just splitting on the first slash
-extract_ref('non/existent/branch/README.md')
-# => ['non', 'existent/branch/README.md']
-
- -

Returns an Array where the first value is the tree-ish and the second is -the path

-
- - - - - - -
- - -
-
# File lib/extracts_path.rb, line 48
-def extract_ref(input)
-  pair = ['', '']
-
-  return pair unless @project
-
-  # Remove project, actions and all other staff from path
-  input.gsub!("/#{@project.path_with_namespace}", "")
-  input.gsub!(%r^\/(tree|commits|blame|blob)\//, "") # remove actions
-  input.gsub!(%r\?.*$/, "") # remove stamps suffix
-  input.gsub!(%r.atom$/, "") # remove rss feed
-  input.gsub!(%r\/edit$/, "") # remove edit route part
-
-  if input.match(%r^([[:alnum:]]{40})(.+)/)
-    # If the ref appears to be a SHA, we're done, just split the string
-    pair = $~.captures
-  else
-    # Otherwise, attempt to detect the ref using a list of the project's
-    # branches and tags
-
-    # Append a trailing slash if we only get a ref and no file path
-    id = input
-    id += '/' unless id.ends_with?('/')
-
-    valid_refs = @project.ref_names
-    valid_refs.select! { |v| id.start_with?("#{v}/") }
-
-    if valid_refs.length != 1
-      # No exact ref match, so just try our best
-      pair = id.match(%r([^\/]+)(.*)/).captures
-    else
-      # Partition the string into the ref and the path, ignoring the empty first value
-      pair = id.partition(valid_refs.first)[1..-1]
-    end
-  end
-
-  # Remove ending slashes from path
-  pair[1].gsub!(%r^\/|\/$/, '')
-
-  pair
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ExtractsPath/InvalidPathError.html b/doc/code/classes/ExtractsPath/InvalidPathError.html deleted file mode 100644 index 67632e3b9ea..00000000000 --- a/doc/code/classes/ExtractsPath/InvalidPathError.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - ExtractsPath::InvalidPathError - - - - - - - - - - - - - -
-
- -
- -

Raised when given an invalid file path

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/FileSizeValidator.html b/doc/code/classes/FileSizeValidator.html deleted file mode 100644 index b1da2752f52..00000000000 --- a/doc/code/classes/FileSizeValidator.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - - FileSizeValidator - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
C
-
- -
- -
H
-
-
    - - -
  • - help -
  • - -
-
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
V
-
- -
- -
- - - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MESSAGES={ is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
 
CHECKS={ is: :==, minimum: :>=, maximum: :<= }.freeze
 
DEFAULT_TOKENIZER=lambda { |value| value.split(//) }
 
RESERVED_OPTIONS=[:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]
 
- - - - - - - - -
Class Public methods
- -
-
- - new(options) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/file_size_validator.rb, line 8
-def initialize(options)
-  if range = (options.delete(:in) || options.delete(:within))
-    raise ArgumentError, ":in and :within must be a Range" unless range.is_a?(Range)
-    options[:minimum], options[:maximum] = range.begin, range.end
-    options[:maximum] -= 1 if range.exclude_end?
-  end
-
-  super
-end
-
-
- -
- -
Instance Public methods
- -
-
- - check_validity!() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/file_size_validator.rb, line 18
-def check_validity!
-  keys = CHECKS.keys & options.keys
-
-  if keys.empty?
-    raise ArgumentError, 'Range unspecified. Specify the :within, :maximum, :minimum, or :is option.'
-  end
-
-  keys.each do |key|
-    value = options[key]
-
-    unless value.is_a?(Integer) && value >= 0
-      raise ArgumentError, ":#{key} must be a nonnegative Integer"
-    end
-  end
-end
-
-
- -
- -
-
- - help() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/file_size_validator.rb, line 57
-def help
-  Helper.instance
-end
-
-
- -
- -
-
- - validate_each(record, attribute, value) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/file_size_validator.rb, line 34
-def validate_each(record, attribute, value)
-  raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
-
-  value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
-
-  CHECKS.each do |key, validity_check|
-    next unless check_value = options[key]
-
-    value ||= [] if key == :maximum
-
-    value_size = value.size
-    next if value_size.send(validity_check, check_value)
-
-    errors_options = options.except(*RESERVED_OPTIONS)
-    errors_options[:file_size] = help.number_to_human_size check_value
-
-    default_message = options[MESSAGES[key]]
-    errors_options[:message] ||= default_message if default_message
-
-    record.errors.add(attribute, MESSAGES[key], errors_options)
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/FileSizeValidator/Helper.html b/doc/code/classes/FileSizeValidator/Helper.html deleted file mode 100644 index c11d89b3f2c..00000000000 --- a/doc/code/classes/FileSizeValidator/Helper.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - FileSizeValidator::Helper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - -
Included Modules
-
    - -
  • - - Singleton - -
  • - -
  • - - ActionView::Helpers::NumberHelper - -
  • - -
- - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/GitHost.html b/doc/code/classes/GitHost.html deleted file mode 100644 index 52ea8b32d4f..00000000000 --- a/doc/code/classes/GitHost.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - GitHost - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
G
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - git_host() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/git_host.rb, line 2
-def git_host
-  Gitlab::Gitolite.new
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Gitlab.html b/doc/code/classes/Gitlab.html deleted file mode 100644 index 5127be6e4db..00000000000 --- a/doc/code/classes/Gitlab.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - Gitlab - - - - - - - - - - - - - -
-
- -
- -

ProjectMover class

- -

Used for moving project repositories from one subdir to another

- -
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file 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 diff --git a/doc/code/classes/GitlabCiService.html b/doc/code/classes/GitlabCiService.html deleted file mode 100644 index a56f614f772..00000000000 --- a/doc/code/classes/GitlabCiService.html +++ /dev/null @@ -1,371 +0,0 @@ - - - - - GitlabCiService - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: services

- -
id          :integer          not null, primary key
-type        :string(255)
-title       :string(255)
-token       :string(255)
-project_id  :integer          not null
-created_at  :datetime         not null
-updated_at  :datetime         not null
-active      :boolean          default(FALSE), not null
-project_url :string(255)
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - activated?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/gitlab_ci_service.rb, line 26
-def activated?
-  active
-end
-
-
- -
- -
-
- - build_page(sha) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/gitlab_ci_service.rb, line 54
-def build_page sha
-  project_url + "/builds/#{sha}"
-end
-
-
- -
- -
-
- - commit_badge_path(sha) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/gitlab_ci_service.rb, line 36
-def commit_badge_path sha
-  project_url + "/status?sha=#{sha}"
-end
-
-
- -
- -
-
- - commit_status(sha) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/gitlab_ci_service.rb, line 44
-def commit_status sha
-  response = HTTParty.get(commit_status_path(sha))
-
-  if response.code == 200 and response["status"]
-    response["status"]
-  else
-    :error
-  end
-end
-
-
- -
- -
-
- - commit_status_path(sha) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/gitlab_ci_service.rb, line 40
-def commit_status_path sha
-  project_url + "/builds/#{sha}/status.json?token=#{token}"
-end
-
-
- -
- -
-
- - compose_service_hook() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/gitlab_ci_service.rb, line 30
-def compose_service_hook
-  hook = service_hook || build_service_hook
-  hook.url = [project_url, "/build", "?token=#{token}"].join("")
-  hook.save
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/GitlabMarkdownHelper.html b/doc/code/classes/GitlabMarkdownHelper.html deleted file mode 100644 index 32ae5f822b5..00000000000 --- a/doc/code/classes/GitlabMarkdownHelper.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - GitlabMarkdownHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
L
-
- -
- -
M
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
- - - -
-

Use this in places where you would normally use link_to(gfm(…), …).

- -

It solves a problem occurring with nested links (i.e. “<a>outer text -<a>gfm ref</a> more outer text</a>”). This will not be -interpreted as intended. Browsers will parse something like “<a>outer -text </a><a>gfm ref</a> more outer text” (notice the last -part is not linked any more). #link_to_gfm -corrects that. It wraps all parts to explicitly produce the correct linking -behavior (i.e. “<a>outer text </a><a>gfm -ref</a><a> more outer text</a>”).

-
- - - - - - -
- - - -
- -
- -
-
- - markdown(text) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/gitlab_markdown_helper.rb, line 25
-def markdown(text)
-  unless @markdown
-    gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
-                        # see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
-                        filter_html: true,
-                        with_toc_data: true,
-                        hard_wrap: true)
-    @markdown = Redcarpet::Markdown.new(gitlab_renderer,
-                    # see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
-                    no_intra_emphasis: true,
-                    tables: true,
-                    fenced_code_blocks: true,
-                    autolink: true,
-                    strikethrough: true,
-                    lax_html_blocks: true,
-                    space_after_headers: true,
-                    superscript: true)
-  end
-
-  @markdown.render(text).html_safe
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Grack.html b/doc/code/classes/Grack.html deleted file mode 100644 index 9261c356602..00000000000 --- a/doc/code/classes/Grack.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Grack - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Grack/Auth.html b/doc/code/classes/Grack/Auth.html deleted file mode 100644 index a1350e2fa26..00000000000 --- a/doc/code/classes/Grack/Auth.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - - Grack::Auth - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
V
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - -
- [RW] - project
- [RW] - user
- - - - - -
Instance Public methods
- -
-
- - can?(object, action, subject) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/grack_auth.rb, line 56
-def can?(object, action, subject)
-  abilities.allowed?(object, action, subject)
-end
-
-
- -
- -
-
- - current_ref() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/grack_auth.rb, line 60
-def current_ref
-  if @env["HTTP_CONTENT_ENCODING"] =~ %rgzip/
-    input = Zlib::GzipReader.new(@request.body).read
-  else
-    input = @request.body.read
-  end
-  # Need to reset seek point
-  @request.body.rewind
-  %rrefs\/heads\/([\w\.-]+)/.match(input).to_a.first
-end
-
-
- -
- -
-
- - valid?() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/grack_auth.rb, line 5
-def valid?
-  # Authentication with username and password
-  login, password = @auth.credentials
-
-  self.user = User.find_by_email(login) || User.find_by_username(login)
-
-  return false unless user.try(:valid_password?, password)
-
-  email = user.email
-
-  # Set GL_USER env variable
-  ENV['GL_USER'] = email
-  # Pass Gitolite update hook
-  ENV['GL_BYPASS_UPDATE_HOOK'] = "true"
-
-  # Find project by PATH_INFO from env
-  if m = %r^\/([\w\.\/-]+)\.git/.match(@request.path_info).to_a
-    self.project = Project.find_with_namespace(m.last)
-    return false unless project
-  end
-
-  # Git upload and receive
-  if @request.get?
-    validate_get_request
-  elsif @request.post?
-    validate_post_request
-  else
-    false
-  end
-end
-
-
- -
- -
-
- - validate_get_request() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/grack_auth.rb, line 36
-def validate_get_request
-  can?(user, :download_code, project)
-end
-
-
- -
- -
-
- - validate_post_request() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/grack_auth.rb, line 40
-def validate_post_request
-  if @request.path_info.end_with?('git-upload-pack')
-    can?(user, :download_code, project)
-  elsif @request.path_info.end_with?('git-receive-pack')
-    action = if project.protected_branch?(current_ref)
-               :push_code_to_protected_branches
-             else
-               :push_code
-             end
-
-    can?(user, action, project)
-  else
-    false
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - abilities() - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/gitlab/backend/grack_auth.rb, line 73
-def abilities
-  @abilities ||= begin
-                   abilities = Six.new
-                   abilities << Ability
-                   abilities
-                 end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Group.html b/doc/code/classes/Group.html deleted file mode 100644 index cf61c3ea354..00000000000 --- a/doc/code/classes/Group.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Group - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: namespaces

- -
id         :integer          not null, primary key
-name       :string(255)      not null
-path       :string(255)      not null
-owner_id   :integer          not null
-created_at :datetime         not null
-updated_at :datetime         not null
-type       :string(255)
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
H
-
- -
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - add_users_to_project_teams(user_ids, project_access) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/group.rb, line 15
-def add_users_to_project_teams(user_ids, project_access)
-  UsersProject.add_users_into_projects(
-    projects.map(&:id),
-    user_ids,
-    project_access
-  )
-end
-
-
- -
- -
-
- - human_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/group.rb, line 29
-def human_name
-  name
-end
-
-
- -
- -
-
- - truncate_teams() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/group.rb, line 33
-def truncate_teams
-  UsersProject.truncate_teams(project_ids)
-end
-
-
- -
- -
-
- - users() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/group.rb, line 23
-def users
-  users = User.joins(:users_projects).where(users_projects: {project_id: project_ids})
-  users = users << owner
-  users.uniq
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/GroupsController.html b/doc/code/classes/GroupsController.html deleted file mode 100644 index dbca1708bf0..00000000000 --- a/doc/code/classes/GroupsController.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - - GroupsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
G
-
- -
- -
I
-
- -
- -
M
-
- -
- -
P
-
- -
- -
S
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - issues() - - -
- - -
-

Get only assigned issues

-
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 29
-def issues
-  @user   = current_user
-  @issues = current_user.assigned_issues.opened
-  @issues = @issues.of_group(@group).recent.page(params[:page]).per(20)
-  @issues = @issues.includes(:author, :project)
-
-  respond_to do |format|
-    format.html
-    format.atom { render layout: false }
-  end
-end
-
-
- -
- -
-
- - merge_requests() - - -
- - -
-

Get authored or assigned open merge requests

-
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 23
-def merge_requests
-  @merge_requests = current_user.cared_merge_requests.opened
-  @merge_requests = @merge_requests.of_group(@group).recent.page(params[:page]).per(20)
-end
-
-
- -
- -
-
- - people() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 49
-def people
-  @project = group.projects.find(params[:project_id]) if params[:project_id]
-  @users = @project ? @project.users : group.users
-  @users.sort_by!(&:name)
-
-  if @project
-    @team_member = @project.users_projects.new
-  else
-    @team_member = UsersProject.new
-  end
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 41
-def search
-  result = SearchContext.new(project_ids, params).execute
-
-  @projects       = result[:projects]
-  @merge_requests = result[:merge_requests]
-  @issues         = result[:issues]
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 11
-def show
-  @events = Event.in_projects(project_ids).limit(20).offset(params[:offset] || 0)
-  @last_push = current_user.recent_push
-
-  respond_to do |format|
-    format.html
-    format.js
-    format.atom { render layout: false }
-  end
-end
-
-
- -
- -
-
- - team_members() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 61
-def team_members
-  @group.add_users_to_project_teams(params[:user_ids], params[:project_access])
-  redirect_to people_group_path(@group), notice: 'Users was successfully added.'
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - authorize_read_group!() - - -
- - -
-

Dont allow unauthorized access to group

-
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 81
-def authorize_read_group!
-  unless projects.present? or can?(current_user, :manage_group, @group)
-    return render_404
-  end
-end
-
-
- -
- -
-
- - group() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 68
-def group
-  @group ||= Group.find_by_path(params[:id])
-end
-
-
- -
- -
-
- - project_ids() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 76
-def project_ids
-  projects.map(&:id)
-end
-
-
- -
- -
-
- - projects() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/groups_controller.rb, line 72
-def projects
-  @projects ||= group.projects.authorized_for(current_user).sorted_by_activity
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/HelpController.html b/doc/code/classes/HelpController.html deleted file mode 100644 index fbb76563389..00000000000 --- a/doc/code/classes/HelpController.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - HelpController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
I
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/help_controller.rb, line 2
-def index
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/HooksController.html b/doc/code/classes/HooksController.html deleted file mode 100644 index 511e05f0da9..00000000000 --- a/doc/code/classes/HooksController.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - HooksController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
T
-
-
    - - -
  • - test -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/hooks_controller.rb, line 13
-def create
-  @hook = @project.hooks.new(params[:hook])
-  @hook.save
-
-  if @hook.valid?
-    redirect_to project_hooks_path(@project)
-  else
-    @hooks = @project.hooks.all
-    render :index
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/hooks_controller.rb, line 31
-def destroy
-  @hook = @project.hooks.find(params[:id])
-  @hook.destroy
-
-  redirect_to project_hooks_path(@project)
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/hooks_controller.rb, line 8
-def index
-  @hooks = @project.hooks.all
-  @hook = ProjectHook.new
-end
-
-
- -
- -
-
- - test() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/hooks_controller.rb, line 25
-def test
-  TestHookContext.new(project, current_user, params).execute
-
-  redirect_to :back
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Issue.html b/doc/code/classes/Issue.html deleted file mode 100644 index 6f71ea72eb4..00000000000 --- a/doc/code/classes/Issue.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Issue - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: issues

- -
id           :integer          not null, primary key
-title        :string(255)
-assignee_id  :integer
-author_id    :integer
-project_id   :integer
-created_at   :datetime         not null
-updated_at   :datetime         not null
-closed       :boolean          default(FALSE), not null
-position     :integer          default(0)
-branch_name  :string(255)
-description  :text
-milestone_id :integer
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
O
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - open_for(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/issue.rb, line 30
-def self.open_for(user)
-  opened.assigned(user)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssueCommonality.html b/doc/code/classes/IssueCommonality.html deleted file mode 100644 index 7398308a176..00000000000 --- a/doc/code/classes/IssueCommonality.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - IssueCommonality - - - - - - - - - - - - - -
-
- -
- -

Contains common functionality shared between Issues and MergeRequests

- -
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
I
-
- -
- -
N
-
-
    - - -
  • - new? -
  • - -
-
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - is_assigned?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 51
-def is_assigned?
-  !!assignee_id
-end
-
-
- -
- -
-
- - is_being_closed?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 59
-def is_being_closed?
-  closed_changed? && closed
-end
-
-
- -
- -
-
- - is_being_reassigned?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 55
-def is_being_reassigned?
-  assignee_id_changed?
-end
-
-
- -
- -
-
- - is_being_reopened?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 63
-def is_being_reopened?
-  closed_changed? && !closed
-end
-
-
- -
- -
-
- - new?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 47
-def new?
-  today? && created_at == updated_at
-end
-
-
- -
- -
-
- - today?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 43
-def today?
-  Date.today == created_at.to_date
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssueCommonality/ClassMethods.html b/doc/code/classes/IssueCommonality/ClassMethods.html deleted file mode 100644 index 5c3ca9b2add..00000000000 --- a/doc/code/classes/IssueCommonality/ClassMethods.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - IssueCommonality::ClassMethods - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/roles/issue_commonality.rb, line 38
-def search(query)
-  where("title like :query", query: "%#{query}%")
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssueObserver.html b/doc/code/classes/IssueObserver.html deleted file mode 100644 index 1600c0f08ac..00000000000 --- a/doc/code/classes/IssueObserver.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - IssueObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(issue) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/issue_observer.rb, line 4
-def after_create(issue)
-  if issue.assignee && issue.assignee != current_user
-    Notify.new_issue_email(issue.id).deliver
-  end
-end
-
-
- -
- -
-
- - after_update(issue) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/issue_observer.rb, line 10
-def after_update(issue)
-  send_reassigned_email(issue) if issue.is_being_reassigned?
-
-  status = nil
-  status = 'closed' if issue.is_being_closed?
-  status = 'reopened' if issue.is_being_reopened?
-  if status
-    Note.create_status_change_note(issue, current_user, status)
-    [issue.author, issue.assignee].compact.each do |recipient|
-      Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user.id).deliver
-    end
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - send_reassigned_email(issue) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/issue_observer.rb, line 26
-def send_reassigned_email(issue)
-  recipient_ids = [issue.assignee_id, issue.assignee_id_was].keep_if {|id| id && id != current_user.id }
-
-  recipient_ids.each do |recipient_id|
-    Notify.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was).deliver
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssuesBulkUpdateContext.html b/doc/code/classes/IssuesBulkUpdateContext.html deleted file mode 100644 index 0214d217e19..00000000000 --- a/doc/code/classes/IssuesBulkUpdateContext.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - IssuesBulkUpdateContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/issues_bulk_update_context.rb, line 2
-def execute
-  update_data = params[:update]
-
-  issues_ids   = update_data[:issues_ids].split(",")
-  milestone_id = update_data[:milestone_id]
-  assignee_id  = update_data[:assignee_id]
-  status       = update_data[:status]
-
-  opts = {} 
-  opts[:milestone_id] = milestone_id if milestone_id.present?
-  opts[:assignee_id] = assignee_id if assignee_id.present?
-  opts[:closed] = (status == "closed") if status.present?
-
-  issues = Issue.where(id: issues_ids).all
-  issues = issues.select { |issue| can?(current_user, :modify_issue, issue) }
-  issues.each { |issue| issue.update_attributes(opts) }
-  { 
-    count: issues.count,
-    success: !issues.count.zero?
-  }
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssuesController.html b/doc/code/classes/IssuesController.html deleted file mode 100644 index 1e18d7a8826..00000000000 --- a/doc/code/classes/IssuesController.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - IssuesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - bulk_update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 99
-def bulk_update
-  result = IssuesBulkUpdateContext.new(project, current_user, params).execute
-  redirect_to :back, notice: "#{result[:count]} issues updated"
-end
-
-
- -
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 45
-def create
-  @issue = @project.issues.new(params[:issue])
-  @issue.author = current_user
-  @issue.save
-
-  respond_to do |format|
-    format.html do
-      if @issue.valid?
-        redirect_to project_issue_path(@project, @issue)
-      else
-        render :new
-      end
-    end
-    format.js
-  end
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 32
-def edit
-  respond_with(@issue)
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 16
-def index
-  @issues = issues_filtered
-  @issues = @issues.page(params[:page]).per(20)
-
-  respond_to do |format|
-    format.html # index.html.erb
-    format.js
-    format.atom { render layout: false }
-  end
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 27
-def new
-  @issue = @project.issues.new(params[:issue])
-  respond_with(@issue)
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 89
-def search
-  terms = params['terms']
-
-  @issues = issues_filtered
-  @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank?
-  @issues = @issues.page(params[:page]).per(100)
-
-  render partial: 'issues'
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 36
-def show
-  @note = @project.notes.new(noteable: @issue)
-
-  respond_to do |format|
-    format.html
-    format.js
-  end
-end
-
-
- -
- -
-
- - sort() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 77
-def sort
-  return render_404 unless can?(current_user, :admin_issue, @project)
-
-  @issues = @project.issues.where(id: params['issue'])
-  @issues.each do |issue|
-    issue.position = params['issue'].index(issue.id.to_s) + 1
-    issue.save
-  end
-
-  render nothing: true
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 62
-def update
-  @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id))
-
-  respond_to do |format|
-    format.js
-    format.html do
-      if @issue.valid?
-        redirect_to [@project, @issue]
-      else
-        render :edit
-      end
-    end
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - authorize_admin_issue!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 114
-def authorize_admin_issue!
-  return render_404 unless can?(current_user, :admin_issue, @issue)
-end
-
-
- -
- -
-
- - authorize_modify_issue!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 110
-def authorize_modify_issue!
-  return render_404 unless can?(current_user, :modify_issue, @issue)
-end
-
-
- -
- -
-
- - issue() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 106
-def issue
-  @issue ||= @project.issues.find(params[:id])
-end
-
-
- -
- -
-
- - issues_filtered() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 122
-def issues_filtered
-  @issues = IssuesListContext.new(project, current_user, params).execute
-end
-
-
- -
- -
-
- - module_enabled() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/issues_controller.rb, line 118
-def module_enabled
-  return render_404 unless @project.issues_enabled
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssuesHelper.html b/doc/code/classes/IssuesHelper.html deleted file mode 100644 index 7b7510451b1..00000000000 --- a/doc/code/classes/IssuesHelper.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - IssuesHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
I
-
- -
- -
L
-
- -
- -
P
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - issue_css_classes(issue) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 7
-def issue_css_classes issue
-  classes = "issue"
-  classes << " closed" if issue.closed
-  classes << " today" if issue.today?
-  classes
-end
-
-
- -
- -
-
- - issue_tags() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 14
-def issue_tags
-  @project.issues.tag_counts_on(:labels).map(&:name)
-end
-
-
- -
- -
-
- - issues_active_milestones() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 40
-def issues_active_milestones
-  @project.milestones.active.order("id desc").all
-end
-
-
- -
- -
-
- - issues_filter() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 25
-def issues_filter
-  {
-    all: "all",
-    closed: "closed",
-    to_me: "assigned-to-me",
-    open: "open"
-  }
-end
-
-
- -
- -
-
- - labels_autocomplete_source() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 34
-def labels_autocomplete_source
-  labels = @project.issues_labels.order('count DESC')
-  labels = labels.map{ |l| { label: l.name, value: l.name } }
-  labels.to_json
-end
-
-
- -
- -
-
- - project_issues_filter_path(project, params = {}) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 2
-def project_issues_filter_path project, params = {}
-  params[:f] ||= cookies['issue_filter']
-  project_issues_path project, params
-end
-
-
- -
- -
-
- - unassigned_filter() - - -
- - -
-

Returns an OpenStruct object suitable for use by -options_from_collection_for_select to allow filtering issues -by an unassigned User or Milestone

-
- - - - - - -
- - -
-
# File app/helpers/issues_helper.rb, line 20
-def unassigned_filter
-  # Milestone uses :title, Issue uses :name
-  OpenStruct.new(id: 0, title: 'Unspecified', name: 'Unassigned')
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/IssuesListContext.html b/doc/code/classes/IssuesListContext.html deleted file mode 100644 index 0298ec75f13..00000000000 --- a/doc/code/classes/IssuesListContext.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - IssuesListContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - -
- [RW] - issues
- - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/issues_list_context.rb, line 6
-def execute
-  @issues = case params[:f]
-            when issues_filter[:all] then @project.issues
-            when issues_filter[:closed] then @project.issues.closed
-            when issues_filter[:to_me] then @project.issues.opened.assigned(current_user)
-            else @project.issues.opened
-            end
-
-  @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present?
-  @issues = @issues.includes(:author, :project).order("updated_at")
-
-  # Filter by specific assignee_id (or lack thereof)?
-  if params[:assignee_id].present?
-    @issues = @issues.where(assignee_id: (params[:assignee_id] == '0' ? nil : params[:assignee_id]))
-  end
-
-  # Filter by specific milestone_id (or lack thereof)?
-  if params[:milestone_id].present?
-    @issues = @issues.where(milestone_id: (params[:milestone_id] == '0' ? nil : params[:milestone_id]))
-  end
-
-  @issues
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Key.html b/doc/code/classes/Key.html deleted file mode 100644 index 0935e4862ef..00000000000 --- a/doc/code/classes/Key.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - Key - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
F
-
- -
- -
I
-
- -
- -
L
-
- -
- -
P
-
- -
- -
S
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - fingerprintable_key() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/key.rb, line 44
-def fingerprintable_key
-  return true unless key # Don't test if there is no key.
-  # `ssh-keygen -lf /dev/stdin <<< "#{key}"` errors with: redirection unexpected
-  file = Tempfile.new('key_file')
-  begin
-    file.puts key
-    file.rewind
-    fingerprint_output = %xssh-keygen -lf #{file.path} 2>&1` # Catch stderr.
-  ensure
-    file.close
-    file.unlink # deletes the temp file
-  end
-  errors.add(:key, "can't be fingerprinted") if fingerprint_output.match("failed")
-end
-
-
- -
- -
-
- - is_deploy_key() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/key.rb, line 67
-def is_deploy_key
-  true if project_id
-end
-
-
- -
- -
-
- - last_deploy?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/key.rb, line 80
-def last_deploy?
-  Key.where(identifier: identifier).count == 0
-end
-
-
- -
- -
-
- - projects() - - -
- - -
-

projects that has this key

-
- - - - - - -
- - -
-
# File app/models/key.rb, line 72
-def projects
-  if is_deploy_key
-    [project]
-  else
-    user.projects
-  end
-end
-
-
- -
- -
-
- - set_identifier() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/key.rb, line 59
-def set_identifier
-  if is_deploy_key
-    self.identifier = "deploy_#{Digest::MD5.hexdigest(key)}"
-  else
-    self.identifier = "#{user.identifier}_#{Time.now.to_i}"
-  end
-end
-
-
- -
- -
-
- - strip_white_space() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/key.rb, line 32
-def strip_white_space
-  self.key = self.key.strip unless self.key.blank?
-end
-
-
- -
- -
-
- - unique_key() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/key.rb, line 36
-def unique_key
-  query = Key.where(key: key)
-  query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id
-  if (query.count > 0)
-    errors.add :key, 'already exist.'
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/KeyObserver.html b/doc/code/classes/KeyObserver.html deleted file mode 100644 index 1044ea2f7f9..00000000000 --- a/doc/code/classes/KeyObserver.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - KeyObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_destroy(key) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/key_observer.rb, line 8
-def after_destroy(key)
-  return if key.is_deploy_key && !key.last_deploy?
-  git_host.remove_key(key.identifier, key.projects)
-end
-
-
- -
- -
-
- - after_save(key) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/key_observer.rb, line 4
-def after_save(key)
-  git_host.set_key(key.identifier, key.key, key.projects)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/KeysController.html b/doc/code/classes/KeysController.html deleted file mode 100644 index 9caccb753f2..00000000000 --- a/doc/code/classes/KeysController.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - KeysController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/keys_controller.rb, line 19
-def create
-  @key = current_user.keys.new(params[:key])
-  @key.save
-
-  respond_with(@key)
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/keys_controller.rb, line 26
-def destroy
-  @key = current_user.keys.find(params[:id])
-  @key.destroy
-
-  respond_to do |format|
-    format.html { redirect_to keys_url }
-    format.js { render nothing: true }
-  end
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/keys_controller.rb, line 5
-def index
-  @keys = current_user.keys.all
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/keys_controller.rb, line 13
-def new
-  @key = current_user.keys.new
-
-  respond_with(@key)
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/keys_controller.rb, line 9
-def show
-  @key = current_user.keys.find(params[:id])
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/LabelsController.html b/doc/code/classes/LabelsController.html deleted file mode 100644 index 53d54c6bbb0..00000000000 --- a/doc/code/classes/LabelsController.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - LabelsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
I
-
- -
- -
M
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/labels_controller.rb, line 9
-def index
-  @labels = @project.issues_labels.order('count DESC')
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - module_enabled() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/labels_controller.rb, line 15
-def module_enabled
-  return render_404 unless @project.issues_enabled
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/MergeRequest.html b/doc/code/classes/MergeRequest.html deleted file mode 100644 index cd4046095b0..00000000000 --- a/doc/code/classes/MergeRequest.html +++ /dev/null @@ -1,1569 +0,0 @@ - - - - - MergeRequest - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
D
-
- -
- -
F
-
- -
- -
H
-
- -
- -
L
-
- -
- -
M
-
- -
- -
O
-
- -
- -
P
-
- -
- -
R
-
- -
- -
T
-
- -
- -
U
-
- -
- -
V
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BROKEN_DIFF="--broken-diff"
 
UNCHECKED=1
 
CAN_BE_MERGED=2
 
CANNOT_BE_MERGED=3
 
- - - - - -
Attributes
- - - - - - - - -
- [RW] - should_remove_source_branch
- - - - - -
Class Public methods
- -
-
- - find_all_by_branch(branch_name) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 47
-def self.find_all_by_branch(branch_name)
-  where("source_branch LIKE :branch OR target_branch LIKE :branch", branch: branch_name)
-end
-
-
- -
- -
-
- - find_all_by_milestone(milestone) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 51
-def self.find_all_by_milestone(milestone)
-  where("milestone_id = :milestone_id", milestone_id: milestone)
-end
-
-
- -
- -
Instance Public methods
- -
-
- - automerge!(current_user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 195
-def automerge!(current_user)
-  if Gitlab::Satellite::MergeAction.new(current_user, self).merge! && self.unmerged_commits.empty?
-    self.merge!(current_user.id)
-    true
-  end
-rescue
-  self.mark_as_unmergable
-  false
-end
-
-
- -
- -
-
- - broken_diffs?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 112
-def broken_diffs?
-  diffs == [BROKEN_DIFF]
-end
-
-
- -
- -
-
- - can_be_merged?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 84
-def can_be_merged?
-  state == CAN_BE_MERGED
-end
-
-
- -
- -
-
- - check_if_can_be_merged() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 88
-def check_if_can_be_merged
-  self.state = if Gitlab::Satellite::MergeAction.new(self.author, self).can_be_merged?
-                 CAN_BE_MERGED
-               else
-                 CANNOT_BE_MERGED
-               end
-  self.save
-end
-
-
- -
- -
-
- - closed_event() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 140
-def closed_event
-  self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Closed).last
-end
-
-
- -
- -
-
- - commits() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 144
-def commits
-  st_commits || []
-end
-
-
- -
- -
-
- - diffs() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 97
-def diffs
-  st_diffs || []
-end
-
-
- -
- -
-
- - human_state() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 55
-def human_state
-  states = {
-    CAN_BE_MERGED =>  "can_be_merged",
-    CANNOT_BE_MERGED => "cannot_be_merged",
-    UNCHECKED => "unchecked"
-  }
-  states[self.state]
-end
-
-
- -
- -
-
- - last_commit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 128
-def last_commit
-  commits.first
-end
-
-
- -
- -
-
- - last_commit_short_sha() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 224
-def last_commit_short_sha
-  @last_commit_short_sha ||= last_commit.sha[0..10]
-end
-
-
- -
- -
-
- - mark_as_merged!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 157
-def mark_as_merged!
-  self.merged = true
-  self.closed = true
-  save
-end
-
-
- -
- -
-
- - mark_as_unchecked() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 79
-def mark_as_unchecked
-  self.state = UNCHECKED
-  self.save
-end
-
-
- -
- -
-
- - mark_as_unmergable() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 163
-def mark_as_unmergable
-  self.state = CANNOT_BE_MERGED
-  self.save
-end
-
-
- -
- -
-
- - merge!(user_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 184
-def merge!(user_id)
-  self.mark_as_merged!
-  Event.create(
-    project: self.project,
-    action: Event::Merged,
-    target_id: self.id,
-    target_type: "MergeRequest",
-    author_id: user_id
-  )
-end
-
-
- -
- -
-
- - merge_event() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 136
-def merge_event
-  self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Merged).last
-end
-
-
- -
- -
-
- - merged?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 132
-def merged?
-  merged && merge_event
-end
-
-
- -
- -
-
- - mr_and_commit_notes() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 205
-def mr_and_commit_notes
-  commit_ids = commits.map(&:id)
-  Note.where("(noteable_type = 'MergeRequest' AND noteable_id = :mr_id) OR (noteable_type = 'Commit' AND commit_id IN (:commit_ids))", mr_id: id, commit_ids: commit_ids)
-end
-
-
- -
- -
-
- - open?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 153
-def open?
-  !closed
-end
-
-
- -
- -
-
- - probably_merged?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 148
-def probably_merged?
-  unmerged_commits.empty? &&
-    commits.any? && open?
-end
-
-
- -
- -
-
- - reload_code() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 70
-def reload_code
-  self.reloaded_commits
-  self.reloaded_diffs
-end
-
-
- -
- -
-
- - reloaded_commits() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 168
-def reloaded_commits
-  if open? && unmerged_commits.any?
-    self.st_commits = unmerged_commits
-    save
-  end
-  commits
-end
-
-
- -
- -
-
- - reloaded_diffs() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 101
-def reloaded_diffs
-  if open? && unmerged_diffs.any?
-    self.st_diffs = unmerged_diffs
-    self.save
-  end
-
-rescue Grit::Git::GitTimeout
-  self.st_diffs = [BROKEN_DIFF]
-  self.save
-end
-
-
- -
- -
-
- - to_diff() - - -
- - -
-

Returns the raw diff for this merge request

- -

see “git diff”

-
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 213
-def to_diff
-  project.repo.git.native(:diff, {timeout: 30, raise: true}, "#{target_branch}...#{source_branch}")
-end
-
-
- -
- -
-
- - to_patch() - - -
- - -
-

Returns the commit as a series of email patches.

- -

see “git format-patch”

-
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 220
-def to_patch
-  project.repo.git.format_patch({timeout: 30, raise: true, stdout: true}, "#{target_branch}..#{source_branch}")
-end
-
-
- -
- -
-
- - unchecked?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 75
-def unchecked?
-  state == UNCHECKED
-end
-
-
- -
- -
-
- - unmerged_commits() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 176
-def unmerged_commits
-  self.project.repo.
-    commits_between(self.target_branch, self.source_branch).
-    map {|c| Commit.new(c)}.
-    sort_by(&:created_at).
-    reverse
-end
-
-
- -
- -
-
- - unmerged_diffs() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 120
-def unmerged_diffs
-  # Only show what is new in the source branch compared to the target branch, not the other way around.
-  # The linex below with merge_base is equivalent to diff with three dots (git diff branch1...branch2)
-  # From the git documentation: "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B"
-  common_commit = project.repo.git.native(:merge_base, {}, [target_branch, source_branch]).strip
-  diffs = project.repo.diff(common_commit, source_branch)
-end
-
-
- -
- -
-
- - valid_diffs?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 116
-def valid_diffs?
-  !broken_diffs?
-end
-
-
- -
- -
-
- - validate_branches() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/merge_request.rb, line 64
-def validate_branches
-  if target_branch == source_branch
-    errors.add :base, "You can not use same branch for source and target branches"
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/MergeRequestObserver.html b/doc/code/classes/MergeRequestObserver.html deleted file mode 100644 index 364e0346134..00000000000 --- a/doc/code/classes/MergeRequestObserver.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - MergeRequestObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(merge_request) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/merge_request_observer.rb, line 4
-def after_create(merge_request)
-  if merge_request.assignee && merge_request.assignee != current_user
-    Notify.new_merge_request_email(merge_request.id).deliver
-  end
-end
-
-
- -
- -
-
- - after_update(merge_request) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/merge_request_observer.rb, line 10
-def after_update(merge_request)
-  send_reassigned_email(merge_request) if merge_request.is_being_reassigned?
-
-  status = nil
-  status = 'closed' if merge_request.is_being_closed?
-  status = 'reopened' if merge_request.is_being_reopened?
-  if status
-    Note.create_status_change_note(merge_request, current_user, status)
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - send_reassigned_email(merge_request) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/merge_request_observer.rb, line 23
-def send_reassigned_email(merge_request)
-  recipients_ids = merge_request.assignee_id_was, merge_request.assignee_id
-  recipients_ids.delete current_user.id
-
-  recipients_ids.each do |recipient_id|
-    Notify.reassigned_merge_request_email(recipient_id, merge_request.id, merge_request.assignee_id_was).deliver
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/MergeRequestsController.html b/doc/code/classes/MergeRequestsController.html deleted file mode 100644 index 4cf181fa8d5..00000000000 --- a/doc/code/classes/MergeRequestsController.html +++ /dev/null @@ -1,932 +0,0 @@ - - - - - MergeRequestsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
U
-
- -
- -
V
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - automerge() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 74
-def automerge
-  return access_denied! unless can?(current_user, :accept_mr, @project)
-  if @merge_request.open? && @merge_request.can_be_merged?
-    @merge_request.should_remove_source_branch = params[:should_remove_source_branch]
-    @merge_request.automerge!(current_user)
-    @status = true
-  else
-    @status = false
-  end
-end
-
-
- -
- -
-
- - automerge_check() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 67
-def automerge_check
-  if @merge_request.unchecked?
-    @merge_request.check_if_can_be_merged
-  end
-  render json: {state: @merge_request.human_state}
-end
-
-
- -
- -
-
- - branch_from() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 85
-def branch_from
-  @commit = project.commit(params[:ref])
-  @commit = CommitDecorator.decorate(@commit)
-end
-
-
- -
- -
-
- - branch_to() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 90
-def branch_to
-  @commit = project.commit(params[:ref])
-  @commit = CommitDecorator.decorate(@commit)
-end
-
-
- -
- -
-
- - ci_status() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 95
-def ci_status
-  status = project.gitlab_ci_service.commit_status(merge_request.last_commit.sha)
-  response = { status: status }
-
-  render json: response
-end
-
-
- -
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 45
-def create
-  @merge_request = @project.merge_requests.new(params[:merge_request])
-  @merge_request.author = current_user
-
-  if @merge_request.save
-    @merge_request.reload_code
-    redirect_to [@project, @merge_request], notice: 'Merge request was successfully created.'
-  else
-    render action: "new"
-  end
-end
-
-
- -
- -
-
- - diffs() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 30
-def diffs
-  @diffs = @merge_request.diffs
-  @commit = @merge_request.last_commit
-
-  @comments_allowed = true
-  @line_notes = @merge_request.notes.where("line_code is not null")
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 42
-def edit
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 16
-def index
-  @merge_requests = MergeRequestsLoadContext.new(project, current_user, params).execute
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 38
-def new
-  @merge_request = @project.merge_requests.new(params[:merge_request])
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 20
-def show
-  respond_to do |format|
-    format.html
-    format.js
-
-    format.diff  { render text: @merge_request.to_diff }
-    format.patch { render text: @merge_request.to_patch }
-  end
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 57
-def update
-  if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id))
-    @merge_request.reload_code
-    @merge_request.mark_as_unchecked
-    redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.'
-  else
-    render action: "edit"
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - authorize_admin_merge_request!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 112
-def authorize_admin_merge_request!
-  return render_404 unless can?(current_user, :admin_merge_request, @merge_request)
-end
-
-
- -
- -
-
- - authorize_modify_merge_request!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 108
-def authorize_modify_merge_request!
-  return render_404 unless can?(current_user, :modify_merge_request, @merge_request)
-end
-
-
- -
- -
-
- - define_show_vars() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 129
-def define_show_vars
-  # Build a note object for comment form
-  @note = @project.notes.new(noteable: @merge_request)
-
-  # Get commits from repository
-  # or from cache if already merged
-  @commits = @merge_request.commits
-  @commits = CommitDecorator.decorate(@commits)
-end
-
-
- -
- -
-
- - merge_request() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 104
-def merge_request
-  @merge_request ||= @project.merge_requests.find(params[:id])
-end
-
-
- -
- -
-
- - module_enabled() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 116
-def module_enabled
-  return render_404 unless @project.merge_requests_enabled
-end
-
-
- -
- -
-
- - validates_merge_request() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/merge_requests_controller.rb, line 120
-def validates_merge_request
-  # Show git not found page if target branch doesnt exist
-  return git_not_found! unless @project.repo.heads.map(&:name).include?(@merge_request.target_branch)
-
-  # Show git not found page if source branch doesnt exist
-  # and there is no saved commits between source & target branch
-  return git_not_found! if !@project.repo.heads.map(&:name).include?(@merge_request.source_branch) && @merge_request.commits.blank?
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/MergeRequestsHelper.html b/doc/code/classes/MergeRequestsHelper.html deleted file mode 100644 index 33725cf7ac8..00000000000 --- a/doc/code/classes/MergeRequestsHelper.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - MergeRequestsHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
M
-
- -
- -
N
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - ci_build_details_path(merge_request) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/merge_requests_helper.rb, line 20
-def ci_build_details_path merge_request
-  merge_request.project.gitlab_ci_service.build_page(merge_request.last_commit.sha)
-end
-
-
- -
- -
-
- - mr_css_classes(mr) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/merge_requests_helper.rb, line 13
-def mr_css_classes mr
-  classes = "merge_request"
-  classes << " closed" if mr.closed
-  classes << " merged" if mr.merged?
-  classes
-end
-
-
- -
- -
-
- - new_mr_path_from_push_event(event) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/merge_requests_helper.rb, line 2
-def new_mr_path_from_push_event(event)
-  new_project_merge_request_path(
-    event.project,
-    merge_request: {
-      source_branch: event.branch_name,
-      target_branch: event.project.root_ref,
-      title: event.branch_name.titleize
-    }
-  )
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/MergeRequestsLoadContext.html b/doc/code/classes/MergeRequestsLoadContext.html deleted file mode 100644 index 5e2501c70b5..00000000000 --- a/doc/code/classes/MergeRequestsLoadContext.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - MergeRequestsLoadContext - - - - - - - - - - - - - -
-
- -
- -

Build collection of Merge Requests based on filtering passed via params for -@project

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/merge_requests_load_context.rb, line 4
-def execute
-  type = params[:f]
-
-  merge_requests = project.merge_requests
-
-  merge_requests = case type
-                   when 'all' then merge_requests
-                   when 'closed' then merge_requests.closed
-                   when 'assigned-to-me' then merge_requests.opened.assigned(current_user)
-                   else merge_requests.opened
-                   end
-
-  merge_requests = merge_requests.page(params[:page]).per(20)
-  merge_requests = merge_requests.includes(:author, :project).order("closed, created_at desc")
-
-  # Filter by specific assignee_id (or lack thereof)?
-  if params[:assignee_id].present?
-    merge_requests = merge_requests.where(assignee_id: (params[:assignee_id] == '0' ? nil : params[:assignee_id]))
-  end
-
-  # Filter by specific milestone_id (or lack thereof)?
-  if params[:milestone_id].present?
-    merge_requests = merge_requests.where(milestone_id: (params[:milestone_id] == '0' ? nil : params[:milestone_id]))
-  end
-
-  merge_requests
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Milestone.html b/doc/code/classes/Milestone.html deleted file mode 100644 index 5f275210da1..00000000000 --- a/doc/code/classes/Milestone.html +++ /dev/null @@ -1,616 +0,0 @@ - - - - - Milestone - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: milestones

- -
id          :integer          not null, primary key
-title       :string(255)      not null
-project_id  :integer          not null
-description :text
-due_date    :date
-closed      :boolean          default(FALSE), not null
-created_at  :datetime         not null
-updated_at  :datetime         not null
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
E
-
- -
- -
I
-
- -
- -
O
-
- -
- -
P
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - -
- [RW] - author_id_of_changes
- - - - - -
Instance Public methods
- -
-
- - author_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 82
-def author_id
-  author_id_of_changes
-end
-
-
- -
- -
-
- - can_be_closed?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 70
-def can_be_closed?
-  open? && issues.opened.count.zero?
-end
-
-
- -
- -
-
- - closed_items_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 46
-def closed_items_count
-  self.issues.closed.count + self.merge_requests.closed.count
-end
-
-
- -
- -
-
- - expired?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 30
-def expired?
-  if due_date
-    due_date.past?
-  else
-    false
-  end
-end
-
-
- -
- -
-
- - expires_at() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 60
-def expires_at
-  if due_date
-    if due_date.past?
-      "expired at #{due_date.stamp("Aug 21, 2011")}"
-    else
-      "expires at #{due_date.stamp("Aug 21, 2011")}"  
-    end
-  end  
-end
-
-
- -
- -
-
- - is_empty?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 74
-def is_empty?
-  total_items_count.zero?
-end
-
-
- -
- -
-
- - open?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 78
-def open?
-  !closed
-end
-
-
- -
- -
-
- - open_items_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 42
-def open_items_count
-  self.issues.opened.count + self.merge_requests.opened.count
-end
-
-
- -
- -
-
- - participants() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 38
-def participants
-  User.where(id: issues.pluck(:assignee_id))
-end
-
-
- -
- -
-
- - percent_complete() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 54
-def percent_complete
-  ((closed_items_count * 100) / total_items_count).abs
-rescue ZeroDivisionError
-  100
-end
-
-
- -
- -
-
- - total_items_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/milestone.rb, line 50
-def total_items_count
-  self.issues.count + self.merge_requests.count
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/MilestonesController.html b/doc/code/classes/MilestonesController.html deleted file mode 100644 index 48a3beb66a1..00000000000 --- a/doc/code/classes/MilestonesController.html +++ /dev/null @@ -1,589 +0,0 @@ - - - - - MilestonesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
M
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 44
-def create
-  @milestone = @project.milestones.new(params[:milestone])
-  @milestone.author_id_of_changes = current_user.id
-
-  if @milestone.save
-    redirect_to project_milestone_path(@project, @milestone)
-  else
-    render "new"
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 70
-def destroy
-  return access_denied! unless can?(current_user, :admin_milestone, @milestone)
-
-  @milestone.destroy
-
-  respond_to do |format|
-    format.html { redirect_to project_milestones_path }
-    format.js { render nothing: true }
-  end
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 29
-def edit
-  respond_with(@milestone)
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 13
-def index
-  @milestones = case params[:f]
-                when 'all'; @project.milestones.order("closed, due_date DESC")
-                when 'closed'; @project.milestones.closed.order("due_date DESC")
-                else @project.milestones.active.order("due_date ASC")
-                end
-
-  @milestones = @milestones.includes(:project)
-  @milestones = @milestones.page(params[:page]).per(20)
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 24
-def new
-  @milestone = @project.milestones.new
-  respond_with(@milestone)
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 33
-def show
-  @issues = @milestone.issues
-  @users = UserDecorator.decorate(@milestone.participants)
-  @merge_requests = @milestone.merge_requests
-
-  respond_to do |format|
-    format.html
-    format.js
-  end
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 55
-def update
-  @milestone.update_attributes(params[:milestone].merge(author_id_of_changes: current_user.id))
-
-  respond_to do |format|
-    format.js
-    format.html do
-      if @milestone.valid?
-        redirect_to [@project, @milestone]
-      else
-        render :edit
-      end
-    end
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - authorize_admin_milestone!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 87
-def authorize_admin_milestone!
-  return render_404 unless can?(current_user, :admin_milestone, @project)
-end
-
-
- -
- -
-
- - milestone() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 83
-def milestone
-  @milestone ||= @project.milestones.find(params[:id])
-end
-
-
- -
- -
-
- - module_enabled() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/milestones_controller.rb, line 91
-def module_enabled
-  return render_404 unless @project.issues_enabled
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Namespace.html b/doc/code/classes/Namespace.html deleted file mode 100644 index 02c9b7e44ed..00000000000 --- a/doc/code/classes/Namespace.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - - Namespace - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: namespaces

- -
id         :integer          not null, primary key
-name       :string(255)      not null
-path       :string(255)      not null
-owner_id   :integer          not null
-created_at :datetime         not null
-updated_at :datetime         not null
-type       :string(255)
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
E
-
- -
- -
G
-
- -
- -
H
-
- -
- -
M
-
- -
- -
N
-
- -
- -
R
-
- -
- -
S
-
- -
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - global_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 41
-def self.global_id
-  'GLN'
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 37
-def self.search query
-  where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
-end
-
-
- -
- -
Instance Public methods
- -
-
- - dir_exists?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 59
-def dir_exists?
-  File.exists?(namespace_full_path)
-end
-
-
- -
- -
-
- - ensure_dir_exist() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 53
-def ensure_dir_exist
-  unless dir_exists?
-    system("mkdir -m 770 #{namespace_full_path}")
-  end
-end
-
-
- -
- -
-
- - human_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 49
-def human_name
-  owner_name
-end
-
-
- -
- -
-
- - move_dir() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 67
-def move_dir
-  if path_changed?
-    old_path = File.join(Gitlab.config.gitolite.repos_path, path_was)
-    new_path = File.join(Gitlab.config.gitolite.repos_path, path)
-    if File.exists?(new_path)
-      raise "Already exists"
-    end
-
-    if system("mv #{old_path} #{new_path}")
-      send_update_instructions
-      @require_update_gitolite = true
-    else
-      raise "Namespace move error #{old_path} #{new_path}"
-    end
-  end
-end
-
-
- -
- -
-
- - namespace_full_path() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 63
-def namespace_full_path
-  @namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
-end
-
-
- -
- -
-
- - rm_dir() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 89
-def rm_dir
-  dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
-  system("rm -rf #{dir_path}")
-end
-
-
- -
- -
-
- - send_update_instructions() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 94
-def send_update_instructions
-  projects.each(&:send_move_instructions)
-end
-
-
- -
- -
-
- - to_param() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 45
-def to_param
-  path
-end
-
-
- -
- -
-
- - update_gitolite() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/namespace.rb, line 84
-def update_gitolite
-  @require_update_gitolite = false
-  projects.each(&:update_repository)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/NamespacedProject.html b/doc/code/classes/NamespacedProject.html deleted file mode 100644 index 976338e8810..00000000000 --- a/doc/code/classes/NamespacedProject.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - NamespacedProject - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
N
-
- -
- -
P
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - chief() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/namespaced_project.rb, line 44
-def chief
-  if namespace
-    namespace_owner
-  else
-    owner
-  end
-end
-
-
- -
- -
-
- - name_with_namespace() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/namespaced_project.rb, line 30
-def name_with_namespace
-  @name_with_namespace ||= begin
-                             if namespace
-                               namespace.human_name + " / " + name
-                             else
-                               name
-                             end
-                           end
-end
-
-
- -
- -
-
- - namespace_owner() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/namespaced_project.rb, line 40
-def namespace_owner
-  namespace.try(:owner)
-end
-
-
- -
- -
-
- - path_with_namespace() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/namespaced_project.rb, line 52
-def path_with_namespace
-  if namespace
-    namespace.path + '/' + path
-  else
-    path
-  end
-end
-
-
- -
- -
-
- - transfer(new_namespace) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/namespaced_project.rb, line 2
-def transfer(new_namespace)
-  Project.transaction do
-    old_namespace = namespace
-    self.namespace = new_namespace
-
-    old_dir = old_namespace.try(:path) || ''
-    new_dir = new_namespace.try(:path) || ''
-
-    old_repo = if old_dir.present?
-                 File.join(old_dir, self.path)
-               else
-                 self.path
-               end
-
-    if Project.where(path: self.path, namespace_id: new_namespace.try(:id)).present?
-      raise TransferError.new("Project with same path in target namespace already exists")
-    end
-
-    Gitlab::ProjectMover.new(self, old_dir, new_dir).execute
-
-    git_host.move_repository(old_repo, self)
-
-    save!
-  end
-rescue Gitlab::ProjectMover::ProjectMoveError => ex
-  raise Project::TransferError.new(ex.message)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/NamespacesHelper.html b/doc/code/classes/NamespacesHelper.html deleted file mode 100644 index 28d485d9ffb..00000000000 --- a/doc/code/classes/NamespacesHelper.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - NamespacesHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
N
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - namespaces_options(selected = :current_user, scope = :default) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/namespaces_helper.rb, line 2
-def namespaces_options(selected = :current_user, scope = :default)
-  groups = current_user.namespaces.select {|n| n.type == 'Group'}
-
-  users = if scope == :all
-            Namespace.root
-          else
-            current_user.namespaces.reject {|n| n.type == 'Group'}
-          end
-
-  global_opts = ["Global", [['/', Namespace.global_id]] ]
-  group_opts = ["Groups", groups.map {|g| [g.human_name, g.id]} ]
-  users_opts = [ "Users", users.map {|u| [u.human_name, u.id]} ]
-
-  options = []
-  options << global_opts if current_user.admin
-  options << group_opts
-  options << users_opts
-
-  if selected == :current_user && current_user.namespace
-    selected = current_user.namespace.id
-  end
-
-  grouped_options_for_select(options, selected)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Note.html b/doc/code/classes/Note.html deleted file mode 100644 index 4ec1c4dcf79..00000000000 --- a/doc/code/classes/Note.html +++ /dev/null @@ -1,536 +0,0 @@ - - - - - Note - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
F
-
- -
- -
N
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - -
- [RW] - notify
- [RW] - notify_author
- - - - - -
Class Public methods
- -
-
- - create_status_change_note(noteable, author, status) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/note.rb, line 53
-def self.create_status_change_note(noteable, author, status)
-  create({
-    noteable: noteable,
-    project: noteable.project,
-    author: author,
-    note: "_Status changed to #{status}_"
-  }, without_protection: true)
-end
-
-
- -
- -
Instance Public methods
- -
-
- - commit_author() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/note.rb, line 109
-def commit_author
-  @commit_author ||=
-    project.users.find_by_email(noteable.author_email) ||
-    project.users.find_by_name(noteable.author_name)
-rescue
-  nil
-end
-
-
- -
- -
-
- - downvote?() - - -
- - -
-

Returns true if this is a downvote note, otherwise false is returned

-
- - - - - - -
- - -
-
# File app/models/note.rb, line 125
-def downvote?
-  note.start_with?('-1') || note.start_with?(':-1:')
-end
-
-
- -
- -
-
- - for_commit?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/note.rb, line 101
-def for_commit?
-  noteable_type == "Commit"
-end
-
-
- -
- -
-
- - for_diff_line?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/note.rb, line 105
-def for_diff_line?
-  line_code.present?
-end
-
-
- -
- -
-
- - noteable() - - -
- - -
-

override to return commits, which are not active record

-
- - - - - - -
- - -
-
# File app/models/note.rb, line 71
-def noteable
-  if for_commit?
-    project.commit(commit_id)
-  else
-    super
-  end
-# Temp fix to prevent app crash
-# if note commit id doesnt exist
-rescue
-  nil
-end
-
-
- -
- -
-
- - noteable_type_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/note.rb, line 129
-def noteable_type_name
-  if noteable_type.present?
-    noteable_type.downcase
-  else
-    "wall"
-  end
-end
-
-
- -
- -
-
- - notify_only_author?(user) - - -
- - -
-

Check if we can notify commit author with email about our comment

- -

If commit author email exist in project and commit author is not passed -user we can send email to him

- -

params:

- -
user - current user
- -

return:

- -
Boolean
-
- - - - - - -
- - -
-
# File app/models/note.rb, line 96
-def notify_only_author?(user)
-  for_commit? && commit_author &&
-    commit_author.email != user.email
-end
-
-
- -
- -
-
- - upvote?() - - -
- - -
-

Returns true if this is an upvote note, otherwise false is returned

-
- - - - - - -
- - -
-
# File app/models/note.rb, line 119
-def upvote?
-  note.start_with?('+1') || note.start_with?(':+1:')
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/NoteEvent.html b/doc/code/classes/NoteEvent.html deleted file mode 100644 index 0817d17018a..00000000000 --- a/doc/code/classes/NoteEvent.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - NoteEvent - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
N
-
- -
- -
W
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - note_commit?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 10
-def note_commit?
-  target.noteable_type == "Commit"
-end
-
-
- -
- -
-
- - note_commit_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 2
-def note_commit_id
-  target.commit_id
-end
-
-
- -
- -
-
- - note_short_commit_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 6
-def note_short_commit_id
-  note_commit_id[0..8]
-end
-
-
- -
- -
-
- - note_target() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 14
-def note_target
-  target.noteable
-end
-
-
- -
- -
-
- - note_target_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 18
-def note_target_id
-  if note_commit?
-    target.commit_id
-  else
-    target.noteable_id.to_s
-  end
-end
-
-
- -
- -
-
- - note_target_type() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 30
-def note_target_type
-  if target.noteable_type.present?
-    target.noteable_type.titleize
-  else
-    "Wall"
-  end.downcase
-end
-
-
- -
- -
-
- - wall_note?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/note_event.rb, line 26
-def wall_note?
-  target.noteable_type.blank?
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/NoteObserver.html b/doc/code/classes/NoteObserver.html deleted file mode 100644 index cc0e5156c44..00000000000 --- a/doc/code/classes/NoteObserver.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - NoteObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
N
-
- -
- -
S
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(note) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/note_observer.rb, line 3
-def after_create(note)
-  send_notify_mails(note)
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - notify_team(note) - - -
- - -
-

Notifies the whole team except the author of note

-
- - - - - - -
- - -
-
# File app/observers/note_observer.rb, line 22
-def notify_team(note)
-  # Note: wall posts are not "attached" to anything, so fall back to "Wall"
-  noteable_type = note.noteable_type.presence || "Wall"
-  notify_method = "note_#{noteable_type.underscore}_email".to_sym
-
-  if Notify.respond_to? notify_method
-    team_without_note_author(note).map do |u|
-      Notify.send(notify_method, u.id, note.id).deliver
-    end
-  end
-end
-
-
- -
- -
-
- - send_notify_mails(note) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/note_observer.rb, line 9
-def send_notify_mails(note)
-  if note.notify
-    notify_team(note)
-  elsif note.notify_author
-    # Notify only author of resource
-    Notify.note_commit_email(note.commit_author.id, note.id).deliver
-  else
-    # Otherwise ignore it
-    nil
-  end
-end
-
-
- -
- -
-
- - team_without_note_author(note) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/note_observer.rb, line 34
-def team_without_note_author(note)
-  note.project.users.reject { |u| u.id == note.author.id }
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Notes.html b/doc/code/classes/Notes.html deleted file mode 100644 index 19b8dd389e4..00000000000 --- a/doc/code/classes/Notes.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Notes - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Notes/CreateContext.html b/doc/code/classes/Notes/CreateContext.html deleted file mode 100644 index adb3a46fab5..00000000000 --- a/doc/code/classes/Notes/CreateContext.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - Notes::CreateContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/notes/create_context.rb, line 3
-def execute
-  note = project.notes.new(params[:note])
-  note.author = current_user
-  note.notify = true if params[:notify] == '1'
-  note.notify_author = true if params[:notify_author] == '1'
-  note.save
-  note
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Notes/LoadContext.html b/doc/code/classes/Notes/LoadContext.html deleted file mode 100644 index 24731bc4e7d..00000000000 --- a/doc/code/classes/Notes/LoadContext.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - Notes::LoadContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/notes/load_context.rb, line 3
-def execute
-  target_type = params[:target_type]
-  target_id   = params[:target_id]
-  after_id    = params[:after_id]
-  before_id   = params[:before_id]
-
-
-  @notes = case target_type
-           when "commit"
-             project.commit_notes(project.commit(target_id)).fresh.limit(20)
-           when "issue"
-             project.issues.find(target_id).notes.inc_author.fresh.limit(20)
-           when "merge_request"
-             project.merge_requests.find(target_id).mr_and_commit_notes.inc_author.fresh.limit(20)
-           when "snippet"
-             project.snippets.find(target_id).notes.fresh
-           when "wall"
-             # this is the only case, where the order is DESC
-             project.common_notes.order("created_at DESC, id DESC").limit(50)
-           end
-
-  @notes = if after_id
-             @notes.where("id > ?", after_id)
-           elsif before_id
-             @notes.where("id < ?", before_id)
-           else
-             @notes
-           end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/NotesController.html b/doc/code/classes/NotesController.html deleted file mode 100644 index 12cc98fa06f..00000000000 --- a/doc/code/classes/NotesController.html +++ /dev/null @@ -1,338 +0,0 @@ - - - - - NotesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
N
-
- -
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/notes_controller.rb, line 18
-def create
-  @note = Notes::CreateContext.new(project, current_user, params).execute
-
-  respond_to do |format|
-    format.html {redirect_to :back}
-    format.js
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/notes_controller.rb, line 27
-def destroy
-  @note = @project.notes.find(params[:id])
-  return access_denied! unless can?(current_user, :admin_note, @note)
-  @note.destroy
-
-  respond_to do |format|
-    format.js { render nothing: true }
-  end
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/notes_controller.rb, line 8
-def index
-  notes
-  if params[:target_type] == "merge_request"
-    @mixed_targets = true
-    @main_target_type = params[:target_type].camelize
-  end
-
-  respond_with(@notes)
-end
-
-
- -
- -
-
- - preview() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/notes_controller.rb, line 37
-def preview
-  render text: view_context.markdown(params[:note])
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - notes() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/notes_controller.rb, line 43
-def notes
-  @notes = Notes::LoadContext.new(project, current_user, params).execute
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/NotesHelper.html b/doc/code/classes/NotesHelper.html deleted file mode 100644 index 39ff67948c7..00000000000 --- a/doc/code/classes/NotesHelper.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - NotesHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
L
-
- -
- -
N
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
- - - -
- -
- - - - - - -
- - - -
- -
- -
-
- - loading_more_notes?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/notes_helper.rb, line 2
-def loading_more_notes?
-  params[:loading_more].present?
-end
-
-
- -
- -
-
- - loading_new_notes?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/notes_helper.rb, line 6
-def loading_new_notes?
-  params[:loading_new].present?
-end
-
-
- -
- -
-
- - note_for_main_target?(note) - - -
- - -
-

Helps to distinguish e.g. commit notes in mr notes list

-
- - - - - - -
- - -
-
# File app/helpers/notes_helper.rb, line 11
-def note_for_main_target?(note)
-  !@mixed_targets || @main_target_type == note.noteable_type
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Notify.html b/doc/code/classes/Notify.html deleted file mode 100644 index ea7403812a6..00000000000 --- a/doc/code/classes/Notify.html +++ /dev/null @@ -1,639 +0,0 @@ - - - - - Notify - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
I
-
- -
- -
N
-
- -
- -
P
-
- -
- -
R
-
- -
- -
- - - - -
Included Modules
-
    - -
  • - - Resque::Mailer - -
  • - -
- - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 32
-def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id)
-  @issue = Issue.find issue_id
-  @issue_status = status
-  @project = @issue.project
-  @updated_by = User.find updated_by_user_id
-  mail(to: recipient(recipient_id),
-      subject: subject("changed issue ##{@issue.id}", @issue.title))
-end
-
-
- -
- -
-
- - new_issue_email(issue_id) - - -
- - -
-

Issue

-
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 19
-def new_issue_email(issue_id)
-  @issue = Issue.find(issue_id)
-  @project = @issue.project
-  mail(to: @issue.assignee_email, subject: subject("new issue ##{@issue.id}", @issue.title))
-end
-
-
- -
- -
-
- - new_merge_request_email(merge_request_id) - - -
- - -
-

Merge Request

-
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 47
-def new_merge_request_email(merge_request_id)
-  @merge_request = MergeRequest.find(merge_request_id)
-  @project = @merge_request.project
-  mail(to: @merge_request.assignee_email, subject: subject("new merge request !#{@merge_request.id}", @merge_request.title))
-end
-
-
- -
- -
-
- - new_user_email(user_id, password) - - -
- - -
-

User

-
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 118
-def new_user_email(user_id, password)
-  @user = User.find(user_id)
-  @password = password
-  mail(to: @user.email, subject: subject("Account was created for you"))
-end
-
-
- -
- -
-
- - note_commit_email(recipient_id, note_id) - - -
- - -
-

Note

-
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 66
-def note_commit_email(recipient_id, note_id)
-  @note = Note.find(note_id)
-  @commit = @note.noteable
-  @commit = CommitDecorator.decorate(@commit)
-  @project = @note.project
-  mail(to: recipient(recipient_id), subject: subject("note for commit #{@commit.short_id}", @commit.title))
-end
-
-
- -
- -
-
- - note_issue_email(recipient_id, note_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 74
-def note_issue_email(recipient_id, note_id)
-  @note = Note.find(note_id)
-  @issue = @note.noteable
-  @project = @note.project
-  mail(to: recipient(recipient_id), subject: subject("note for issue ##{@issue.id}"))
-end
-
-
- -
- -
-
- - note_merge_request_email(recipient_id, note_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 81
-def note_merge_request_email(recipient_id, note_id)
-  @note = Note.find(note_id)
-  @merge_request = @note.noteable
-  @project = @note.project
-  mail(to: recipient(recipient_id), subject: subject("note for merge request !#{@merge_request.id}"))
-end
-
-
- -
- -
-
- - note_wall_email(recipient_id, note_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 88
-def note_wall_email(recipient_id, note_id)
-  @note = Note.find(note_id)
-  @project = @note.project
-  mail(to: recipient(recipient_id), subject: subject)
-end
-
-
- -
- -
-
- - project_access_granted_email(user_project_id) - - -
- - -
-

Project

-
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 99
-def project_access_granted_email(user_project_id)
-  @users_project = UsersProject.find user_project_id
-  @project = @users_project.project
-  mail(to: @users_project.user.email,
-       subject: subject("access to project was granted"))
-end
-
-
- -
- -
-
- - project_was_moved_email(user_project_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 107
-def project_was_moved_email(user_project_id)
-  @users_project = UsersProject.find user_project_id
-  @project = @users_project.project
-  mail(to: @users_project.user.email,
-       subject: subject("project was moved"))
-end
-
-
- -
- -
-
- - reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 25
-def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
-  @issue = Issue.find(issue_id)
-  @previous_assignee ||= User.find(previous_assignee_id)
-  @project = @issue.project
-  mail(to: recipient(recipient_id), subject: subject("changed issue ##{@issue.id}", @issue.title))
-end
-
-
- -
- -
-
- - reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/mailers/notify.rb, line 53
-def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
-  @merge_request = MergeRequest.find(merge_request_id)
-  @previous_assignee ||= User.find(previous_assignee_id)
-  @project = @merge_request.project
-  mail(to: recipient(recipient_id), subject: subject("changed merge request !#{@merge_request.id}", @merge_request.title))
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Object.html b/doc/code/classes/Object.html deleted file mode 100644 index 5ebc2dcde50..00000000000 --- a/doc/code/classes/Object.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Object - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - -
Included Modules
-
    - -
  • - - Linguist::BlobHelper - -
  • - -
- - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/OmniauthCallbacksController.html b/doc/code/classes/OmniauthCallbacksController.html deleted file mode 100644 index 5f54fc02036..00000000000 --- a/doc/code/classes/OmniauthCallbacksController.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - OmniauthCallbacksController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
F
-
- -
- -
L
-
-
    - - -
  • - ldap -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - failure_message() - - -
- - -
-

Extend the standard message generation to accept our custom exception

-
- - - - - - -
- - -
-
# File app/controllers/omniauth_callbacks_controller.rb, line 9
-def failure_message
-  exception = env["omniauth.error"]
-  error   = exception.error_reason if exception.respond_to?(:error_reason)
-  error ||= exception.error        if exception.respond_to?(:error)
-  error ||= exception.message      if exception.respond_to?(:message)
-  error ||= env["omniauth.error.type"].to_s
-  error.to_s.humanize if error
-end
-
-
- -
- -
-
- - ldap() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/omniauth_callbacks_controller.rb, line 18
-def ldap
-  # We only find ourselves here if the authentication to LDAP was successful.
-  @user = User.find_for_ldap_auth(request.env["omniauth.auth"], current_user)
-  if @user.persisted?
-    @user.remember_me = true
-  end
-  sign_in_and_redirect @user
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/PostReceive.html b/doc/code/classes/PostReceive.html deleted file mode 100644 index d078e65eaf3..00000000000 --- a/doc/code/classes/PostReceive.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - PostReceive - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - perform(repo_path, oldrev, newrev, ref, identifier) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/workers/post_receive.rb, line 4
-def self.perform(repo_path, oldrev, newrev, ref, identifier)
-  repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "")
-  repo_path.gsub!(%r.git$/, "")
-  repo_path.gsub!(%r^\//, "")
-
-  project = Project.find_with_namespace(repo_path)
-  return false if project.nil?
-
-  # Ignore push from non-gitlab users
-  user = if identifier.eql? Gitlab.config.gitolite.admin_key
-    email = project.commit(newrev).author.email rescue nil
-    User.find_by_email(email) if email
-  elsif %r^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
-    User.find_by_email(identifier)
-  else
-    Key.find_by_identifier(identifier).try(:user)
-  end
-  return false unless user
-
-  project.trigger_post_receive(oldrev, newrev, ref, user)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProfileHelper.html b/doc/code/classes/ProfileHelper.html deleted file mode 100644 index edab69523e1..00000000000 --- a/doc/code/classes/ProfileHelper.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - ProfileHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
O
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - oauth_active_class(provider) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/profile_helper.rb, line 2
-def oauth_active_class provider
-  if current_user.provider == provider.to_s
-    'active'
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProfilesController.html b/doc/code/classes/ProfilesController.html deleted file mode 100644 index faf4874ab45..00000000000 --- a/doc/code/classes/ProfilesController.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - - ProfilesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
D
-
- -
- -
H
-
- -
- -
R
-
- -
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - account() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 11
-def account
-end
-
-
- -
- -
-
- - design() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 8
-def design
-end
-
-
- -
- -
-
- - history() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 49
-def history
-  @events = current_user.recent_events.page(params[:page]).per(20)
-end
-
-
- -
- -
-
- - reset_private_token() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 41
-def reset_private_token
-  if current_user.reset_authentication_token!
-    flash[:notice] = "Token was successfully updated"
-  end
-
-  redirect_to account_profile_path
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 5
-def show
-end
-
-
- -
- -
-
- - token() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 27
-def token
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 14
-def update
-  if @user.update_attributes(params[:user])
-    flash[:notice] = "Profile was successfully updated"
-  else
-    flash[:alert] = "Failed to update profile"
-  end
-
-  respond_to do |format|
-    format.html { redirect_to :back }
-    format.js
-  end
-end
-
-
- -
- -
-
- - update_password() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 30
-def update_password
-  params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
-
-  if @user.update_attributes(params[:user])
-    flash[:notice] = "Password was successfully updated. Please login with it"
-    redirect_to new_user_session_path
-  else
-    render 'account'
-  end
-end
-
-
- -
- -
-
- - update_username() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/profiles_controller.rb, line 53
-def update_username
-  @user.update_attributes(username: params[:user][:username])
-
-  respond_to do |format|
-    format.js
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Project.html b/doc/code/classes/Project.html deleted file mode 100644 index 004285485a1..00000000000 --- a/doc/code/classes/Project.html +++ /dev/null @@ -1,1392 +0,0 @@ - - - - - Project - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
F
-
- -
- -
G
-
- -
- -
I
-
- -
- -
L
-
- -
- -
P
-
- -
- -
R
-
- -
- -
S
-
- -
- -
T
-
- -
- -
W
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - -
- [RW] - error_code
- - - - - -
Class Public methods
- -
-
- - access_options() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 163
-def access_options
-  UsersProject.access_roles
-end
-
-
- -
- -
-
- - active() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 96
-def active
-  joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC")
-end
-
-
- -
- -
-
- - authorized_for(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 91
-def authorized_for user
-  projects = includes(:users_projects, :namespace)
-  projects = projects.where("users_projects.user_id = :user_id or projects.owner_id = :user_id or namespaces.owner_id = :user_id", user_id: user.id)
-end
-
-
- -
- -
-
- - create_by_user(params, user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 114
-def create_by_user(params, user)
-  namespace_id = params.delete(:namespace_id)
-
-  project = Project.new params
-
-  Project.transaction do
-
-    # Parametrize path for project
-    #
-    # Ex.
-    #  'GitLab HQ'.parameterize => "gitlab-hq"
-    #
-    project.path = project.name.dup.parameterize
-
-    project.owner = user
-
-    # Apply namespace if user has access to it
-    # else fallback to user namespace
-    if namespace_id != Namespace.global_id
-      project.namespace_id = user.namespace_id
-
-      if namespace_id
-        group = Group.find_by_id(namespace_id)
-        if user.can? :manage_group, group
-          project.namespace_id = namespace_id
-        end
-      end
-    end
-
-    project.save!
-
-    # Add user as project master
-    project.users_projects.create!(project_access: UsersProject::MASTER, user: user)
-
-    # when project saved no team member exist so
-    # project repository should be updated after first user add
-    project.update_repository
-  end
-
-  project
-rescue Gitlab::Gitolite::AccessDenied => ex
-  project.error_code = :gitolite
-  project
-rescue => ex
-  project.error_code = :db
-  project.errors.add(:base, "Can't save project. Please try again later")
-  project
-end
-
-
- -
- -
-
- - find_with_namespace(id) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 104
-def find_with_namespace(id)
-  if id.include?("/")
-    id = id.split("/")
-    namespace_id = Namespace.find_by_path(id.first).id
-    where(namespace_id: namespace_id).find_by_path(id.second)
-  else
-    where(path: id, namespace_id: nil).last
-  end
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 100
-def search query
-  where("projects.name LIKE :query OR projects.path LIKE :query", query: "%#{query}%")
-end
-
-
- -
- -
Instance Public methods
- -
-
- - build_commit_note(commit) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 208
-def build_commit_note(commit)
-  notes.new(commit_id: commit.id, noteable_type: "Commit")
-end
-
-
- -
- -
-
- - check_limit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 176
-def check_limit
-  unless owner.can_create_project?
-    errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it")
-  end
-rescue
-  errors[:base] << ("Can't check your ability to create project")
-end
-
-
- -
- -
-
- - code() - - -
- - -
-

For compatibility with old code

-
- - - - - - -
- - -
-
# File app/models/project.rb, line 253
-def code
-  path
-end
-
-
- -
- -
-
- - commit_line_notes(commit) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 216
-def commit_line_notes(commit)
-  notes.where(commit_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
-end
-
-
- -
- -
-
- - commit_notes(commit) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 212
-def commit_notes(commit)
-  notes.where(commit_id: commit.id, noteable_type: "Commit", line_code: nil)
-end
-
-
- -
- -
-
- - common_notes() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 204
-def common_notes
-  notes.where(noteable_type: ["", nil]).inc_author_project
-end
-
-
- -
- -
-
- - git_error?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 168
-def git_error?
-  error_code == :gitolite
-end
-
-
- -
- -
-
- - gitlab_ci?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 248
-def gitlab_ci?
-  gitlab_ci_service && gitlab_ci_service.active
-end
-
-
- -
- -
-
- - issues_labels() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 240
-def issues_labels
-  issues.tag_counts_on(:labels)
-end
-
-
- -
- -
-
- - items_for(entity) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 257
-def items_for entity
-  case entity
-  when 'issue' then
-    issues
-  when 'merge_request' then
-    merge_requests
-  end
-end
-
-
- -
- -
-
- - last_activity() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 228
-def last_activity
-  last_event
-end
-
-
- -
- -
-
- - last_activity_date() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 232
-def last_activity_date
-  last_event.try(:created_at) || updated_at
-end
-
-
- -
- -
-
- - private?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 224
-def private?
-  private_flag
-end
-
-
- -
- -
-
- - project_id() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 236
-def project_id
-  self.id
-end
-
-
- -
- -
-
- - public?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 220
-def public?
-  !private_flag
-end
-
-
- -
- -
-
- - repo_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 184
-def repo_name
-  denied_paths = %w(gitolite-admin admin dashboard groups help profile projects search)
-
-  if denied_paths.include?(path)
-    errors.add(:path, "like #{path} is not allowed")
-  end
-end
-
-
- -
- -
-
- - saved?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 172
-def saved?
-  id && valid?
-end
-
-
- -
- -
-
- - send_move_instructions() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 266
-def send_move_instructions
-  self.users_projects.each do |member|
-    Notify.project_was_moved_email(member.id).deliver
-  end
-end
-
-
- -
- -
-
- - services() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 244
-def services
-  [gitlab_ci_service].compact
-end
-
-
- -
- -
-
- - to_param() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 192
-def to_param
-  if namespace
-    namespace.path + "/" + path
-  else
-    path
-  end
-end
-
-
- -
- -
-
- - web_url() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/project.rb, line 200
-def web_url
-  [Gitlab.config.gitlab.url, path_with_namespace].join("/")
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Project/TransferError.html b/doc/code/classes/Project/TransferError.html deleted file mode 100644 index 2d0be3a4a13..00000000000 --- a/doc/code/classes/Project/TransferError.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Project::TransferError - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProjectHook.html b/doc/code/classes/ProjectHook.html deleted file mode 100644 index 3fa9c75921b..00000000000 --- a/doc/code/classes/ProjectHook.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - ProjectHook - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: web_hooks

- -
id         :integer          not null, primary key
-url        :string(255)
-project_id :integer
-created_at :datetime         not null
-updated_at :datetime         not null
-type       :string(255)      default("ProjectHook")
-service_id :integer
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProjectObserver.html b/doc/code/classes/ProjectObserver.html deleted file mode 100644 index bf2292a51f4..00000000000 --- a/doc/code/classes/ProjectObserver.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - ProjectObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
L
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/project_observer.rb, line 2
-def after_create(project)
-  project.update_repository
-end
-
-
- -
- -
-
- - after_destroy(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/project_observer.rb, line 10
-def after_destroy(project)
-  log_info("Project \"#{project.name}\" was removed")
-
-  project.destroy_repository
-end
-
-
- -
- -
-
- - after_update(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/project_observer.rb, line 6
-def after_update(project)
-  project.send_move_instructions if project.namespace_id_changed?
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - log_info(message) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/project_observer.rb, line 22
-def log_info message
-  Gitlab::AppLogger.info message
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProjectResourceController.html b/doc/code/classes/ProjectResourceController.html deleted file mode 100644 index 757055abbc1..00000000000 --- a/doc/code/classes/ProjectResourceController.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - ProjectResourceController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProjectUpdateContext.html b/doc/code/classes/ProjectUpdateContext.html deleted file mode 100644 index 3fe3f4d68f8..00000000000 --- a/doc/code/classes/ProjectUpdateContext.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - ProjectUpdateContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute(role = :default) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/project_update_context.rb, line 2
-def execute(role = :default)
-  namespace_id = params[:project].delete(:namespace_id)
-
-  allowed_transfer = can?(current_user, :change_namespace, project) || role == :admin
-
-  if allowed_transfer && namespace_id.present?
-    if namespace_id == Namespace.global_id
-      if project.namespace.present?
-        # Transfer to global namespace from anyone
-        project.transfer(nil)
-      end
-    elsif namespace_id.to_i != project.namespace_id
-      # Transfer to someone namespace
-      namespace = Namespace.find(namespace_id)
-      project.transfer(namespace)
-    end
-  end
-
-  project.update_attributes(params[:project], as: role)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProjectsController.html b/doc/code/classes/ProjectsController.html deleted file mode 100644 index 3cc6dd07a3e..00000000000 --- a/doc/code/classes/ProjectsController.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - - ProjectsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
F
-
- -
- -
G
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
U
-
- -
- -
W
-
-
    - - -
  • - wall -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 20
-def create
-  @project = Project.create_by_user(params[:project], current_user)
-
-  respond_to do |format|
-    flash[:notice] = 'Project was successfully created.' if @project.saved?
-    format.html do
-      if @project.saved?
-        redirect_to @project
-      else
-        render action: "new"
-      end
-    end
-    format.js
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 99
-def destroy
-  return access_denied! unless can?(current_user, :remove_project, project)
-
-  # Delete team first in order to prevent multiple gitolite calls
-  project.truncate_team
-
-  project.destroy
-
-  respond_to do |format|
-    format.html { redirect_to root_path }
-  end
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 17
-def edit
-end
-
-
- -
- -
-
- - files() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 72
-def files
-  @notes = @project.notes.where("attachment != 'NULL'").order("created_at DESC").limit(100)
-end
-
-
- -
- -
-
- - graph() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 89
-def graph
-  respond_to do |format|
-    format.html
-    format.json do
-      graph = Gitlab::Graph::JsonBuilder.new(project)
-      render :json => graph.to_json
-    end
-  end
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 13
-def new
-  @project = Project.new
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 55
-def show
-  limit = (params[:limit] || 20).to_i
-  @events = @project.events.recent.limit(limit).offset(params[:offset] || 0)
-
-  respond_to do |format|
-    format.html do
-      unless @project.empty_repo?
-        @last_push = current_user.recent_push(@project.id)
-        render :show
-      else
-        render "projects/empty"
-      end
-    end
-    format.js
-  end
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 36
-def update
-  status = ProjectUpdateContext.new(project, current_user, params).execute
-
-  respond_to do |format|
-    if status
-      flash[:notice] = 'Project was successfully updated.'
-      format.html { redirect_to edit_project_path(project), notice: 'Project was successfully updated.' }
-      format.js
-    else
-      format.html { render action: "edit" }
-      format.js
-    end
-  end
-
-rescue Project::TransferError => ex
-  @error = ex
-  render :update_failed
-end
-
-
- -
- -
-
- - wall() - - -
- - -
-

Wall

-
- - - - - - -
- - -
-
# File app/controllers/projects_controller.rb, line 80
-def wall
-  return render_404 unless @project.wall_enabled
-  @note = Note.new
-
-  respond_to do |format|
-    format.html
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProjectsHelper.html b/doc/code/classes/ProjectsHelper.html deleted file mode 100644 index a2084279d25..00000000000 --- a/doc/code/classes/ProjectsHelper.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - ProjectsHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
G
-
- -
- -
L
-
- -
- -
P
-
- -
- -
R
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - grouper_project_members(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/projects_helper.rb, line 2
-def grouper_project_members(project)
-  @project.users_projects.sort_by(&:project_access).reverse.group_by(&:project_access)
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - - -
- -
- -
- - - -
- -
- - - - - - -
- - - -
- -
- -
-
- - project_title(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/projects_helper.rb, line 49
-def project_title project
-  if project.group
-    project.name_with_namespace
-  else
-    project.name
-  end
-end
-
-
- -
- -
-
- - remove_from_team_message(project, member) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/projects_helper.rb, line 6
-def remove_from_team_message(project, member)
-  "You are going to remove #{member.user_name} from #{project.name}. Are you sure?"
-end
-
-
- -
- -
-
- - tm_path(team_member) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/projects_helper.rb, line 45
-def tm_path team_member
-  project_team_member_path(@project, team_member)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProtectedBranch.html b/doc/code/classes/ProtectedBranch.html deleted file mode 100644 index c5399ed48ae..00000000000 --- a/doc/code/classes/ProtectedBranch.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - ProtectedBranch - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: protected_branches

- -
id         :integer          not null, primary key
-project_id :integer          not null
-name       :string(255)      not null
-created_at :datetime         not null
-updated_at :datetime         not null
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
U
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - commit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/protected_branch.rb, line 28
-def commit
-  project.commit(self.name)
-end
-
-
- -
- -
-
- - update_repository() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/protected_branch.rb, line 24
-def update_repository
-  git_host.update_repository(project)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ProtectedBranchesController.html b/doc/code/classes/ProtectedBranchesController.html deleted file mode 100644 index f1175852f39..00000000000 --- a/doc/code/classes/ProtectedBranchesController.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - ProtectedBranchesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/protected_branches_controller.rb, line 13
-def create
-  @project.protected_branches.create(params[:protected_branch])
-  redirect_to project_protected_branches_path(@project)
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/protected_branches_controller.rb, line 18
-def destroy
-  @project.protected_branches.find(params[:id]).destroy
-
-  respond_to do |format|
-    format.html { redirect_to project_protected_branches_path }
-    format.js { render nothing: true }
-  end
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/protected_branches_controller.rb, line 8
-def index
-  @branches = @project.protected_branches.all
-  @protected_branch = @project.protected_branches.new
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/PushEvent.html b/doc/code/classes/PushEvent.html deleted file mode 100644 index 8b74ebeea7b..00000000000 --- a/doc/code/classes/PushEvent.html +++ /dev/null @@ -1,959 +0,0 @@ - - - - - PushEvent - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
C
-
- -
- -
L
-
- -
- -
M
-
- -
- -
N
-
- -
- -
P
-
- -
- -
R
-
- -
- -
T
-
- -
- -
V
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - branch?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 12
-def branch?
-  data[:ref]["refs/heads"]
-end
-
-
- -
- -
-
- - branch_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 48
-def branch_name
-  @branch_name ||= data[:ref].gsub("refs/heads/", "")
-end
-
-
- -
- -
-
- - commit_from() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 32
-def commit_from
-  data[:before]
-end
-
-
- -
- -
-
- - commit_to() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 36
-def commit_to
-  data[:after]
-end
-
-
- -
- -
-
- - commits() - - -
- - -
-

Max 20 commits from push DESC

-
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 57
-def commits
-  @commits ||= data[:commits].map { |commit| project.commit(commit[:id]) }.reverse
-end
-
-
- -
- -
-
- - commits_count() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 61
-def commits_count 
-  data[:total_commits_count] || commits.count || 0
-end
-
-
- -
- -
-
- - last_commit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 85
-def last_commit
-  project.commit(commit_to)
-rescue => ex
-  nil
-end
-
-
- -
- -
-
- - last_push_to_non_root?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 97
-def last_push_to_non_root?
-  branch? && project.default_branch != branch_name
-end
-
-
- -
- -
-
- - md_ref?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 28
-def md_ref?
-  !(rm_ref? || new_ref?)
-end
-
-
- -
- -
-
- - new_branch?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 16
-def new_branch?
-  commit_from =~ %r^00000/
-end
-
-
- -
- -
-
- - new_ref?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 20
-def new_ref?
-  commit_from =~ %r^00000/
-end
-
-
- -
- -
-
- - parent_commit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 79
-def parent_commit
-  project.commit(commit_from)
-rescue => ex
-  nil
-end
-
-
- -
- -
-
- - push_action_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 69
-def push_action_name
-  if new_ref?
-    "pushed new"
-  elsif rm_ref?
-    "deleted"
-  else
-    "pushed to"
-  end
-end
-
-
- -
- -
-
- - push_with_commits?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 91
-def push_with_commits? 
-  md_ref? && commits.any? && parent_commit && last_commit
-rescue Grit::NoSuchPathError
-  false
-end
-
-
- -
- -
-
- - ref_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 40
-def ref_name
-  if tag?
-    tag_name
-  else
-    branch_name
-  end
-end
-
-
- -
- -
-
- - ref_type() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 65
-def ref_type
-  tag? ? "tag" : "branch"
-end
-
-
- -
- -
-
- - rm_ref?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 24
-def rm_ref?
-  commit_to =~ %r^00000/
-end
-
-
- -
- -
-
- - tag?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 8
-def tag?
-  data[:ref]["refs/tags"]
-end
-
-
- -
- -
-
- - tag_name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 52
-def tag_name
-  @tag_name ||= data[:ref].gsub("refs/tags/", "")
-end
-
-
- -
- -
-
- - valid_push?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_event.rb, line 2
-def valid_push?
-  data[:ref]
-rescue => ex
-  false
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/PushObserver.html b/doc/code/classes/PushObserver.html deleted file mode 100644 index f747fb4a958..00000000000 --- a/doc/code/classes/PushObserver.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - - PushObserver - - - - - - - - - - - - - -
-
- -
- -

Includes methods for handling Git Push events

- -

Triggered by PostReceive job

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
O
-
- -
- -
P
-
- -
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute_hooks(data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 52
-def execute_hooks(data)
-  hooks.each { |hook| hook.execute(data) }
-end
-
-
- -
- -
-
- - execute_services(data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 56
-def execute_services(data)
-  services.each do |service|
-
-    # Call service hook only if it is active
-    service.execute(data) if service.active
-  end
-end
-
-
- -
- -
-
- - observe_push(data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 43
-def observe_push(data)
-  Event.create(
-    project: self,
-    action: Event::Pushed,
-    data: data,
-    author_id: data[:user_id]
-  )
-end
-
-
- -
- -
-
- - post_receive_data(oldrev, newrev, ref, user) - - -
- - -
-

Produce a hash of post-receive data

- -

data = {

- -
before: String,
-after: String,
-ref: String,
-user_id: String,
-user_name: String,
-repository: {
-  name: String,
-  url: String,
-  description: String,
-  homepage: String,
-},
-commits: Array,
-total_commits_count: Fixnum
- -

}

-
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 82
-def post_receive_data(oldrev, newrev, ref, user)
-
-  push_commits = commits_between(oldrev, newrev)
-
-  # Total commits count
-  push_commits_count = push_commits.size
-
-  # Get latest 20 commits ASC
-  push_commits_limited = push_commits.last(20)
-
-  # Hash to be passed as post_receive_data
-  data = {
-    before: oldrev,
-    after: newrev,
-    ref: ref,
-    user_id: user.id,
-    user_name: user.name,
-    repository: {
-      name: name,
-      url: url_to_repo,
-      description: description,
-      homepage: web_url,
-    },
-    commits: [],
-    total_commits_count: push_commits_count
-  }
-
-  # For perfomance purposes maximum 20 latest commits
-  # will be passed as post receive hook data.
-  #
-  push_commits_limited.each do |commit|
-    data[:commits] << {
-      id: commit.id,
-      message: commit.safe_message,
-      timestamp: commit.date.xmlschema,
-      url: "#{Gitlab.config.gitlab.url}/#{path_with_namespace}/commit/#{commit.id}",
-      author: {
-        name: commit.author_name,
-        email: commit.author_email
-      }
-    }
-  end
-
-  data
-end
-
-
- -
- -
-
- - push_to_branch?(ref, oldrev) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 36
-def push_to_branch? ref, oldrev
-  ref_parts = ref.split('/')
-
-  # Return if this is not a push to a branch (e.g. new commits)
-  !(ref_parts[1] !~ %rheads/ || oldrev == "00000000000000000000000000000000")
-end
-
-
- -
- -
-
- - trigger_post_receive(oldrev, newrev, ref, user) - - -
- - -
-

This method will be called after each post receive and only if the provided -user is present in GitLab.

- -

All callbacks for post receive should be placed here.

-
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 9
-def trigger_post_receive(oldrev, newrev, ref, user)
-  data = post_receive_data(oldrev, newrev, ref, user)
-
-  # Create push event
-  self.observe_push(data)
-
-  if push_to_branch? ref, oldrev
-    # Close merged MR
-    self.update_merge_requests(oldrev, newrev, ref, user)
-
-    # Execute web hooks
-    self.execute_hooks(data.dup)
-
-    # Execute project services
-    self.execute_services(data.dup)
-  end
-
-  # Create satellite
-  self.satellite.create unless self.satellite.exists?
-
-  # Discover the default branch, but only if it hasn't already been set to
-  # something else
-  if default_branch.nil?
-    update_attributes(default_branch: discover_default_branch)
-  end
-end
-
-
- -
- -
-
- - update_merge_requests(oldrev, newrev, ref, user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/push_observer.rb, line 128
-def update_merge_requests(oldrev, newrev, ref, user)
-  return true unless ref =~ %rheads/
-  branch_name = ref.gsub("refs/heads/", "")
-  c_ids = self.commits_between(oldrev, newrev).map(&:id)
-
-  # Update code for merge requests
-  mrs = self.merge_requests.opened.find_all_by_branch(branch_name).all
-  mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked }
-
-  # Close merge requests
-  mrs = self.merge_requests.opened.where(target_branch: branch_name).all
-  mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) }
-  mrs.each { |merge_request| merge_request.merge!(user.id) }
-
-  true
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Redcarpet.html b/doc/code/classes/Redcarpet.html deleted file mode 100644 index e1b53d96fea..00000000000 --- a/doc/code/classes/Redcarpet.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Redcarpet - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Redcarpet/Render.html b/doc/code/classes/Redcarpet/Render.html deleted file mode 100644 index 29a763942b5..00000000000 --- a/doc/code/classes/Redcarpet/Render.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Redcarpet::Render - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
Namespace
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Redcarpet/Render/GitlabHTML.html b/doc/code/classes/Redcarpet/Render/GitlabHTML.html deleted file mode 100644 index 664207dd196..00000000000 --- a/doc/code/classes/Redcarpet/Render/GitlabHTML.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - Redcarpet::Render::GitlabHTML - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - -
- [R] - h
- [R] - template
- - - - - -
Class Public methods
- -
-
- - new(template, options = {}) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/redcarpet/render/gitlab_html.rb, line 6
-def initialize(template, options = {})
-  @template = template
-  @project = @template.instance_variable_get("@project")
-  super options
-end
-
-
- -
- -
Instance Public methods
- -
-
- - block_code(code, language) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/redcarpet/render/gitlab_html.rb, line 12
-  def block_code(code, language)
-    options = { options: {encoding: 'utf-8'} }
-    options.merge!(lexer: language.downcase) if Pygments::Lexer.find(language)
-
-    # New lines are placed to fix an rendering issue
-    # with code wrapped inside <h1> tag for next case:
-    #
-    # # Title kinda h1
-    #
-    #     ruby code here
-    #
-    "
-       <div class="#{h.user_color_scheme_class}">#{Pygments.highlight(code, options)}</div>
-
-"
-  end
-
-
- -
- -
-
- - postprocess(full_document) - - -
- - -
- -
- - - - - - -
- - -
-
# File lib/redcarpet/render/gitlab_html.rb, line 30
-def postprocess(full_document)
-  h.gfm(full_document)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/RefsController.html b/doc/code/classes/RefsController.html deleted file mode 100644 index 971b8fcb9a3..00000000000 --- a/doc/code/classes/RefsController.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - - RefsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
L
-
- -
- -
R
-
-
    - - -
  • - ref -
  • - -
-
- -
S
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - logs_tree() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/refs_controller.rb, line 30
-def logs_tree
-  contents = @tree.contents
-  @logs = contents.map do |content|
-    file = params[:path] ? File.join(params[:path], content.name) : content.name
-    last_commit = @project.commits(@commit.id, file, 1).last
-    last_commit = CommitDecorator.decorate(last_commit)
-    {
-      file_name: content.name,
-      commit: last_commit
-    }
-  end
-end
-
-
- -
- -
-
- - switch() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/refs_controller.rb, line 11
-def switch
-  respond_to do |format|
-    format.html do
-      new_path = if params[:destination] == "tree"
-                   project_tree_path(@project, @ref)
-                 else
-                   project_commits_path(@project, @ref)
-                 end
-
-      redirect_to new_path
-    end
-    format.js do
-      @ref = params[:ref]
-      define_tree_vars
-      render "tree"
-    end
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - define_tree_vars() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/refs_controller.rb, line 45
-def define_tree_vars
-  params[:path] = nil if params[:path].blank?
-
-  @repo = project.repo
-  @commit = project.commit(@ref)
-  @commit = CommitDecorator.decorate(@commit)
-  @tree = Tree.new(@commit.tree, project, @ref, params[:path])
-  @tree = TreeDecorator.new(@tree)
-  @hex_path = Digest::SHA1.hexdigest(params[:path] || "")
-
-  if params[:path]
-    @logs_path = logs_file_project_ref_path(@project, @ref, params[:path])
-  else
-    @logs_path = logs_tree_project_ref_path(@project, @ref)
-  end
-rescue
-  return render_404
-end
-
-
- -
- -
-
- - ref() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/refs_controller.rb, line 64
-def ref
-  @ref = params[:id] || params[:ref]
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/RepositoriesController.html b/doc/code/classes/RepositoriesController.html deleted file mode 100644 index cd661646d44..00000000000 --- a/doc/code/classes/RepositoriesController.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - RepositoriesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
S
-
- -
- -
T
-
-
    - - -
  • - tags -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - archive() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/repositories_controller.rb, line 24
-def archive
-  unless can?(current_user, :download_code, @project)
-    render_404 and return
-  end
-
-
-  file_path = @project.archive_repo(params[:ref])
-
-  if file_path
-    # Send file to user
-    send_file file_path
-  else
-    render_404
-  end
-end
-
-
- -
- -
-
- - branches() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/repositories_controller.rb, line 11
-def branches
-  @branches = @project.branches
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/repositories_controller.rb, line 7
-def show
-  @activities = @project.commits_with_refs(20)
-end
-
-
- -
- -
-
- - stats() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/repositories_controller.rb, line 19
-def stats
-  @stats = Gitlab::GitStats.new(@project.repo, @project.root_ref)
-  @graph = @stats.graph
-end
-
-
- -
- -
-
- - tags() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/repositories_controller.rb, line 15
-def tags
-  @tags = @project.tags
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Repository.html b/doc/code/classes/Repository.html deleted file mode 100644 index a6266790d88..00000000000 --- a/doc/code/classes/Repository.html +++ /dev/null @@ -1,1737 +0,0 @@ - - - - - Repository - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
C
-
- -
- -
D
-
- -
- -
E
-
- -
- -
F
-
- -
- -
H
-
- -
- -
L
-
- -
- -
N
-
- -
- -
O
-
- -
- -
P
-
- -
- -
R
-
- -
- -
S
-
- -
- -
T
-
- -
- -
U
-
- -
- -
V
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - archive_repo(ref) - - -
- - -
-

Archive Project to .tar.gz

- -

Already packed repo archives stored at -app_root/tmp/repositories/project_name/project_name-commit-id.tag.gz

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 175
-def archive_repo(ref)
-  ref = ref || self.root_ref
-  commit = self.commit(ref)
-  return nil unless commit
-
-  # Build file path
-  file_name = self.path + "-" + commit.id.to_s + ".tar.gz"
-  storage_path = Rails.root.join("tmp", "repositories", self.path_with_namespace)
-  file_path = File.join(storage_path, file_name)
-
-  # Put files into a directory before archiving
-  prefix = self.path + "/"
-
-  # Create file if not exists
-  unless File.exists?(file_path)
-    FileUtils.mkdir_p storage_path
-    file = self.repo.archive_to_file(ref, prefix,  file_path)
-  end
-
-  file_path
-end
-
-
- -
- -
-
- - branch_names() - - -
- - -
-

Returns an Array of branch names

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 67
-def branch_names
-  repo.branches.collect(&:name).sort
-end
-
-
- -
- -
-
- - branches() - - -
- - -
-

Returns an Array of Branches

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 72
-def branches
-  repo.branches.sort_by(&:name)
-end
-
-
- -
- -
-
- - commit(commit_id = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 15
-def commit(commit_id = nil)
-  Commit.find_or_first(repo, commit_id, root_ref)
-end
-
-
- -
- -
-
- - commits(ref, path = nil, limit = nil, offset = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 31
-def commits(ref, path = nil, limit = nil, offset = nil)
-  Commit.commits(repo, ref, path, limit, offset)
-end
-
-
- -
- -
-
- - commits_between(from, to) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 39
-def commits_between(from, to)
-  Commit.commits_between(repo, from, to)
-end
-
-
- -
- -
-
- - commits_since(date) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 27
-def commits_since(date)
-  Commit.commits_since(repo, date)
-end
-
-
- -
- -
-
- - commits_with_refs(n = 20) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 23
-def commits_with_refs(n = 20)
-  Commit.commits_with_refs(repo, n)
-end
-
-
- -
- -
-
- - destroy_repository() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 111
-def destroy_repository
-  git_host.remove_repository(self)
-end
-
-
- -
- -
-
- - discover_default_branch() - - -
- - -
-

Discovers the default branch based on the repository’s available branches

-
  • -

    If no branches are present, returns nil

    -
  • -

    If one branch is present, returns its name

    -
  • -

    If two or more branches are present, returns the one that has a name -matching #root_ref -(default_branch or ‘master’ if default_branch is nil)

    -
-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 146
-def discover_default_branch
-  if branch_names.length == 0
-    nil
-  elsif branch_names.length == 1
-    branch_names.first
-  else
-    branch_names.select { |v| v == root_ref }.first
-  end
-end
-
-
- -
- -
-
- - empty_repo?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 11
-def empty_repo?
-  !repo_exists? || !has_commits?
-end
-
-
- -
- -
-
- - fresh_commits(n = 10) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 19
-def fresh_commits(n = 10)
-  Commit.fresh_commits(repo, n)
-end
-
-
- -
- -
-
- - has_commits?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 156
-def has_commits?
-  !!commit
-rescue Grit::NoSuchPathError
-  false
-end
-
-
- -
- -
-
- - has_post_receive_file?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 47
-def has_post_receive_file?
-  !!hook_file
-end
-
-
- -
- -
-
- - heads() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 121
-def heads
-  @heads ||= repo.heads
-end
-
-
- -
- -
-
- - hook_file() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 59
-def hook_file
-  @hook_file ||= begin
-                   hook_path = File.join(path_to_repo, 'hooks', 'post-receive')
-                   File.read(hook_path) if File.exists?(hook_path)
-                 end
-end
-
-
- -
- -
-
- - http_url_to_repo() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 201
-def http_url_to_repo
-  http_url = [Gitlab.config.gitlab.url, "/", path_with_namespace, ".git"].join('')
-end
-
-
- -
- -
-
- - last_commit_for(ref, path = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 35
-def last_commit_for(ref, path = nil)
-  commits(ref, path, 1).first
-end
-
-
- -
- -
-
- - namespace_dir() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 103
-def namespace_dir
-  namespace.try(:path) || ''
-end
-
-
- -
- -
-
- - open_branches() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 131
-def open_branches
-  if protected_branches.empty?
-    self.repo.heads
-  else
-    pnames = protected_branches.map(&:name)
-    self.repo.heads.reject { |h| pnames.include?(h.name) }
-  end.sort_by(&:name)
-end
-
-
- -
- -
-
- - path_to_repo() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 99
-def path_to_repo
-  File.join(Gitlab.config.gitolite.repos_path, "#{path_with_namespace}.git")
-end
-
-
- -
- -
-
- - protected_branch?(branch_name) - - -
- - -
-

Check if current branch name is marked as protected in the system

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 206
-def protected_branch? branch_name
-  protected_branches.map(&:name).include?(branch_name)
-end
-
-
- -
- -
-
- - ref_names() - - -
- - -
-

Returns an Array of branch and tag names

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 87
-def ref_names
-  [branch_names + tag_names].flatten
-end
-
-
- -
- -
-
- - repo() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 91
-def repo
-  @repo ||= Grit::Repo.new(path_to_repo)
-end
-
-
- -
- -
-
- - repo_exists?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 115
-def repo_exists?
-  @repo_exists ||= (repo && !repo.branches.empty?)
-rescue
-  @repo_exists = false
-end
-
-
- -
- -
-
- - root_ref() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 162
-def root_ref
-  default_branch || "master"
-end
-
-
- -
- -
-
- - root_ref?(branch) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 166
-def root_ref?(branch)
-  root_ref == branch
-end
-
-
- -
- -
-
- - satellite() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 43
-def satellite
-  @satellite ||= Gitlab::Satellite::Satellite.new(self)
-end
-
-
- -
- -
-
- - ssh_url_to_repo() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 197
-def ssh_url_to_repo
-  url_to_repo
-end
-
-
- -
- -
-
- - tag_names() - - -
- - -
-

Returns an Array of tag names

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 77
-def tag_names
-  repo.tags.collect(&:name).sort.reverse
-end
-
-
- -
- -
-
- - tags() - - -
- - -
-

Returns an Array of Tags

-
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 82
-def tags
-  repo.tags.sort_by(&:name).reverse
-end
-
-
- -
- -
-
- - tree(fcommit, path = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 125
-def tree(fcommit, path = nil)
-  fcommit = commit if fcommit == :head
-  tree = fcommit.tree
-  path ? (tree / path) : tree
-end
-
-
- -
- -
-
- - update_repository() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 107
-def update_repository
-  git_host.update_repository(self)
-end
-
-
- -
- -
-
- - url_to_repo() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 95
-def url_to_repo
-  git_host.url_to_repo(path_with_namespace)
-end
-
-
- -
- -
-
- - valid_hook_file() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 55
-def valid_hook_file
-  @valid_hook_file ||= File.read(Rails.root.join('lib', 'hooks', 'post-receive'))
-end
-
-
- -
- -
-
- - valid_post_receive_file?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 51
-def valid_post_receive_file?
-  valid_hook_file == hook_file
-end
-
-
- -
- -
-
- - valid_repo?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/repository.rb, line 4
-def valid_repo?
-  repo
-rescue
-  errors.add(:path, "Invalid repository path")
-  false
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ResqueAuthentication.html b/doc/code/classes/ResqueAuthentication.html deleted file mode 100644 index ec3fc9e470f..00000000000 --- a/doc/code/classes/ResqueAuthentication.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - ResqueAuthentication - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
-
    - - -
  • - call -
  • - -
-
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - new(app) - - -
- - -
- -
- - - - - - -
- - -
-
# File config/initializers/4_resque.rb, line 14
-def initialize(app)
-  @app = app
-end
-
-
- -
- -
Instance Public methods
- -
-
- - call(env) - - -
- - -
- -
- - - - - - -
- - -
-
# File config/initializers/4_resque.rb, line 18
-def call(env)
-  account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user)
-  raise "Access denied" if !account.admin?
-  @app.call(env)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SearchContext.html b/doc/code/classes/SearchContext.html deleted file mode 100644 index b8ecb2e716d..00000000000 --- a/doc/code/classes/SearchContext.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - SearchContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
R
-
- -
- -
- - - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - -
- [RW] - params
- [RW] - project_ids
- - - - - -
Class Public methods
- -
-
- - new(project_ids, params) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/search_context.rb, line 4
-def initialize(project_ids, params)
-  @project_ids, @params = project_ids, params.dup
-end
-
-
- -
- -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/search_context.rb, line 8
-def execute
-  query = params[:search]
-
-  return result unless query.present?
-
-  result[:projects] = Project.where(id: project_ids).search(query).limit(10)
-  result[:merge_requests] = MergeRequest.where(project_id: project_ids).search(query).limit(10)
-  result[:issues] = Issue.where(project_id: project_ids).search(query).limit(10)
-  result[:wiki_pages] = Wiki.where(project_id: project_ids).search(query).limit(10)
-  result
-end
-
-
- -
- -
-
- - result() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/search_context.rb, line 20
-def result
-  @result ||= {
-    projects: [],
-    merge_requests: [],
-    issues: [],
-    wiki_pages: []
-  }
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SearchController.html b/doc/code/classes/SearchController.html deleted file mode 100644 index 5f26c934c5a..00000000000 --- a/doc/code/classes/SearchController.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - SearchController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/search_controller.rb, line 2
-def show
-  result = SearchContext.new(current_user.project_ids, params).execute
-
-  @projects       = result[:projects]
-  @merge_requests = result[:merge_requests]
-  @issues         = result[:issues]
-  @wiki_pages     = result[:wiki_pages]
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Service.html b/doc/code/classes/Service.html deleted file mode 100644 index f4973cb37f6..00000000000 --- a/doc/code/classes/Service.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Service - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: services

- -
id          :integer          not null, primary key
-type        :string(255)
-title       :string(255)
-token       :string(255)
-project_id  :integer          not null
-created_at  :datetime         not null
-updated_at  :datetime         not null
-active      :boolean          default(FALSE), not null
-project_url :string(255)
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ServiceHook.html b/doc/code/classes/ServiceHook.html deleted file mode 100644 index faff9256de2..00000000000 --- a/doc/code/classes/ServiceHook.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - ServiceHook - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: web_hooks

- -
id         :integer          not null, primary key
-url        :string(255)
-project_id :integer
-created_at :datetime         not null
-updated_at :datetime         not null
-type       :string(255)      default("ProjectHook")
-service_id :integer
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - \ No newline at end of file diff --git a/doc/code/classes/ServicesController.html b/doc/code/classes/ServicesController.html deleted file mode 100644 index c0165b096d7..00000000000 --- a/doc/code/classes/ServicesController.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - ServicesController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
T
-
-
    - - -
  • - test -
  • - -
-
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/services_controller.rb, line 11
-def edit
-  @service = @project.gitlab_ci_service
-
-  # Create if missing
-  @service = @project.create_gitlab_ci_service unless @service
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/services_controller.rb, line 7
-def index
-  @gitlab_ci_service = @project.gitlab_ci_service
-end
-
-
- -
- -
-
- - test() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/services_controller.rb, line 28
-def test
-  commits = project.commits(project.default_branch, nil, 3)
-  data = project.post_receive_data(commits.last.id, commits.first.id, "refs/heads/#{project.default_branch}", current_user)
-
-  @service = project.gitlab_ci_service
-  @service.execute(data)
-
-  redirect_to :back
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/services_controller.rb, line 18
-def update
-  @service = @project.gitlab_ci_service
-
-  if @service.update_attributes(params[:service])
-    redirect_to edit_project_service_path(@project, :gitlab_ci)
-  else
-    render 'edit'
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Settings.html b/doc/code/classes/Settings.html deleted file mode 100644 index 05219228dbe..00000000000 --- a/doc/code/classes/Settings.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Settings - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
G
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - gitlab_on_non_standard_port?() - - -
- - -
- -
- - - - - - -
- - -
-
# File config/initializers/1_settings.rb, line 5
-def gitlab_on_non_standard_port?
-  ![443, 80].include?(gitlab.port.to_i)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Snippet.html b/doc/code/classes/Snippet.html deleted file mode 100644 index a71f13165fc..00000000000 --- a/doc/code/classes/Snippet.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - - Snippet - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: snippets

- -
id         :integer          not null, primary key
-title      :string(255)
-content    :text
-author_id  :integer          not null
-project_id :integer          not null
-created_at :datetime         not null
-updated_at :datetime         not null
-file_name  :string(255)
-expires_at :datetime
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
-
    - - -
  • - data -
  • - -
-
- -
E
-
- -
- -
M
-
-
    - - -
  • - mode -
  • - -
-
- -
N
-
-
    - - -
  • - name -
  • - -
-
- -
S
-
-
    - - -
  • - size -
  • - -
-
- -
- - - - -
Included Modules
-
    - -
  • - - Linguist::BlobHelper - -
  • - -
- - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - content_types() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/snippet.rb, line 38
-def self.content_types
-  [
-    ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
-    ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
-    ".js", ".sh", ".coffee", ".yml", ".md"
-  ]
-end
-
-
- -
- -
Instance Public methods
- -
-
- - data() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/snippet.rb, line 46
-def data
-  content
-end
-
-
- -
- -
-
- - expired?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/snippet.rb, line 62
-def expired?
-  expires_at && expires_at < Time.current
-end
-
-
- -
- -
-
- - mode() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/snippet.rb, line 58
-def mode
-  nil
-end
-
-
- -
- -
-
- - name() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/snippet.rb, line 54
-def name
-  file_name
-end
-
-
- -
- -
-
- - size() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/snippet.rb, line 50
-def size
-  0
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SnippetsController.html b/doc/code/classes/SnippetsController.html deleted file mode 100644 index fd7e0fe6d19..00000000000 --- a/doc/code/classes/SnippetsController.html +++ /dev/null @@ -1,611 +0,0 @@ - - - - - SnippetsController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
R
-
-
    - - -
  • - raw -
  • - -
-
- -
S
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 26
-def create
-  @snippet = @project.snippets.new(params[:snippet])
-  @snippet.author = current_user
-  @snippet.save
-
-  if @snippet.valid?
-    redirect_to [@project, @snippet]
-  else
-    respond_with(@snippet)
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 55
-def destroy
-  return access_denied! unless can?(current_user, :admin_snippet, @snippet)
-
-  @snippet.destroy
-
-  redirect_to project_snippets_path(@project)
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 38
-def edit
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 18
-def index
-  @snippets = @project.snippets.fresh
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 22
-def new
-  @snippet = @project.snippets.new
-end
-
-
- -
- -
-
- - raw() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 63
-def raw
-  send_data(
-    @snippet.content,
-    type: "text/plain",
-    disposition: 'inline',
-    filename: @snippet.file_name
-  )
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 51
-def show
-  @note = @project.notes.new(noteable: @snippet)
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 41
-def update
-  @snippet.update_attributes(params[:snippet])
-
-  if @snippet.valid?
-    redirect_to [@project, @snippet]
-  else
-    respond_with(@snippet)
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - authorize_admin_snippet!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 82
-def authorize_admin_snippet!
-  return render_404 unless can?(current_user, :admin_snippet, @snippet)
-end
-
-
- -
- -
-
- - authorize_modify_snippet!() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 78
-def authorize_modify_snippet!
-  return render_404 unless can?(current_user, :modify_snippet, @snippet)
-end
-
-
- -
- -
-
- - snippet() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/snippets_controller.rb, line 74
-def snippet
-  @snippet ||= @project.snippets.find(params[:id])
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SnippetsHelper.html b/doc/code/classes/SnippetsHelper.html deleted file mode 100644 index 4230a0cce79..00000000000 --- a/doc/code/classes/SnippetsHelper.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - SnippetsHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
L
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - lifetime_select_options() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/snippets_helper.rb, line 2
-def lifetime_select_options
-  options = [
-      ['forever', nil],
-      ['1 day',   "#{Date.current + 1.day}"],
-      ['1 week',  "#{Date.current + 1.week}"],
-      ['1 month', "#{Date.current + 1.month}"]
-  ]
-  options_for_select(options)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/StaticModel.html b/doc/code/classes/StaticModel.html deleted file mode 100644 index 46ead77607d..00000000000 --- a/doc/code/classes/StaticModel.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - - StaticModel - - - - - - - - - - - - - -
-
- -
- -

Provides an ActiveRecord-like interface to a model whose data is not -persisted to a database.

- -
- - - - - - - - - - - - -
Namespace
- - - - - - -
Methods
-
- -
#
-
-
    - - -
  • - ==, -
  • - - -
  • - [] -
  • - -
-
- -
D
-
- -
- -
N
-
- -
- -
P
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - ==(other) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 40
-def ==(other)
-  if other.is_a? StaticModel
-    id == other.id
-  else
-    super
-  end
-end
-
-
- -
- -
-
- - [](key) - - -
- - -
-

Used by AR for fetching attributes

- -

Pass it along if we respond to it.

-
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 20
-def [](key)
-  send(key) if respond_to?(key)
-end
-
-
- -
- -
-
- - destroyed?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 36
-def destroyed?
-  false
-end
-
-
- -
- -
-
- - new_record?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 28
-def new_record?
-  false
-end
-
-
- -
- -
-
- - persisted?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 32
-def persisted?
-  false
-end
-
-
- -
- -
-
- - to_param() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 24
-def to_param
-  id
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/StaticModel/ClassMethods.html b/doc/code/classes/StaticModel/ClassMethods.html deleted file mode 100644 index 38508f6d91f..00000000000 --- a/doc/code/classes/StaticModel/ClassMethods.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - StaticModel::ClassMethods - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - base_class() - - -
- - -
-

Used by ActiveRecord’s polymorphic association to set object_type

-
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 12
-def base_class
-  self
-end
-
-
- -
- -
-
- - primary_key() - - -
- - -
-

Used by ActiveRecord’s polymorphic association to set object_id

-
- - - - - - -
- - -
-
# File app/roles/static_model.rb, line 7
-def primary_key
-  'id'
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SystemHook.html b/doc/code/classes/SystemHook.html deleted file mode 100644 index 4f1ce71fbba..00000000000 --- a/doc/code/classes/SystemHook.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - SystemHook - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: web_hooks

- -
id         :integer          not null, primary key
-url        :string(255)
-project_id :integer
-created_at :datetime         not null
-updated_at :datetime         not null
-type       :string(255)      default("ProjectHook")
-service_id :integer
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - all_hooks_fire(data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/system_hook.rb, line 15
-def self.all_hooks_fire(data)
-  SystemHook.all.each do |sh|
-    sh.async_execute data
-  end
-end
-
-
- -
- -
Instance Public methods
- -
-
- - async_execute(data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/system_hook.rb, line 21
-def async_execute(data)
-  Resque.enqueue(SystemHookWorker, id, data)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SystemHookObserver.html b/doc/code/classes/SystemHookObserver.html deleted file mode 100644 index 24609a5c916..00000000000 --- a/doc/code/classes/SystemHookObserver.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - SystemHookObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(model) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/system_hook_observer.rb, line 4
-def after_create(model)
-  if model.kind_of? Project
-    SystemHook.all_hooks_fire({
-      event_name: "project_create",
-      name: model.name,
-      path: model.path,
-      project_id: model.id,
-      owner_name: model.owner.name,
-      owner_email: model.owner.email,
-      created_at: model.created_at
-    })
-  elsif model.kind_of? User 
-    SystemHook.all_hooks_fire({
-      event_name: "user_create",
-      name: model.name,
-      email: model.email,
-      created_at: model.created_at
-    })
-
-  elsif model.kind_of? UsersProject
-    SystemHook.all_hooks_fire({
-      event_name: "user_add_to_team",
-      project_name: model.project.name,
-      project_path: model.project.path,
-      project_id: model.project_id,
-      user_name: model.user.name,
-      user_email: model.user.email,
-      project_access: model.repo_access_human,
-      created_at: model.created_at
-    })
-
-  end
-end
-
-
- -
- -
-
- - after_destroy(model) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/system_hook_observer.rb, line 38
-def after_destroy(model)
-  if model.kind_of? Project
-    SystemHook.all_hooks_fire({
-      event_name: "project_destroy",
-      name: model.name,
-      path: model.path,
-      project_id: model.id,
-      owner_name: model.owner.name,
-      owner_email: model.owner.email,
-    })
-  elsif model.kind_of? User
-    SystemHook.all_hooks_fire({
-      event_name: "user_destroy",
-      name: model.name,
-      email: model.email
-    })
-
-  elsif model.kind_of? UsersProject
-    SystemHook.all_hooks_fire({
-      event_name: "user_remove_from_team",
-      project_name: model.project.name,
-      project_path: model.project.path,
-      project_id: model.project_id,
-      user_name: model.user.name,
-      user_email: model.user.email,
-      project_access: model.repo_access_human
-    })
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/SystemHookWorker.html b/doc/code/classes/SystemHookWorker.html deleted file mode 100644 index 9c114ba6261..00000000000 --- a/doc/code/classes/SystemHookWorker.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - SystemHookWorker - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
-
- - perform(hook_id, data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/workers/system_hook_worker.rb, line 4
-def self.perform(hook_id, data)
-  SystemHook.find(hook_id).execute data
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TabHelper.html b/doc/code/classes/TabHelper.html deleted file mode 100644 index c7b4c7908ab..00000000000 --- a/doc/code/classes/TabHelper.html +++ /dev/null @@ -1,346 +0,0 @@ - - - - - TabHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
N
-
- -
- -
P
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - branches_tab_class() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tab_helper.rb, line 80
-def branches_tab_class
-  if current_page?(branches_project_repository_path(@project)) ||
-    current_controller?(:protected_branches) ||
-    current_page?(project_repository_path(@project))
-    'active'
-  end
-end
-
-
- -
- -
- - - -
-

Navigation link helper

- -

Returns an `li` element with an ‘active’ class if the supplied -controller(s) and/or action(s) are currently active. The content of the -element is the value passed to the block.

- -

options - The options hash used to determine if the element is “active” -(default: {})

- -
:controller   - One or more controller names to check (optional).
-:action       - One or more action names to check (optional).
-:path         - A shorthand path, such as 'dashboard#index', to check (optional).
-:html_options - Extra options to be passed to the list element (optional).
- -

block - An optional block that will become the contents of the returned

- -
`li` element.
- -

When both :controller and :action are specified, BOTH must match in order -to be marked as active. When only one is given, either can match.

- -

Examples

- -
# Assuming we're on TreeController#show
-
-# Controller matches, but action doesn't
-nav_link(controller: [:tree, :refs], action: :edit) { "Hello" }
-# => '<li>Hello</li>'
-
-# Controller matches
-nav_link(controller: [:tree, :refs]) { "Hello" }
-# => '<li class="active">Hello</li>'
-
-# Shorthand path
-nav_link(path: 'tree#show') { "Hello" }
-# => '<li class="active">Hello</li>'
-
-# Supplying custom options for the list element
-nav_link(controller: :tree, html_options: {class: 'home'}) { "Hello" }
-# => '<li class="home active">Hello</li>'
-
- -

Returns a list item element String

-
- - - - - - -
- - - -
- -
- -
-
- - nav_tab(key, value, &block) - - -
- - -
-

Use #nav_tab for save -controller/action but different params

-
- - - - - - -
- - -
-
# File app/helpers/tab_helper.rb, line 89
-def nav_tab key, value, &block
-  o = {}
-  o[:class] = ""
-  o[:class] << " active" if params[key] == value
-
-  if block_given?
-    content_tag(:li, capture(&block), o)
-  else
-    content_tag(:li, nil, o)
-  end
-end
-
-
- -
- -
-
- - project_tab_class() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tab_helper.rb, line 70
-def project_tab_class
-  [:show, :files, :edit, :update].each do |action|
-    return "active" if current_page?(controller: "projects", action: action, id: @project)
-  end
-
-  if ['snippets', 'services', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
-   "active"
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TagsHelper.html b/doc/code/classes/TagsHelper.html deleted file mode 100644 index cf30b011b4a..00000000000 --- a/doc/code/classes/TagsHelper.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - TagsHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - tag_list(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tags_helper.rb, line 6
-def tag_list project
-  html = ''
-  project.tag_list.each do |tag|
-    html += link_to tag, tag_path(tag)
-  end
-
-  html.html_safe
-end
-
-
- -
- -
-
- - tag_path(tag) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tags_helper.rb, line 2
-def tag_path tag
-  "/tags/#{tag}"
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Team.html b/doc/code/classes/Team.html deleted file mode 100644 index 08d2c07e3c6..00000000000 --- a/doc/code/classes/Team.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - Team - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
D
-
- -
- -
T
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - add_user_id_to_team(user_id, access_role) - - -
- - -
-

Add user to project with passed access role by user id

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 26
-def add_user_id_to_team(user_id, access_role)
-  users_projects.create(
-    user_id: user_id,
-    project_access: access_role
-  )
-end
-
-
- -
- -
-
- - add_user_to_team(user, access_role) - - -
- - -
-

Add user to project with passed access role

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 14
-def add_user_to_team(user, access_role)
-  add_user_id_to_team(user.id, access_role)
-end
-
-
- -
- -
-
- - add_users_ids_to_team(users_ids, access_role) - - -
- - -
-

Add multiple users to project with same access role by user ids

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 35
-def add_users_ids_to_team(users_ids, access_role)
-  UsersProject.bulk_import(self, users_ids, access_role)
-end
-
-
- -
- -
-
- - add_users_to_team(users, access_role) - - -
- - -
-

Add multiple users to project with same access role

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 20
-def add_users_to_team(users, access_role)
-  add_users_ids_to_team(users.map(&:id), access_role)
-end
-
-
- -
- -
-
- - delete_users_ids_from_team(users_ids) - - -
- - -
-

Delete multiple users from project by user ids

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 46
-def delete_users_ids_from_team(users_ids)
-  UsersProject.bulk_delete(self, users_ids)
-end
-
-
- -
- -
-
- - team_member_by_id(user_id) - - -
- - -
-

Get Team Member record by user id

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 8
-def team_member_by_id(user_id)
-  users_projects.find_by_user_id(user_id)
-end
-
-
- -
- -
-
- - team_member_by_name_or_email(name = nil, email = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/team.rb, line 2
-def team_member_by_name_or_email(name = nil, email = nil)
-  user = users.where("name like ? or email like ?", name, email).first
-  users_projects.where(user: user) if user
-end
-
-
- -
- -
-
- - truncate_team() - - -
- - -
-

Remove all users from project team

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 51
-def truncate_team
-  UsersProject.truncate_team(self)
-end
-
-
- -
- -
-
- - update_users_ids_to_role(users_ids, access_role) - - -
- - -
-

Update multiple project users to same access role by user ids

-
- - - - - - -
- - -
-
# File app/roles/team.rb, line 41
-def update_users_ids_to_role(users_ids, access_role)
-  UsersProject.bulk_update(self, users_ids, access_role)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TeamMembersController.html b/doc/code/classes/TeamMembersController.html deleted file mode 100644 index f411dfd17ce..00000000000 --- a/doc/code/classes/TeamMembersController.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - TeamMembersController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
C
-
- -
- -
D
-
- -
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - apply_import() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 51
-def apply_import
-  giver = Project.find(params[:source_project_id])
-  status = UsersProject.import_team(giver, project)
-  notice = status ? "Succesfully imported" : "Import failed"
-
-  redirect_to project_team_members_path(project), notice: notice
-end
-
-
- -
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 18
-def create
-  @project.add_users_ids_to_team(
-    params[:user_ids],
-    params[:project_access]
-  )
-
-  if params[:redirect_to]
-    redirect_to params[:redirect_to]
-  else
-    redirect_to project_team_index_path(@project)
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 41
-def destroy
-  @team_member = project.users_projects.find(params[:id])
-  @team_member.destroy
-
-  respond_to do |format|
-    format.html { redirect_to project_team_index_path(@project) }
-    format.js { render nothing: true }
-  end
-end
-
-
- -
- -
-
- - index() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 6
-def index
-end
-
-
- -
- -
-
- - new() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 14
-def new
-  @team_member = project.users_projects.new
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 9
-def show
-  @team_member = project.users_projects.find(params[:id])
-  @events = @team_member.user.recent_events.where(:project_id => @project.id).limit(7)
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/team_members_controller.rb, line 31
-def update
-  @team_member = project.users_projects.find(params[:id])
-  @team_member.update_attributes(params[:team_member])
-
-  unless @team_member.valid?
-    flash[:alert] = "User should have at least one role"
-  end
-  redirect_to project_team_index_path(@project)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TestHookContext.html b/doc/code/classes/TestHookContext.html deleted file mode 100644 index 5b9b647858b..00000000000 --- a/doc/code/classes/TestHookContext.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - TestHookContext - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/contexts/test_hook_context.rb, line 2
-def execute
-  hook = project.hooks.find(params[:id])
-  commits = project.commits(project.default_branch, nil, 3)
-  data = project.post_receive_data(commits.last.id, commits.first.id, "refs/heads/#{project.default_branch}", current_user)
-  hook.execute(data)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Tree.html b/doc/code/classes/Tree.html deleted file mode 100644 index e71dfa3ffc4..00000000000 --- a/doc/code/classes/Tree.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - - Tree - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
I
-
- -
- -
N
-
-
    - - -
  • - new -
  • - -
-
- -
- - - - -
Included Modules
-
    - -
  • - - Linguist::BlobHelper - -
  • - -
- - - - - - - - - - - - - - - -
Attributes
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- [RW] - path
- [RW] - project
- [RW] - ref
- [RW] - tree
- - - - - -
Class Public methods
- -
-
- - new(raw_tree, project, ref = nil, path = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/tree.rb, line 8
-def initialize(raw_tree, project, ref = nil, path = nil)
-  @project, @ref, @path = project, ref, path
-  @tree = if path.present?
-            raw_tree / path
-          else
-            raw_tree
-          end
-end
-
-
- -
- -
Instance Public methods
- -
-
- - empty?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/tree.rb, line 25
-def empty?
-  data.blank?
-end
-
-
- -
- -
-
- - invalid?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/tree.rb, line 21
-def invalid?
-  tree.nil?
-end
-
-
- -
- -
-
- - is_blob?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/tree.rb, line 17
-def is_blob?
-  tree.is_a?(Grit::Blob)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TreeController.html b/doc/code/classes/TreeController.html deleted file mode 100644 index 35c99bc09e4..00000000000 --- a/doc/code/classes/TreeController.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - TreeController - - - - - - - - - - - - - -
-
- -
- -

Controller for viewing a repository’s file structure

- -
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
U
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/tree_controller.rb, line 24
-def edit
-  @last_commit = @project.last_commit_for(@ref, @path).sha
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/tree_controller.rb, line 13
-def show
-  @hex_path  = Digest::SHA1.hexdigest(@path)
-  @logs_path = logs_file_project_ref_path(@project, @ref, @path)
-
-  respond_to do |format|
-    format.html
-    # Disable cache so browser history works
-    format.js { no_cache_headers }
-  end
-end
-
-
- -
- -
-
- - update() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/tree_controller.rb, line 28
-def update
-  edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, @project, @ref, @path)
-  updated_successfully = edit_file_action.commit!(
-    params[:content],
-    params[:commit_message],
-    params[:last_commit]
-  )
-
-  if updated_successfully
-    redirect_to project_tree_path(@project, @id), notice: "Your changes have been successfully commited"
-  else
-    flash[:notice] = "Your changes could not be commited, because the file has been changed"
-    render :edit
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TreeDecorator.html b/doc/code/classes/TreeDecorator.html deleted file mode 100644 index 9b32e1c9381..00000000000 --- a/doc/code/classes/TreeDecorator.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - TreeDecorator - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
B
-
- -
- -
R
-
- -
- -
U
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - breadcrumbs(max_links = 2) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/tree_decorator.rb, line 4
-def breadcrumbs(max_links = 2)
-  if path
-    part_path = ""
-    parts = path.split("\/")
-
-    #parts = parts[0...-1] if is_blob?
-
-    yield(h.link_to("..", "#")) if parts.count > max_links
-
-    parts.each do |part|
-      part_path = File.join(part_path, part) unless part_path.empty?
-      part_path = part if part_path.empty?
-
-      next unless parts.last(2).include?(part) if parts.count > max_links
-      yield(h.link_to(h.truncate(part, length: 40), h.project_tree_path(project, h.tree_join(ref, part_path))))
-    end
-  end
-end
-
-
- -
- -
-
- - readme() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/tree_decorator.rb, line 32
-def readme
-  @readme ||= contents.find { |c| c.is_a?(Grit::Blob) and c.name =~ %r^readme/ }
-end
-
-
- -
- -
-
- - up_dir?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/tree_decorator.rb, line 23
-def up_dir?
-  path.present?
-end
-
-
- -
- -
-
- - up_dir_path() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/tree_decorator.rb, line 27
-def up_dir_path
-  file = File.join(path, "..")
-  h.project_tree_path(project, h.tree_join(ref, file))
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/TreeHelper.html b/doc/code/classes/TreeHelper.html deleted file mode 100644 index a9ca79494de..00000000000 --- a/doc/code/classes/TreeHelper.html +++ /dev/null @@ -1,541 +0,0 @@ - - - - - TreeHelper - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
G
-
- -
- -
M
-
- -
- -
P
-
- -
- -
R
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - allowed_tree_edit?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 63
-def allowed_tree_edit?
-  if @project.protected_branch? @ref
-    can?(current_user, :push_code_to_protected_branches, @project)
-  else
-    can?(current_user, :push_code, @project)
-  end
-end
-
-
- -
- -
-
- - breadcrumbs() - - -
- - -
-

Breadcrumb links for a Project and, if -applicable, a tree path

-
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 72
-def breadcrumbs
-  return unless @project && @ref
-
-  # Add the root project link and the arrow icon
-  crumbs = content_tag(:li) do
-    content_tag(:span, nil, class: 'arrow') +
-    link_to(@project.name, project_commits_path(@project, @ref))
-  end
-
-  if @path
-    parts = @path.split('/')
-
-    parts.each_with_index do |part, i|
-      crumbs += content_tag(:span, '/', class: 'divider')
-      crumbs += content_tag(:li) do
-        # The text is just the individual part, but the link needs all the parts before it
-        link_to part, project_commits_path(@project, tree_join(@ref, parts[0..i].join('/')))
-      end
-    end
-  end
-
-  crumbs.html_safe
-end
-
-
- -
- -
-
- - gitlab_markdown?(filename) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 50
-def gitlab_markdown?(filename)
-  filename.end_with?(*%w(.mdown .md .markdown))
-end
-
-
- -
- -
-
- - markup?(filename) - - -
- - -
-

Public: Determines if a given filename is compatible with GitHub::Markup.

- -

filename - Filename string to check

- -

Returns boolean

-
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 45
-def markup?(filename)
-  filename.end_with?(*%w(.textile .rdoc .org .creole
-                         .mediawiki .rst .asciidoc .pod))
-end
-
-
- -
- -
-
- - plain_text_readme?(filename) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 54
-def plain_text_readme? filename
-  filename == 'README'
-end
-
-
- -
- -
-
- - render_tree(contents) - - -
- - -
-

Sorts a repository’s tree so that folders are before files and renders -their corresponding partials

- -

contents - A Grit::Tree object for the current tree

-
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 6
-def render_tree(contents)
-  # Render Folders before Files/Submodules
-  folders, files = contents.partition { |v| v.kind_of?(Grit::Tree) }
-
-  tree = ""
-
-  # Render folders if we have any
-  tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present?
-
-  files.each do |f|
-    if f.respond_to?(:url)
-      # Object is a Submodule
-      tree += render partial: 'tree/submodule_item', object: f
-    else
-      # Object is a Blob
-      tree += render partial: 'tree/tree_item', object: f, locals: {type: 'file'}
-    end
-  end
-
-  tree.html_safe
-end
-
-
- -
- -
-
- - tree_hex_class(content) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 36
-def tree_hex_class(content)
-  "file_#{hexdigest(content.name)}"
-end
-
-
- -
- -
-
- - tree_icon(type) - - -
- - -
-

Return an image icon depending on the file type

- -

type - String type of the tree item; either ‘folder’ or ‘file’

-
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 31
-def tree_icon(type)
-  image = type == 'folder' ? 'file_dir.png' : 'file_txt.png'
-  image_tag(image, size: '16x16')
-end
-
-
- -
- -
-
- - tree_join(*args) - - -
- - -
-

Simple shortcut to File.join

-
- - - - - - -
- - -
-
# File app/helpers/tree_helper.rb, line 59
-def tree_join(*args)
-  File.join(*args)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/User.html b/doc/code/classes/User.html deleted file mode 100644 index 661b143ebd1..00000000000 --- a/doc/code/classes/User.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - - User - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: users

- -
id                     :integer          not null, primary key
-email                  :string(255)      default(""), not null
-encrypted_password     :string(255)      default(""), not null
-reset_password_token   :string(255)
-reset_password_sent_at :datetime
-remember_created_at    :datetime
-sign_in_count          :integer          default(0)
-current_sign_in_at     :datetime
-last_sign_in_at        :datetime
-current_sign_in_ip     :string(255)
-last_sign_in_ip        :string(255)
-created_at             :datetime         not null
-updated_at             :datetime         not null
-name                   :string(255)
-admin                  :boolean          default(FALSE), not null
-projects_limit         :integer          default(10)
-skype                  :string(255)      default(""), not null
-linkedin               :string(255)      default(""), not null
-twitter                :string(255)      default(""), not null
-authentication_token   :string(255)
-dark_scheme            :boolean          default(FALSE), not null
-theme_id               :integer          default(1), not null
-bio                    :string(255)
-blocked                :boolean          default(FALSE), not null
-failed_attempts        :integer          default(0)
-locked_at              :datetime
-extern_uid             :string(255)
-provider               :string(255)
-username               :string(255)
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
F
-
- -
- -
G
-
- -
- -
N
-
- -
- -
S
-
- -
- -
W
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - - - - -
Attributes
- - - - - - - - -
- [RW] - force_random_password
- - - - - -
Class Public methods
- -
-
- - create_from_omniauth(auth, ldap = false) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 108
-def create_from_omniauth(auth, ldap = false)
-  gitlab_auth.create_from_omniauth(auth, ldap)
-end
-
-
- -
- -
-
- - filter(filter_name) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 86
-def filter filter_name
-  case filter_name
-  when "admins"; self.admins
-  when "blocked"; self.blocked
-  when "wop"; self.without_projects
-  else
-    self.active
-  end
-end
-
-
- -
- -
-
- - find_for_ldap_auth(auth, signed_in_resource = nil) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 116
-def find_for_ldap_auth(auth, signed_in_resource = nil)
-  gitlab_auth.find_for_ldap_auth(auth, signed_in_resource)
-end
-
-
- -
- -
-
- - find_or_new_for_omniauth(auth) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 112
-def find_or_new_for_omniauth(auth)
-  gitlab_auth.find_or_new_for_omniauth(auth)
-end
-
-
- -
- -
-
- - gitlab_auth() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 120
-def gitlab_auth
-  Gitlab::Auth.new
-end
-
-
- -
- -
-
- - not_in_project(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 96
-def not_in_project(project)
-  if project.users.present?
-    where("id not in (:ids)", ids: project.users.map(&:id) )
-  else
-    scoped
-  end
-end
-
-
- -
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 124
-def search query
-  where("name LIKE :query or email LIKE :query", query: "%#{query}%")
-end
-
-
- -
- -
-
- - without_projects() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 104
-def without_projects
-  where('id NOT IN (SELECT DISTINCT(user_id) FROM users_projects)')
-end
-
-
- -
- -
Instance Public methods
- -
-
- - generate_password() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/user.rb, line 129
-def generate_password
-  if self.force_random_password
-    self.password = self.password_confirmation = Devise.friendly_token.first(8)
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/UserDecorator.html b/doc/code/classes/UserDecorator.html deleted file mode 100644 index 24ce4b76352..00000000000 --- a/doc/code/classes/UserDecorator.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - UserDecorator - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - avatar_image(size = 16) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/user_decorator.rb, line 4
-def avatar_image size = 16
-  h.image_tag h.gravatar_icon(self.email, size), class: "avatar #{"s#{size}"}", width: size
-end
-
-
- -
- -
-
- - tm_of(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/decorators/user_decorator.rb, line 8
-def tm_of(project)
-  project.team_member_by_id(self.id)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/UserObserver.html b/doc/code/classes/UserObserver.html deleted file mode 100644 index 6899937afb9..00000000000 --- a/doc/code/classes/UserObserver.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - UserObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
L
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_create(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/user_observer.rb, line 2
-def after_create(user)
-  log_info("User \"#{user.name}\" (#{user.email}) was created")
-
-  Notify.new_user_email(user.id, user.password).deliver
-end
-
-
- -
- -
-
- - after_destroy(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/user_observer.rb, line 8
-def after_destroy user
-  log_info("User \"#{user.name}\" (#{user.email})  was removed")
-end
-
-
- -
- -
-
- - after_save(user) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/user_observer.rb, line 12
-def after_save user
-  if user.username_changed?
-    if user.namespace
-      user.namespace.update_attributes(path: user.username)
-    else
-      user.create_namespace!(path: user.username, name: user.username)
-    end
-  end
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - log_info(message) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/user_observer.rb, line 24
-def log_info message
-  Gitlab::AppLogger.info message
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/UsersProject.html b/doc/code/classes/UsersProject.html deleted file mode 100644 index 76ae5125a1d..00000000000 --- a/doc/code/classes/UsersProject.html +++ /dev/null @@ -1,871 +0,0 @@ - - - - - UsersProject - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: users_projects

- -
id             :integer          not null, primary key
-user_id        :integer          not null
-project_id     :integer          not null
-created_at     :datetime         not null
-updated_at     :datetime         not null
-project_access :integer          default(0), not null
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
B
-
- -
- -
I
-
- -
- -
P
-
- -
- -
R
-
- -
- -
S
-
- -
- -
T
-
- -
- -
U
-
- -
- -
- - - - -
Included Modules
- - - - - - - - - - - - - -
Constants
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GUEST=10
 
REPORTER=20
 
DEVELOPER=30
 
MASTER=40
 
- - - - - -
Attributes
- - - - - - - - -
- [RW] - skip_git
- - - - - -
Class Public methods
- -
-
- - access_roles() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 140
-def access_roles
-  {
-    "Guest"     => GUEST,
-    "Reporter"  => REPORTER,
-    "Developer" => DEVELOPER,
-    "Master"    => MASTER
-  }
-end
-
-
- -
- -
-
- - add_users_into_projects(project_ids, user_ids, project_access) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 41
-def add_users_into_projects(project_ids, user_ids, project_access)
-  UsersProject.transaction do
-    project_ids.each do |project_id|
-      user_ids.each do |user_id|
-        users_project = UsersProject.new(project_access: project_access, user_id: user_id)
-        users_project.project_id = project_id
-        users_project.skip_git = true
-        users_project.save
-      end
-    end
-    Gitlab::Gitolite.new.update_repositories(Project.where(id: project_ids))
-  end
-
-  true
-rescue
-  false
-end
-
-
- -
- -
-
- - bulk_delete(project, user_ids) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 108
-def bulk_delete(project, user_ids)
-  UsersProject.transaction do
-    UsersProject.where(user_id: user_ids, project_id: project.id).each do |users_project|
-      users_project.skip_git = true
-      users_project.destroy
-    end
-
-    project.update_repository
-  end
-end
-
-
- -
- -
-
- - bulk_import(project, user_ids, project_access) - - -
- - -
-

TODO: depreceate in future in favor of ::add_users_into_projects

-
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 131
-def bulk_import(project, user_ids, project_access)
-  add_users_into_projects([project.id], user_ids, project_access)
-end
-
-
- -
- -
-
- - bulk_update(project, user_ids, project_access) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 119
-def bulk_update(project, user_ids, project_access)
-  UsersProject.transaction do
-    UsersProject.where(user_id: user_ids, project_id: project.id).each do |users_project|
-      users_project.project_access = project_access
-      users_project.skip_git = true
-      users_project.save
-    end
-    project.update_repository
-  end
-end
-
-
- -
- -
-
- - import_team(source_project, target_project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 78
-def import_team(source_project, target_project)
-  source_team = source_project.users_projects.all
-  target_team = target_project.users_projects.all
-  target_user_ids = target_team.map(&:user_id)
-
-  source_team.reject! do |tm|
-    # Skip if user already present in team
-    target_user_ids.include?(tm.user_id)
-  end
-
-  source_team.map! do |tm|
-    new_tm = tm.dup
-    new_tm.id = nil
-    new_tm.project_id = target_project.id
-    new_tm.skip_git = true
-    new_tm
-  end
-
-  UsersProject.transaction do
-    source_team.each do |tm|
-      tm.save
-    end
-    target_project.update_repository
-  end
-
-  true
-rescue
-  false
-end
-
-
- -
- -
-
- - truncate_team(project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 74
-def truncate_team project
-  truncate_teams [project.id]
-end
-
-
- -
- -
-
- - truncate_teams(project_ids) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 59
-def truncate_teams(project_ids)
-  UsersProject.transaction do
-    users_projects = UsersProject.where(project_id: project_ids)
-    users_projects.each do |users_project|
-      users_project.skip_git = true
-      users_project.destroy
-    end
-    Gitlab::Gitolite.new.update_repositories(Project.where(id: project_ids))
-  end
-
-  true
-rescue
-  false
-end
-
-
- -
- -
-
- - user_bulk_import(user, project_ids, project_access) - - -
- - -
-

TODO: depreceate in future in favor of ::add_users_into_projects

-
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 136
-def user_bulk_import(user, project_ids, project_access)
-  add_users_into_projects(project_ids, [user.id], project_access)
-end
-
-
- -
- -
Instance Public methods
- -
-
- - project_access_human() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 158
-def project_access_human
-  Project.access_options.key(self.project_access)
-end
-
-
- -
- -
-
- - repo_access_human() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 162
-def repo_access_human
-  self.class.access_roles.invert[self.project_access]
-end
-
-
- -
- -
-
- - role_access() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 150
-def role_access
-  project_access
-end
-
-
- -
- -
-
- - skip_git?() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 166
-def skip_git?
-  !!@skip_git
-end
-
-
- -
- -
-
- - update_repository() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/users_project.rb, line 154
-def update_repository
-  git_host.update_repository(project)
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/UsersProjectObserver.html b/doc/code/classes/UsersProjectObserver.html deleted file mode 100644 index 50b02dc75f6..00000000000 --- a/doc/code/classes/UsersProjectObserver.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - UsersProjectObserver - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
A
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - after_commit(users_project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/users_project_observer.rb, line 2
-def after_commit(users_project)
-  return if users_project.destroyed?
-  Notify.project_access_granted_email(users_project.id).deliver
-end
-
-
- -
- -
-
- - after_create(users_project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/users_project_observer.rb, line 7
-def after_create(users_project)
-  Event.create(
-    project_id: users_project.project.id,
-    action: Event::Joined,
-    author_id: users_project.user.id
-  )
-end
-
-
- -
- -
-
- - after_destroy(users_project) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/observers/users_project_observer.rb, line 15
-def after_destroy(users_project)
-  Event.create(
-    project_id: users_project.project.id,
-    action: Event::Left,
-    author_id: users_project.user.id
-  )
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Votes.html b/doc/code/classes/Votes.html deleted file mode 100644 index bb786a79662..00000000000 --- a/doc/code/classes/Votes.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - Votes - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
D
-
- -
- -
U
-
- -
- -
V
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - downvotes() - - -
- - -
-

Return the number of -1 comments (downvotes)

-
- - - - - - -
- - -
-
# File app/roles/votes.rb, line 16
-def downvotes
-  notes.select(&:downvote?).size
-end
-
-
- -
- -
-
- - downvotes_in_percent() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/votes.rb, line 20
-def downvotes_in_percent
-  if votes_count.zero?
-    0
-  else
-    100.0 - upvotes_in_percent
-  end
-end
-
-
- -
- -
-
- - upvotes() - - -
- - -
-

Return the number of +1 comments (upvotes)

-
- - - - - - -
- - -
-
# File app/roles/votes.rb, line 3
-def upvotes
-  notes.select(&:upvote?).size
-end
-
-
- -
- -
-
- - upvotes_in_percent() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/roles/votes.rb, line 7
-def upvotes_in_percent
-  if votes_count.zero?
-    0
-  else
-    100.0 / votes_count * upvotes
-  end
-end
-
-
- -
- -
-
- - votes_count() - - -
- - -
-

Return the total number of votes

-
- - - - - - -
- - -
-
# File app/roles/votes.rb, line 29
-def votes_count
-  upvotes + downvotes
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/WebHook.html b/doc/code/classes/WebHook.html deleted file mode 100644 index 54097dd30e5..00000000000 --- a/doc/code/classes/WebHook.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - WebHook - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: web_hooks

- -
id         :integer          not null, primary key
-url        :string(255)
-project_id :integer
-created_at :datetime         not null
-updated_at :datetime         not null
-type       :string(255)      default("ProjectHook")
-service_id :integer
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
E
-
- -
- -
- - - - -
Included Modules
-
    - -
  • - - HTTParty - -
  • - -
- - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - execute(data) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/web_hook.rb, line 25
-def execute(data)
-  parsed_url = URI.parse(url)
-  if parsed_url.userinfo.blank?
-    WebHook.post(url, body: data.to_json, headers: { "Content-Type" => "application/json" })
-  else
-    post_url = url.gsub("#{parsed_url.userinfo}@", "")
-    WebHook.post(post_url,
-                 body: data.to_json,
-                 headers: {"Content-Type" => "application/json"},
-                 basic_auth: {username: parsed_url.user, password: parsed_url.password})
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/Wiki.html b/doc/code/classes/Wiki.html deleted file mode 100644 index ab0fe9b2444..00000000000 --- a/doc/code/classes/Wiki.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Wiki - - - - - - - - - - - - - -
-
- -
- -

Schema Information

- -

Table name: wikis

- -
id         :integer          not null, primary key
-title      :string(255)
-content    :text
-project_id :integer
-created_at :datetime         not null
-updated_at :datetime         not null
-slug       :string(255)
-user_id    :integer
- -
- - - - - - - - - - - - - - - -
Methods
-
- -
R
-
- -
- -
S
-
- -
- -
T
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
Class Public methods
- -
- - - -
- -
- - - - - - -
- - -
-
# File app/models/wiki.rb, line 33
-def search(query)
-  where("title like :query OR content like :query", query: "%#{query}%")
-end
-
-
- -
- -
Class Protected methods
- -
-
- - regenerate_from(wiki) - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/wiki.rb, line 40
-def self.regenerate_from wiki
-  regenerated_field = [:slug, :content, :title]
-
-  new_wiki = Wiki.new
-  regenerated_field.each do |field|
-    new_wiki.send("#{field}=", wiki.send(field))
-  end
-  new_wiki
-end
-
-
- -
- -
Instance Public methods
- -
-
- - to_param() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/wiki.rb, line 28
-def to_param
-  slug
-end
-
-
- -
- -
Instance Protected methods
- -
-
- - set_slug() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/models/wiki.rb, line 50
-def set_slug
-  self.slug = self.title.parameterize
-end
-
-
- -
-
- -
- - \ No newline at end of file diff --git a/doc/code/classes/WikisController.html b/doc/code/classes/WikisController.html deleted file mode 100644 index 3247d4f0fd9..00000000000 --- a/doc/code/classes/WikisController.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - - WikisController - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - -
Methods
-
- -
C
-
- -
- -
D
-
- -
- -
E
-
-
    - - -
  • - edit -
  • - -
-
- -
H
-
- -
- -
P
-
- -
- -
S
-
-
    - - -
  • - show -
  • - -
-
- -
- - - - - - - - - - - - - - - - - - - - -
Instance Public methods
- -
-
- - create() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/wikis_controller.rb, line 36
-def create
-  @wiki = @project.wikis.new(params[:wiki])
-  @wiki.user = current_user
-
-  respond_to do |format|
-    if @wiki.save
-      format.html { redirect_to [@project, @wiki], notice: 'Wiki was successfully updated.' }
-    else
-      format.html { render action: "edit" }
-    end
-  end
-end
-
-
- -
- -
-
- - destroy() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/wikis_controller.rb, line 53
-def destroy
-  @wikis = @project.wikis.where(slug: params[:id]).delete_all
-
-  respond_to do |format|
-    format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" }
-  end
-end
-
-
- -
- -
-
- - edit() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/wikis_controller.rb, line 31
-def edit
-  @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
-  @wiki = Wiki.regenerate_from @wiki
-end
-
-
- -
- -
-
- - history() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/wikis_controller.rb, line 49
-def history
-  @wikis = @project.wikis.where(slug: params[:id]).order("created_at")
-end
-
-
- -
- -
-
- - pages() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/wikis_controller.rb, line 6
-def pages
-  @wikis = @project.wikis.group(:slug).order("created_at")
-end
-
-
- -
- -
-
- - show() - - -
- - -
- -
- - - - - - -
- - -
-
# File app/controllers/wikis_controller.rb, line 10
-def show
-  if params[:old_page_id]
-    @wiki = @project.wikis.find(params[:old_page_id])
-  else
-    @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
-  end
-
-  @note = @project.notes.new(noteable: @wiki)
-
-  if @wiki
-    render 'show'
-  else
-    if can?(current_user, :write_wiki, @project)
-      @wiki = @project.wikis.new(slug: params[:id])
-      render 'edit'
-    else
-      render 'empty'
-    end
-  end
-end
-
-
- -
-
- -
- - \ No newline at end of file -- cgit v1.2.1