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 VCSDownloadStrategy
Attributes inherited from AbstractDownloadStrategy
Instance Method Summary collapse
- #initialize(url, name, version, **meta) ⇒ void constructor private
-
#last_commit ⇒ String
Return last commit's unique identifier for the repository.
- #repo_valid? ⇒ Boolean private
-
#source_modified_time ⇒ Time
Returns the most recent modified time for all files in the current working directory after stage.
Methods inherited from VCSDownloadStrategy
#commit_outdated?, #fetch, #fetch_last_commit, #head?
Methods inherited from AbstractDownloadStrategy
#basename, #cached_location, #clear_cache, #fetch, #quiet!, #quiet?, #stage
Methods included from SystemCommand::Mixin
#system_command, #system_command!
Methods included from Context
current, current=, #debug?, #quiet?, #verbose?, #with_context
Constructor Details
#initialize(url, name, version, **meta) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
1536 1537 1538 1539 |
# File 'download_strategy.rb', line 1536 def initialize(url, name, version, **) super @url = T.let(@url.sub(%r{^fossil://}, ""), String) end |
Instance Method Details
#last_commit ⇒ String
Return last commit's unique identifier for the repository.
1554 1555 1556 1557 |
# File 'download_strategy.rb', line 1554 def last_commit out = silent_command("fossil", args: ["info", "tip", "-R", cached_location]).stdout T.must(out[/^uuid: +(\h+) .+$/, 1]) end |
#repo_valid? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
1560 1561 1562 |
# File 'download_strategy.rb', line 1560 def repo_valid? silent_command("fossil", args: ["branch", "-R", cached_location]).success? end |
#source_modified_time ⇒ Time
Returns the most recent modified time for all files in the current working directory after stage.
1545 1546 1547 1548 |
# File 'download_strategy.rb', line 1545 def source_modified_time out = silent_command("fossil", args: ["info", "tip", "-R", cached_location]).stdout Time.parse(T.must(out[/^uuid: +\h+ (.+)$/, 1])) end |