Class: CVSDownloadStrategy

Inherits:
VCSDownloadStrategy show all
Extended by:
T::Sig
Defined in:
download_strategy.rb

Overview

Strategy for downloading a CVS repository.

Constant Summary

Constants inherited from VCSDownloadStrategy

VCSDownloadStrategy::REF_TYPES

Instance Attribute Summary

Attributes inherited from VCSDownloadStrategy

#last_commit

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, #quiet?, #shutup!, #stage

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

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

Returns a new instance of CVSDownloadStrategy.



1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
# File 'download_strategy.rb', line 1054

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

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

Instance Method Details

#source_modified_timeTime



1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'download_strategy.rb', line 1070

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