Make repo_valid? private

This commit is contained in:
Jack Nagel 2014-12-06 12:29:15 -05:00
parent f43fe41423
commit a2dbcfee5b

View File

@ -352,10 +352,6 @@ class S3DownloadStrategy < CurlDownloadStrategy
end end
class SubversionDownloadStrategy < VCSDownloadStrategy class SubversionDownloadStrategy < VCSDownloadStrategy
def repo_valid?
@clone.join(".svn").directory?
end
def repo_url def repo_url
`svn info '#{@clone}' 2>/dev/null`.strip[/^URL: (.+)$/, 1] `svn info '#{@clone}' 2>/dev/null`.strip[/^URL: (.+)$/, 1]
end end
@ -428,6 +424,10 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
def cache_tag def cache_tag
head? ? "svn-HEAD" : "svn" head? ? "svn-HEAD" : "svn"
end end
def repo_valid?
@clone.join(".svn").directory?
end
end end
StrictSubversionDownloadStrategy = SubversionDownloadStrategy StrictSubversionDownloadStrategy = SubversionDownloadStrategy
@ -642,10 +642,6 @@ class MercurialDownloadStrategy < VCSDownloadStrategy
end end
end end
def repo_valid?
@clone.join(".hg").directory?
end
def clone_repo def clone_repo
url = @url.sub(%r[^hg://], '') url = @url.sub(%r[^hg://], '')
safe_system hgpath, 'clone', url, @clone safe_system hgpath, 'clone', url, @clone
@ -669,6 +665,10 @@ class MercurialDownloadStrategy < VCSDownloadStrategy
"hg" "hg"
end end
def repo_valid?
@clone.join(".hg").directory?
end
def hgpath def hgpath
@path ||= %W[ @path ||= %W[
#{which("hg")} #{which("hg")}
@ -679,10 +679,6 @@ class MercurialDownloadStrategy < VCSDownloadStrategy
end end
class BazaarDownloadStrategy < VCSDownloadStrategy class BazaarDownloadStrategy < VCSDownloadStrategy
def repo_valid?
@clone.join(".bzr").directory?
end
def fetch def fetch
ohai "Cloning #{@url}" ohai "Cloning #{@url}"
@ -717,6 +713,10 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
"bzr" "bzr"
end end
def repo_valid?
@clone.join(".bzr").directory?
end
def bzrpath def bzrpath
@path ||= %W[ @path ||= %W[
#{which("bzr")} #{which("bzr")}