Class: Houston::Adapters::VersionControl::GitAdapter::RemoteRepo
- Defined in:
- app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb
Direct Known Subclasses
Constant Summary collapse
- RETRY_COOLDOWN =
seconds
4
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Public API for a VersionControl::Adapter Repo ————————————————————————- #.
Instance Method Summary collapse
- #clone!(async: false) ⇒ Object
-
#initialize(connection, location) ⇒ RemoteRepo
constructor
A new instance of RemoteRepo.
- #origin ⇒ Object
- #pull!(async: false) ⇒ Object
- #refresh!(async: false) ⇒ Object
-
#to_s ⇒ Object
————————————————————————- #.
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
Constructor Details
#initialize(connection, location) ⇒ RemoteRepo
Returns a new instance of RemoteRepo.
9 10 11 12 13 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 9 def initialize(connection, location) super(connection) @location = location @branch_location = :remote end |
Instance Attribute Details
#location ⇒ Object (readonly)
Public API for a VersionControl::Adapter Repo ————————————————————————- #
20 21 22 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 20 def location @location end |
Instance Method Details
#clone!(async: false) ⇒ Object
35 36 37 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 35 def clone!(async: false) GitAdapter.clone!(location, connection.path, async: false) end |
#origin ⇒ Object
43 44 45 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 43 def origin @origin ||= connection.remotes["origin"] end |
#pull!(async: false) ⇒ Object
39 40 41 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 39 def pull!(async: false) async ? Houston.async { _pull!(true) } : _pull!(false) end |
#refresh!(async: false) ⇒ Object
22 23 24 25 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 22 def refresh!(async: false) return clone!(async: async) unless exists? pull!(async: async) end |
#to_s ⇒ Object
————————————————————————- #
29 30 31 |
# File 'app/adapters/houston/adapters/version_control/git_adapter/remote_repo.rb', line 29 def to_s location.to_s end |