Class: FossilDownloadStrategy
- Inherits:
-
VCSDownloadStrategy
- Object
- AbstractDownloadStrategy
- VCSDownloadStrategy
- FossilDownloadStrategy
- Defined in:
- download_strategy.rb
Overview
Strategy for downloading a Fossil repository.
Constant Summary
Constants inherited from VCSDownloadStrategy
VCSDownloadStrategy::REF_TYPES
Instance Attribute Summary
Attributes inherited from AbstractDownloadStrategy
#cache, #cached_location, #url
Instance Method Summary collapse
-
#initialize(url, name, version, **meta) ⇒ FossilDownloadStrategy
constructor
A new instance of FossilDownloadStrategy.
-
#last_commit ⇒ String
-
#repo_valid? ⇒ Boolean
-
#source_modified_time ⇒ Time
Methods inherited from VCSDownloadStrategy
#commit_outdated?, #fetch, #fetch_last_commit, #head?
Methods inherited from AbstractDownloadStrategy
#basename, #clear_cache, #fetch, #quiet?, #shutup!, #stage
Methods included from Context
current, current=, #debug?, #quiet?, #verbose?, #with_context
Constructor Details
#initialize(url, name, version, **meta) ⇒ FossilDownloadStrategy
Returns a new instance of FossilDownloadStrategy.
1349 1350 1351 1352 |
# File 'download_strategy.rb', line 1349 def initialize(url, name, version, **) super @url = @url.sub(%r{^fossil://}, "") end |
Instance Method Details
#last_commit ⇒ String
1365 1366 1367 1368 |
# File 'download_strategy.rb', line 1365 def last_commit out, = silent_command("fossil", args: ["info", "tip", "-R", cached_location]) out[/^uuid: +(\h+) .+$/, 1] end |
#repo_valid? ⇒ Boolean
1370 1371 1372 |
# File 'download_strategy.rb', line 1370 def repo_valid? silent_command("fossil", args: ["branch", "-R", cached_location]).success? end |