Class: CVSDownloadStrategy

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?, #last_commit

Methods inherited from AbstractDownloadStrategy

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

Constructor Details

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

Returns a new instance of CVSDownloadStrategy



855
856
857
858
859
860
861
862
863
864
865
866
# File 'brew/Library/Homebrew/download_strategy.rb', line 855

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

  if meta.key?(:module)
    @module = meta.fetch(:module)
  elsif @url !~ %r{:[^/]+$}
    @module = name
  else
    @module, @url = split_url(@url)
  end
end

Instance Method Details

#source_modified_timeObject



868
869
870
871
872
873
874
875
876
877
878
879
880
# File 'brew/Library/Homebrew/download_strategy.rb', line 868

def source_modified_time
  # Filter CVS's files because the timestamp for each of them is the moment
  # of clone.
  max_mtime = Time.at(0)
  cached_location.find do |f|
    Find.prune if f.directory? && f.basename.to_s == "CVS"
    next unless f.file?

    mtime = f.mtime
    max_mtime = mtime if mtime > max_mtime
  end
  max_mtime
end