Class: FossilDownloadStrategy

Inherits:
VCSDownloadStrategy show all
Defined in:
brew/Library/Homebrew/download_strategy.rb

Constant Summary

Constants inherited from VCSDownloadStrategy

VCSDownloadStrategy::REF_TYPES

Instance Attribute Summary

Attributes inherited from AbstractDownloadStrategy

#cache, #cached_location, #url

Instance Method Summary collapse

Methods inherited from VCSDownloadStrategy

#commit_outdated?, #fetch, #fetch_last_commit, #head?

Methods inherited from AbstractDownloadStrategy

#basename, #clear_cache, #fetch, #ohai, #puts, #shutup!, #stage

Constructor Details

#initialize(url, name, version, **meta) ⇒ FossilDownloadStrategy

Returns a new instance of FossilDownloadStrategy



1022
1023
1024
1025
# File 'brew/Library/Homebrew/download_strategy.rb', line 1022

def initialize(url, name, version, **meta)
  super
  @url = @url.sub(%r{^fossil://}, "")
end

Instance Method Details

#last_commitObject



1032
1033
1034
1035
# File 'brew/Library/Homebrew/download_strategy.rb', line 1032

def last_commit
  out, = system_command("fossil", args: ["info", "tip", "-R", cached_location])
  out[/^uuid: +(\h+) .+$/, 1]
end

#repo_valid?Boolean

Returns:

  • (Boolean)


1037
1038
1039
# File 'brew/Library/Homebrew/download_strategy.rb', line 1037

def repo_valid?
  system_command("fossil", args: ["branch", "-R", cached_location]).success?
end

#source_modified_timeObject



1027
1028
1029
1030
# File 'brew/Library/Homebrew/download_strategy.rb', line 1027

def source_modified_time
  out, = system_command("fossil", args: ["info", "tip", "-R", cached_location])
  Time.parse(out[/^uuid: +\h+ (.+)$/, 1])
end