Class: Houston::Adapters::VersionControl::GitAdapter::RemoteRepo

Inherits:
Repo
  • Object
show all
Defined in:
app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb

Direct Known Subclasses

GithubRepo

Constant Summary collapse

RETRY_COOLDOWN =

seconds

4

Instance Attribute Summary

Attributes inherited from Repo

#location

Instance Method Summary collapse

Methods inherited from Repo

#all_commit_times, #all_commits, #ancestors, #ancestors_until, #branch, #branches, #branches_at, #changes, #commits_between, #exists?, #find_file, #native_commit, #read_file, #ref, #to_s

Constructor Details

#initialize(git_path, location) ⇒ RemoteRepo

Returns a new instance of RemoteRepo.



10
11
12
13
14
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 10

def initialize(git_path, location)
  super location
  @git_path = git_path.to_s
  @branch_location = :remote
end

Instance Method Details

#clone!(async: false) ⇒ Object



34
35
36
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 34

def clone!(async: false)
  async ? Houston.async { _clone!(true) } : _clone!(false)
end

#git_pathObject



30
31
32
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 30

def git_path
  @git_path
end

#originObject



42
43
44
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 42

def origin
  @origin ||= connection.remotes["origin"]
end

#pull!(async: false) ⇒ Object



38
39
40
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 38

def pull!(async: false)
  async ? Houston.async { _pull!(true) } : _pull!(false)
end

#refresh!(async: false) ⇒ Object

Public API for a VersionControl::Adapter Repo ————————————————————————- #



21
22
23
24
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 21

def refresh!(async: false)
  return clone!(async: async) unless exists?
  pull!(async: async)
end