gitlab-org--gitlab-foss/doc/app/Repository.html

1567 lines
56 KiB
HTML
Raw Normal View History

2012-10-25 04:59:41 -04:00
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>module Repository - Rails Application Documentation</title>
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
<script type="text/javascript">
var rdoc_rel_prefix = "./";
</script>
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
<body id="top" class="module">
<nav id="metadata">
<nav id="home-section" class="section">
<h3 class="section-header">
<a href="./index.html">Home</a>
<a href="./table_of_contents.html#classes">Classes</a>
<a href="./table_of_contents.html#methods">Methods</a>
</h3>
</nav>
<nav id="search-section" class="section project-section" class="initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<h3 class="section-header">
<input type="text" name="search" placeholder="Search" id="search-field"
title="Type to search, Up and Down to navigate, Enter to load">
</h3>
</form>
<ul id="search-results" class="initially-hidden"></ul>
</nav>
<div id="file-metadata">
<nav id="file-list-section" class="section">
<h3 class="section-header">Defined In</h3>
<ul>
<li>app/roles/repository.rb
</ul>
</nav>
</div>
<div id="class-metadata">
<!-- Included Modules -->
<nav id="includes-section" class="section">
<h3 class="section-header">Included Modules</h3>
<ul class="link-list">
<li><a class="include" href="GitHost.html">GitHost</a>
</ul>
</nav>
<!-- Method Quickref -->
<nav id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-i-archive_repo">#archive_repo</a>
<li><a href="#method-i-branch_names">#branch_names</a>
<li><a href="#method-i-branches">#branches</a>
<li><a href="#method-i-commit">#commit</a>
<li><a href="#method-i-commits">#commits</a>
<li><a href="#method-i-commits_between">#commits_between</a>
<li><a href="#method-i-commits_since">#commits_since</a>
<li><a href="#method-i-commits_with_refs">#commits_with_refs</a>
<li><a href="#method-i-destroy_repository">#destroy_repository</a>
<li><a href="#method-i-discover_default_branch">#discover_default_branch</a>
<li><a href="#method-i-empty_repo-3F">#empty_repo?</a>
<li><a href="#method-i-fresh_commits">#fresh_commits</a>
<li><a href="#method-i-has_commits-3F">#has_commits?</a>
<li><a href="#method-i-has_post_receive_file-3F">#has_post_receive_file?</a>
<li><a href="#method-i-heads">#heads</a>
<li><a href="#method-i-http_url_to_repo">#http_url_to_repo</a>
<li><a href="#method-i-last_commit_for">#last_commit_for</a>
<li><a href="#method-i-open_branches">#open_branches</a>
<li><a href="#method-i-path_to_repo">#path_to_repo</a>
<li><a href="#method-i-protected_branch-3F">#protected_branch?</a>
<li><a href="#method-i-ref_names">#ref_names</a>
<li><a href="#method-i-repo">#repo</a>
<li><a href="#method-i-repo_exists-3F">#repo_exists?</a>
<li><a href="#method-i-root_ref">#root_ref</a>
<li><a href="#method-i-root_ref-3F">#root_ref?</a>
<li><a href="#method-i-satellite">#satellite</a>
<li><a href="#method-i-ssh_url_to_repo">#ssh_url_to_repo</a>
<li><a href="#method-i-tag_names">#tag_names</a>
<li><a href="#method-i-tags">#tags</a>
<li><a href="#method-i-tree">#tree</a>
<li><a href="#method-i-update_repository">#update_repository</a>
<li><a href="#method-i-url_to_repo">#url_to_repo</a>
<li><a href="#method-i-valid_repo-3F">#valid_repo?</a>
</ul>
</nav>
</div>
<div id="project-metadata">
<nav id="fileindex-section" class="section project-section">
<h3 class="section-header">Pages</h3>
<ul>
<li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a>
</ul>
</nav>
<nav id="classindex-section" class="section project-section">
<h3 class="section-header">Class and Module Index</h3>
<ul class="link-list">
<li><a href="./Gitlab.html">Gitlab</a>
<li><a href="./Gitlab/API.html">Gitlab::API</a>
<li><a href="./Gitlab/APIHelpers.html">Gitlab::APIHelpers</a>
<li><a href="./Gitlab/AppLogger.html">Gitlab::AppLogger</a>
<li><a href="./Gitlab/Auth.html">Gitlab::Auth</a>
<li><a href="./Gitlab/Encode.html">Gitlab::Encode</a>
<li><a href="./Gitlab/Entities.html">Gitlab::Entities</a>
<li><a href="./Gitlab/Entities/Hook.html">Gitlab::Entities::Hook</a>
<li><a href="./Gitlab/Entities/Issue.html">Gitlab::Entities::Issue</a>
<li><a href="./Gitlab/Entities/Milestone.html">Gitlab::Entities::Milestone</a>
<li><a href="./Gitlab/Entities/Project.html">Gitlab::Entities::Project</a>
<li><a href="./Gitlab/Entities/ProjectMember.html">Gitlab::Entities::ProjectMember</a>
<li><a href="./Gitlab/Entities/ProjectSnippet.html">Gitlab::Entities::ProjectSnippet</a>
<li><a href="./Gitlab/Entities/RepoCommit.html">Gitlab::Entities::RepoCommit</a>
<li><a href="./Gitlab/Entities/RepoObject.html">Gitlab::Entities::RepoObject</a>
<li><a href="./Gitlab/Entities/SSHKey.html">Gitlab::Entities::SSHKey</a>
<li><a href="./Gitlab/Entities/User.html">Gitlab::Entities::User</a>
<li><a href="./Gitlab/Entities/UserBasic.html">Gitlab::Entities::UserBasic</a>
<li><a href="./Gitlab/Entities/UserLogin.html">Gitlab::Entities::UserLogin</a>
<li><a href="./Gitlab/FileEditor.html">Gitlab::FileEditor</a>
<li><a href="./Gitlab/GitLogger.html">Gitlab::GitLogger</a>
<li><a href="./Gitlab/Gitolite.html">Gitlab::Gitolite</a>
<li><a href="./Gitlab/Gitolite/AccessDenied.html">Gitlab::Gitolite::AccessDenied</a>
<li><a href="./Gitlab/GitoliteConfig.html">Gitlab::GitoliteConfig</a>
<li><a href="./Gitlab/GitoliteConfig/PullError.html">Gitlab::GitoliteConfig::PullError</a>
<li><a href="./Gitlab/GitoliteConfig/PushError.html">Gitlab::GitoliteConfig::PushError</a>
<li><a href="./Gitlab/GraphCommit.html">Gitlab::GraphCommit</a>
<li><a href="./Gitlab/InlineDiff.html">Gitlab::InlineDiff</a>
<li><a href="./Gitlab/Issues.html">Gitlab::Issues</a>
<li><a href="./Gitlab/Logger.html">Gitlab::Logger</a>
<li><a href="./Gitlab/Markdown.html">Gitlab::Markdown</a>
<li><a href="./Gitlab/Merge.html">Gitlab::Merge</a>
<li><a href="./Gitlab/Milestones.html">Gitlab::Milestones</a>
<li><a href="./Gitlab/Projects.html">Gitlab::Projects</a>
<li><a href="./Gitlab/Satellite.html">Gitlab::Satellite</a>
<li><a href="./Gitlab/Session.html">Gitlab::Session</a>
<li><a href="./Gitlab/Theme.html">Gitlab::Theme</a>
<li><a href="./Gitlab/Users.html">Gitlab::Users</a>
<li><a href="./Admin.html">Admin</a>
<li><a href="./Admin/DashboardController.html">Admin::DashboardController</a>
<li><a href="./Admin/GroupsController.html">Admin::GroupsController</a>
<li><a href="./Admin/HooksController.html">Admin::HooksController</a>
<li><a href="./Admin/LogsController.html">Admin::LogsController</a>
<li><a href="./Admin/ProjectsController.html">Admin::ProjectsController</a>
<li><a href="./Admin/ResqueController.html">Admin::ResqueController</a>
<li><a href="./Admin/TeamMembersController.html">Admin::TeamMembersController</a>
<li><a href="./Admin/UsersController.html">Admin::UsersController</a>
<li><a href="./Notes.html">Notes</a>
<li><a href="./Notes/CreateContext.html">Notes::CreateContext</a>
<li><a href="./Notes/LoadContext.html">Notes::LoadContext</a>
<li><a href="./Redcarpet.html">Redcarpet</a>
<li><a href="./Redcarpet/Render.html">Redcarpet::Render</a>
<li><a href="./Redcarpet/Render/GitlabHTML.html">Redcarpet::Render::GitlabHTML</a>
<li><a href="./ExtractsPath.html">ExtractsPath</a>
<li><a href="./ExtractsPath/InvalidPathError.html">ExtractsPath::InvalidPathError</a>
<li><a href="./FileSizeValidator.html">FileSizeValidator</a>
<li><a href="./FileSizeValidator/Helper.html">FileSizeValidator::Helper</a>
<li><a href="./Grack.html">Grack</a>
<li><a href="./Grack/Auth.html">Grack::Auth</a>
<li><a href="./IssueCommonality.html">IssueCommonality</a>
<li><a href="./IssueCommonality/ClassMethods.html">IssueCommonality::ClassMethods</a>
<li><a href="./StaticModel.html">StaticModel</a>
<li><a href="./StaticModel/ClassMethods.html">StaticModel::ClassMethods</a>
<li><a href="./Ability.html">Ability</a>
<li><a href="./Account.html">Account</a>
<li><a href="./ActivityObserver.html">ActivityObserver</a>
<li><a href="./AdminController.html">AdminController</a>
<li><a href="./ApplicationController.html">ApplicationController</a>
<li><a href="./ApplicationDecorator.html">ApplicationDecorator</a>
<li><a href="./ApplicationHelper.html">ApplicationHelper</a>
<li><a href="./AttachmentUploader.html">AttachmentUploader</a>
<li><a href="./Authority.html">Authority</a>
<li><a href="./BaseContext.html">BaseContext</a>
<li><a href="./BlameController.html">BlameController</a>
<li><a href="./BlobController.html">BlobController</a>
<li><a href="./Commit.html">Commit</a>
<li><a href="./CommitController.html">CommitController</a>
<li><a href="./CommitDecorator.html">CommitDecorator</a>
<li><a href="./CommitLoadContext.html">CommitLoadContext</a>
<li><a href="./CommitsController.html">CommitsController</a>
<li><a href="./CommitsHelper.html">CommitsHelper</a>
<li><a href="./CompareController.html">CompareController</a>
<li><a href="./DashboardController.html">DashboardController</a>
<li><a href="./DeployKeysController.html">DeployKeysController</a>
<li><a href="./ErrorsController.html">ErrorsController</a>
<li><a href="./Event.html">Event</a>
<li><a href="./EventDecorator.html">EventDecorator</a>
<li><a href="./EventsHelper.html">EventsHelper</a>
<li><a href="./GitHost.html">GitHost</a>
<li><a href="./GitlabMarkdownHelper.html">GitlabMarkdownHelper</a>
<li><a href="./Group.html">Group</a>
<li><a href="./GroupsController.html">GroupsController</a>
<li><a href="./HelpController.html">HelpController</a>
<li><a href="./HooksController.html">HooksController</a>
<li><a href="./Issue.html">Issue</a>
<li><a href="./IssueObserver.html">IssueObserver</a>
<li><a href="./IssuesBulkUpdateContext.html">IssuesBulkUpdateContext</a>
<li><a href="./IssuesController.html">IssuesController</a>
<li><a href="./IssuesHelper.html">IssuesHelper</a>
<li><a href="./IssuesListContext.html">IssuesListContext</a>
<li><a href="./Key.html">Key</a>
<li><a href="./KeyObserver.html">KeyObserver</a>
<li><a href="./KeysController.html">KeysController</a>
<li><a href="./LabelsController.html">LabelsController</a>
<li><a href="./MergeRequest.html">MergeRequest</a>
<li><a href="./MergeRequestObserver.html">MergeRequestObserver</a>
<li><a href="./MergeRequestsController.html">MergeRequestsController</a>
<li><a href="./MergeRequestsHelper.html">MergeRequestsHelper</a>
<li><a href="./MergeRequestsLoadContext.html">MergeRequestsLoadContext</a>
<li><a href="./Milestone.html">Milestone</a>
<li><a href="./MilestonesController.html">MilestonesController</a>
<li><a href="./Note.html">Note</a>
<li><a href="./NoteObserver.html">NoteObserver</a>
<li><a href="./NotesController.html">NotesController</a>
<li><a href="./NotesHelper.html">NotesHelper</a>
<li><a href="./Notify.html">Notify</a>
<li><a href="./OmniauthCallbacksController.html">OmniauthCallbacksController</a>
<li><a href="./PostReceive.html">PostReceive</a>
<li><a href="./ProfileController.html">ProfileController</a>
<li><a href="./ProfileHelper.html">ProfileHelper</a>
<li><a href="./Project.html">Project</a>
<li><a href="./ProjectHook.html">ProjectHook</a>
<li><a href="./ProjectObserver.html">ProjectObserver</a>
<li><a href="./ProjectResourceController.html">ProjectResourceController</a>
<li><a href="./ProjectsController.html">ProjectsController</a>
<li><a href="./ProjectsHelper.html">ProjectsHelper</a>
<li><a href="./ProtectedBranch.html">ProtectedBranch</a>
<li><a href="./ProtectedBranchesController.html">ProtectedBranchesController</a>
<li><a href="./PushEvent.html">PushEvent</a>
<li><a href="./PushObserver.html">PushObserver</a>
<li><a href="./RefsController.html">RefsController</a>
<li><a href="./RepositoriesController.html">RepositoriesController</a>
<li><a href="./Repository.html">Repository</a>
<li><a href="./SearchContext.html">SearchContext</a>
<li><a href="./SearchController.html">SearchController</a>
<li><a href="./Snippet.html">Snippet</a>
<li><a href="./SnippetsController.html">SnippetsController</a>
<li><a href="./SnippetsHelper.html">SnippetsHelper</a>
<li><a href="./SystemHook.html">SystemHook</a>
<li><a href="./SystemHookObserver.html">SystemHookObserver</a>
<li><a href="./SystemHookWorker.html">SystemHookWorker</a>
<li><a href="./TabHelper.html">TabHelper</a>
<li><a href="./TagsHelper.html">TagsHelper</a>
<li><a href="./Team.html">Team</a>
<li><a href="./TeamMembersController.html">TeamMembersController</a>
<li><a href="./TestHookContext.html">TestHookContext</a>
<li><a href="./Tree.html">Tree</a>
<li><a href="./TreeController.html">TreeController</a>
<li><a href="./TreeDecorator.html">TreeDecorator</a>
<li><a href="./TreeHelper.html">TreeHelper</a>
<li><a href="./User.html">User</a>
<li><a href="./UserObserver.html">UserObserver</a>
<li><a href="./UsersProject.html">UsersProject</a>
<li><a href="./UsersProjectObserver.html">UsersProjectObserver</a>
<li><a href="./Votes.html">Votes</a>
<li><a href="./WebHook.html">WebHook</a>
<li><a href="./Wiki.html">Wiki</a>
<li><a href="./WikisController.html">WikisController</a>
</ul>
</nav>
</div>
</nav>
<div id="documentation">
<h1 class="module">module Repository</h1>
<div id="description" class="description">
</div><!-- description -->
<section id="5Buntitled-5D" class="documentation-section">
<!-- Methods -->
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
<div id="method-i-archive_repo" class="method-detail ">
<div class="method-heading">
<span class="method-name">archive_repo</span><span
class="method-args">(ref)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Archive <a href="Project.html">Project</a> to .tar.gz</p>
<p>Already packed repo archives stored at
app_root/tmp/repositories/project_name/project_name-commit-id.tag.gz</p>
<div class="method-source-code" id="archive_repo-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 157</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">archive_repo</span>(<span class="ruby-identifier">ref</span>)
<span class="ruby-identifier">ref</span> = <span class="ruby-identifier">ref</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">root_ref</span>
<span class="ruby-identifier">commit</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">commit</span>(<span class="ruby-identifier">ref</span>)
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">commit</span>
<span class="ruby-comment"># Build file path</span>
<span class="ruby-identifier">file_name</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">code</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;-&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;.tar.gz&quot;</span>
<span class="ruby-identifier">storage_path</span> = <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;tmp&quot;</span>, <span class="ruby-string">&quot;repositories&quot;</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">code</span>)
<span class="ruby-identifier">file_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">storage_path</span>, <span class="ruby-identifier">file_name</span>)
<span class="ruby-comment"># Put files into a directory before archiving</span>
<span class="ruby-identifier">prefix</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">code</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;/&quot;</span>
<span class="ruby-comment"># Create file if not exists</span>
<span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">file_path</span>)
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-identifier">storage_path</span>
<span class="ruby-identifier">file</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">archive_to_file</span>(<span class="ruby-identifier">ref</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">file_path</span>)
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">file_path</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- archive_repo-source -->
</div>
</div><!-- archive_repo-method -->
<div id="method-i-branch_names" class="method-detail ">
<div class="method-heading">
<span class="method-name">branch_names</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Returns an Array of branch names</p>
<div class="method-source-code" id="branch_names-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 53</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">branch_names</span>
<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">branches</span>.<span class="ruby-identifier">collect</span>(&amp;<span class="ruby-value">:name</span>).<span class="ruby-identifier">sort</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- branch_names-source -->
</div>
</div><!-- branch_names-method -->
<div id="method-i-branches" class="method-detail ">
<div class="method-heading">
<span class="method-name">branches</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Returns an Array of Branches</p>
<div class="method-source-code" id="branches-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 58</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">branches</span>
<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">branches</span>.<span class="ruby-identifier">sort_by</span>(&amp;<span class="ruby-value">:name</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- branches-source -->
</div>
</div><!-- branches-method -->
<div id="method-i-commit" class="method-detail ">
<div class="method-heading">
<span class="method-name">commit</span><span
class="method-args">(commit_id = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="commit-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commit</span>(<span class="ruby-identifier">commit_id</span> = <span class="ruby-keyword">nil</span>)
<span class="ruby-constant">Commit</span>.<span class="ruby-identifier">find_or_first</span>(<span class="ruby-identifier">repo</span>, <span class="ruby-identifier">commit_id</span>, <span class="ruby-identifier">root_ref</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- commit-source -->
</div>
</div><!-- commit-method -->
<div id="method-i-commits" class="method-detail ">
<div class="method-heading">
<span class="method-name">commits</span><span
class="method-args">(ref, path = nil, limit = nil, offset = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="commits-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commits</span>(<span class="ruby-identifier">ref</span>, <span class="ruby-identifier">path</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">limit</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">offset</span> = <span class="ruby-keyword">nil</span>)
<span class="ruby-constant">Commit</span>.<span class="ruby-identifier">commits</span>(<span class="ruby-identifier">repo</span>, <span class="ruby-identifier">ref</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">limit</span>, <span class="ruby-identifier">offset</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- commits-source -->
</div>
</div><!-- commits-method -->
<div id="method-i-commits_between" class="method-detail ">
<div class="method-heading">
<span class="method-name">commits_between</span><span
class="method-args">(from, to)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="commits_between-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 39</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commits_between</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
<span class="ruby-constant">Commit</span>.<span class="ruby-identifier">commits_between</span>(<span class="ruby-identifier">repo</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- commits_between-source -->
</div>
</div><!-- commits_between-method -->
<div id="method-i-commits_since" class="method-detail ">
<div class="method-heading">
<span class="method-name">commits_since</span><span
class="method-args">(date)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="commits_since-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 27</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commits_since</span>(<span class="ruby-identifier">date</span>)
<span class="ruby-constant">Commit</span>.<span class="ruby-identifier">commits_since</span>(<span class="ruby-identifier">repo</span>, <span class="ruby-identifier">date</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- commits_since-source -->
</div>
</div><!-- commits_since-method -->
<div id="method-i-commits_with_refs" class="method-detail ">
<div class="method-heading">
<span class="method-name">commits_with_refs</span><span
class="method-args">(n = 20)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="commits_with_refs-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commits_with_refs</span>(<span class="ruby-identifier">n</span> = <span class="ruby-value">20</span>)
<span class="ruby-constant">Commit</span>.<span class="ruby-identifier">commits_with_refs</span>(<span class="ruby-identifier">repo</span>, <span class="ruby-identifier">n</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- commits_with_refs-source -->
</div>
</div><!-- commits_with_refs-method -->
<div id="method-i-destroy_repository" class="method-detail ">
<div class="method-heading">
<span class="method-name">destroy_repository</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="destroy_repository-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 93</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">destroy_repository</span>
<span class="ruby-identifier">git_host</span>.<span class="ruby-identifier">remove_repository</span>(<span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- destroy_repository-source -->
</div>
</div><!-- destroy_repository-method -->
<div id="method-i-discover_default_branch" class="method-detail ">
<div class="method-heading">
<span class="method-name">discover_default_branch</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Discovers the default branch based on the repositorys available branches</p>
<ul><li>
<p>If no branches are present, returns nil</p>
</li><li>
<p>If one branch is present, returns its name</p>
</li><li>
<p>If two or more branches are present, returns the one that has a name
matching <a href="Repository.html#method-i-root_ref">#root_ref</a>
(default_branch or master if default_branch is nil)</p>
</li></ul>
<div class="method-source-code" id="discover_default_branch-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 128</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">discover_default_branch</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">branch_names</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
<span class="ruby-keyword">nil</span>
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">branch_names</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
<span class="ruby-identifier">branch_names</span>.<span class="ruby-identifier">first</span>
<span class="ruby-keyword">else</span>
<span class="ruby-identifier">branch_names</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">root_ref</span> }.<span class="ruby-identifier">first</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- discover_default_branch-source -->
</div>
</div><!-- discover_default_branch-method -->
<div id="method-i-empty_repo-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">empty_repo?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="empty_repo-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">empty_repo?</span>
<span class="ruby-operator">!</span><span class="ruby-identifier">repo_exists?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">has_commits?</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- empty_repo-3F-source -->
</div>
</div><!-- empty_repo-3F-method -->
<div id="method-i-fresh_commits" class="method-detail ">
<div class="method-heading">
<span class="method-name">fresh_commits</span><span
class="method-args">(n = 10)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="fresh_commits-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">fresh_commits</span>(<span class="ruby-identifier">n</span> = <span class="ruby-value">10</span>)
<span class="ruby-constant">Commit</span>.<span class="ruby-identifier">fresh_commits</span>(<span class="ruby-identifier">repo</span>, <span class="ruby-identifier">n</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- fresh_commits-source -->
</div>
</div><!-- fresh_commits-method -->
<div id="method-i-has_commits-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">has_commits?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="has_commits-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 138</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">has_commits?</span>
<span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">commit</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Grit</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchPathError</span>
<span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- has_commits-3F-source -->
</div>
</div><!-- has_commits-3F-method -->
<div id="method-i-has_post_receive_file-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">has_post_receive_file?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="has_post_receive_file-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 47</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">has_post_receive_file?</span>
<span class="ruby-identifier">hook_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path_to_repo</span>, <span class="ruby-string">'hooks'</span>, <span class="ruby-string">'post-receive'</span>)
<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">hook_file</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- has_post_receive_file-3F-source -->
</div>
</div><!-- has_post_receive_file-3F-method -->
<div id="method-i-heads" class="method-detail ">
<div class="method-heading">
<span class="method-name">heads</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="heads-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 103</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">heads</span>
<span class="ruby-ivar">@heads</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">repo</span>.<span class="ruby-identifier">heads</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- heads-source -->
</div>
</div><!-- heads-method -->
<div id="method-i-http_url_to_repo" class="method-detail ">
<div class="method-heading">
<span class="method-name">http_url_to_repo</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="http_url_to_repo-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 183</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">http_url_to_repo</span>
<span class="ruby-identifier">http_url</span> = [<span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">url</span>, <span class="ruby-string">&quot;/&quot;</span>, <span class="ruby-identifier">path</span>, <span class="ruby-string">&quot;.git&quot;</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">''</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- http_url_to_repo-source -->
</div>
</div><!-- http_url_to_repo-method -->
<div id="method-i-last_commit_for" class="method-detail ">
<div class="method-heading">
<span class="method-name">last_commit_for</span><span
class="method-args">(ref, path = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="last_commit_for-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 35</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">last_commit_for</span>(<span class="ruby-identifier">ref</span>, <span class="ruby-identifier">path</span> = <span class="ruby-keyword">nil</span>)
<span class="ruby-identifier">commits</span>(<span class="ruby-identifier">ref</span>, <span class="ruby-identifier">path</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- last_commit_for-source -->
</div>
</div><!-- last_commit_for-method -->
<div id="method-i-open_branches" class="method-detail ">
<div class="method-heading">
<span class="method-name">open_branches</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="open_branches-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 113</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">open_branches</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">protected_branches</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">heads</span>
<span class="ruby-keyword">else</span>
<span class="ruby-identifier">pnames</span> = <span class="ruby-identifier">protected_branches</span>.<span class="ruby-identifier">map</span>(&amp;<span class="ruby-value">:name</span>)
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">heads</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pnames</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">h</span>.<span class="ruby-identifier">name</span>) }
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">sort_by</span>(&amp;<span class="ruby-value">:name</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- open_branches-source -->
</div>
</div><!-- open_branches-method -->
<div id="method-i-path_to_repo" class="method-detail ">
<div class="method-heading">
<span class="method-name">path_to_repo</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="path_to_repo-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 85</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">path_to_repo</span>
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">git_base_path</span>, <span class="ruby-node">&quot;#{path}.git&quot;</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- path_to_repo-source -->
</div>
</div><!-- path_to_repo-method -->
<div id="method-i-protected_branch-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">protected_branch?</span><span
class="method-args">(branch_name)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Check if current branch name is marked as protected in the system</p>
<div class="method-source-code" id="protected_branch-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">protected_branch?</span> <span class="ruby-identifier">branch_name</span>
<span class="ruby-identifier">protected_branches</span>.<span class="ruby-identifier">map</span>(&amp;<span class="ruby-value">:name</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">branch_name</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- protected_branch-3F-source -->
</div>
</div><!-- protected_branch-3F-method -->
<div id="method-i-ref_names" class="method-detail ">
<div class="method-heading">
<span class="method-name">ref_names</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Returns an Array of branch and tag names</p>
<div class="method-source-code" id="ref_names-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 73</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ref_names</span>
[<span class="ruby-identifier">branch_names</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">tag_names</span>].<span class="ruby-identifier">flatten</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- ref_names-source -->
</div>
</div><!-- ref_names-method -->
<div id="method-i-repo" class="method-detail ">
<div class="method-heading">
<span class="method-name">repo</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="repo-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 77</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">repo</span>
<span class="ruby-ivar">@repo</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Grit</span><span class="ruby-operator">::</span><span class="ruby-constant">Repo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path_to_repo</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- repo-source -->
</div>
</div><!-- repo-method -->
<div id="method-i-repo_exists-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">repo_exists?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="repo_exists-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 97</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">repo_exists?</span>
<span class="ruby-ivar">@repo_exists</span> <span class="ruby-operator">||=</span> (<span class="ruby-identifier">repo</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">repo</span>.<span class="ruby-identifier">branches</span>.<span class="ruby-identifier">empty?</span>)
<span class="ruby-keyword">rescue</span>
<span class="ruby-ivar">@repo_exists</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- repo_exists-3F-source -->
</div>
</div><!-- repo_exists-3F-method -->
<div id="method-i-root_ref" class="method-detail ">
<div class="method-heading">
<span class="method-name">root_ref</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="root_ref-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 144</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">root_ref</span>
<span class="ruby-identifier">default_branch</span> <span class="ruby-operator">||</span> <span class="ruby-string">&quot;master&quot;</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- root_ref-source -->
</div>
</div><!-- root_ref-method -->
<div id="method-i-root_ref-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">root_ref?</span><span
class="method-args">(branch)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="root_ref-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 148</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">root_ref?</span>(<span class="ruby-identifier">branch</span>)
<span class="ruby-identifier">root_ref</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">branch</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- root_ref-3F-source -->
</div>
</div><!-- root_ref-3F-method -->
<div id="method-i-satellite" class="method-detail ">
<div class="method-heading">
<span class="method-name">satellite</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="satellite-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 43</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">satellite</span>
<span class="ruby-ivar">@satellite</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">Satellite</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- satellite-source -->
</div>
</div><!-- satellite-method -->
<div id="method-i-ssh_url_to_repo" class="method-detail ">
<div class="method-heading">
<span class="method-name">ssh_url_to_repo</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="ssh_url_to_repo-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 179</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ssh_url_to_repo</span>
<span class="ruby-identifier">url_to_repo</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- ssh_url_to_repo-source -->
</div>
</div><!-- ssh_url_to_repo-method -->
<div id="method-i-tag_names" class="method-detail ">
<div class="method-heading">
<span class="method-name">tag_names</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Returns an Array of tag names</p>
<div class="method-source-code" id="tag_names-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 63</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">tag_names</span>
<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">collect</span>(&amp;<span class="ruby-value">:name</span>).<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">reverse</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- tag_names-source -->
</div>
</div><!-- tag_names-method -->
<div id="method-i-tags" class="method-detail ">
<div class="method-heading">
<span class="method-name">tags</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Returns an Array of Tags</p>
<div class="method-source-code" id="tags-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 68</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">tags</span>
<span class="ruby-identifier">repo</span>.<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">sort_by</span>(&amp;<span class="ruby-value">:name</span>).<span class="ruby-identifier">reverse</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- tags-source -->
</div>
</div><!-- tags-method -->
<div id="method-i-tree" class="method-detail ">
<div class="method-heading">
<span class="method-name">tree</span><span
class="method-args">(fcommit, path = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="tree-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 107</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">tree</span>(<span class="ruby-identifier">fcommit</span>, <span class="ruby-identifier">path</span> = <span class="ruby-keyword">nil</span>)
<span class="ruby-identifier">fcommit</span> = <span class="ruby-identifier">commit</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">fcommit</span> <span class="ruby-operator">==</span> <span class="ruby-value">:head</span>
<span class="ruby-identifier">tree</span> = <span class="ruby-identifier">fcommit</span>.<span class="ruby-identifier">tree</span>
<span class="ruby-identifier">path</span> <span class="ruby-operator">?</span> (<span class="ruby-identifier">tree</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">path</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">tree</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- tree-source -->
</div>
</div><!-- tree-method -->
<div id="method-i-update_repository" class="method-detail ">
<div class="method-heading">
<span class="method-name">update_repository</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="update_repository-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 89</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update_repository</span>
<span class="ruby-identifier">git_host</span>.<span class="ruby-identifier">update_repository</span>(<span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- update_repository-source -->
</div>
</div><!-- update_repository-method -->
<div id="method-i-url_to_repo" class="method-detail ">
<div class="method-heading">
<span class="method-name">url_to_repo</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="url_to_repo-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 81</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">url_to_repo</span>
<span class="ruby-identifier">git_host</span>.<span class="ruby-identifier">url_to_repo</span>(<span class="ruby-identifier">path</span>)
<span class="ruby-keyword">end</span></pre>
</div><!-- url_to_repo-source -->
</div>
</div><!-- url_to_repo-method -->
<div id="method-i-valid_repo-3F" class="method-detail ">
<div class="method-heading">
<span class="method-name">valid_repo?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="valid_repo-3F-source">
<pre><span class="ruby-comment"># File app/roles/repository.rb, line 4</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">valid_repo?</span>
<span class="ruby-identifier">repo</span>
<span class="ruby-keyword">rescue</span>
<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-value">:path</span>, <span class="ruby-string">&quot;Invalid repository path&quot;</span>)
<span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- valid_repo-3F-source -->
</div>
</div><!-- valid_repo-3F-method -->
</section><!-- public-instance-method-details -->
</section><!-- 5Buntitled-5D -->
</div><!-- documentation -->
<footer id="validator-badges">
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>