Module: CodeCache

Defined in:
lib/code_cache.rb,
lib/code_cache/repo.rb,
lib/code_cache/repo/git.rb,
lib/code_cache/repo/svn.rb

Defined Under Namespace

Classes: BadRepo, BranchNotFound, CacheCalculationError, CacheCorruptionError, CopyError, Repo, UnknownCheckoutError, UpdateError

Class Method Summary collapse

Class Method Details

.identify(url) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/code_cache.rb', line 6

def self.identify(url)
  if (url =~ /.*\.git\s*$/)
    :git
  else
    :svn
  end
end

.repo(url, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/code_cache.rb', line 14

def self.repo(url, options = {})
  if self.identify(url) == :git
    Repo::Git.new(url, options)
  else
    Repo::SVN.new(url, options)
  end
end