Module: Amp::Repositories

Defined in:
lib/amp.rb,
lib/amp/repository/lock.rb,
lib/amp/repository/store.rb,
lib/amp/repository/dir_state.rb,
lib/amp/repository/updatable.rb,
lib/amp/repository/repository.rb,
lib/amp/repository/tag_manager.rb,
lib/amp/repository/verification.rb,
lib/amp/repository/branch_manager.rb,
lib/amp/repository/repositories/local_repository.rb,
lib/amp/repository/repositories/bundle_repository.rb,
lib/amp/repository/repositories/http_repository.rb

Defined Under Namespace

Modules: BranchManager, Stores, TagManager, Updatable, Verification Classes: BundleRepository, DirState, DirStateEntry, HTTPRepository, HTTPSRepository, LocalRepository, Lock, RepoError, Repository, RepositoryCapabilityError

Constant Summary collapse

MichaelScott =

hehehe

BranchManager

Class Method Summary collapse

Class Method Details

.find_repo(path) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/amp/repository/repository.rb', line 13

def self.find_repo path
  while !(File.directory?(File.join(path, ".hg")))
    old_path, path = path, File.dirname(path)
    if path == old_path
      raise "No Repository Found"
    end
  end
  path
end

.pick(config, path = '', create = false) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/amp/repository/repository.rb', line 4

def self.pick(config, path='', create=false)
  # hot path so we don't load the HTTP repos!
  unless path[0,4] == "http"
    return LocalRepository.new(find_repo(path), create, config)
  end
  return HTTPSRepository.new(path, create, config) if path[0,5] == "https"
  return HTTPRepository.new(path, create, config)  if path[0,4] == "http"
end