Class: FossilDownloadStrategy

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

Constant Summary

Constants inherited from VCSDownloadStrategy

VCSDownloadStrategy::REF_TYPES

Instance Attribute Summary

Attributes inherited from AbstractDownloadStrategy

#cached_location, #meta, #name, #resource, #shutup, #version

Instance Method Summary collapse

Methods inherited from VCSDownloadStrategy

#cached_location, #commit_outdated?, #fetch, #fetch_last_commit

Methods inherited from AbstractDownloadStrategy

#clear_cache, #expand_safe_system_args, #fetch, #ohai, #puts, #quiet_safe_system, #safe_system, #shutup!

Methods included from FileUtils

#make, mkdir, mktemp, #old_mkdir, #old_ruby, #ruby, #scons, #xcodebuild

Constructor Details

#initialize(name, resource) ⇒ FossilDownloadStrategy

Returns a new instance of FossilDownloadStrategy



1076
1077
1078
1079
# File 'Library/Homebrew/download_strategy.rb', line 1076

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

Instance Method Details

#last_commitObject



1092
1093
1094
# File 'Library/Homebrew/download_strategy.rb', line 1092

def last_commit
  Utils.popen_read("fossil", "info", "tip", "-R", cached_location.to_s)[/^uuid: +(\h+) .+$/, 1]
end

#source_modified_timeObject



1088
1089
1090
# File 'Library/Homebrew/download_strategy.rb', line 1088

def source_modified_time
  Time.parse Utils.popen_read("fossil", "info", "tip", "-R", cached_location.to_s)[/^uuid: +\h+ (.+)$/, 1]
end

#stageObject



1081
1082
1083
1084
1085
1086
# File 'Library/Homebrew/download_strategy.rb', line 1081

def stage
  super
  args = [fossilpath, "open", cached_location]
  args << @ref if @ref_type && @ref
  safe_system(*args)
end