Class: CVSDownloadStrategy
- Inherits:
-
VCSDownloadStrategy
- Object
- AbstractDownloadStrategy
- VCSDownloadStrategy
- CVSDownloadStrategy
- 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
Attributes inherited from AbstractDownloadStrategy
Instance Method Summary collapse
- #initialize(url, name, version, **meta) ⇒ void constructor 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?, #last_commit
Methods inherited from AbstractDownloadStrategy
#basename, #cached_location, #clear_cache, #fetch, #fetched_size, #ohai, #quiet!, #quiet?, #stage, #total_size
Methods included from Utils::Output::Mixin
#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled
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.
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 |
# File 'download_strategy.rb', line 1315 def initialize(url, name, version, **) super @url = T.let(@url.sub(%r{^cvs://}, ""), String) @module = T.let( if .key?(:module) .fetch(:module) elsif !@url.match?(%r{:[^/]+$}) name else mod, url = split_url(@url) @url = T.let(url, String) mod end, String ) end |
Instance Method Details
#source_modified_time ⇒ Time
Returns the most recent modified time for all files in the current working directory after stage.
1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 |
# File 'download_strategy.rb', line 1336 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 |