Class: CVSDownloadStrategy
- Inherits:
-
VCSDownloadStrategy
- Object
- AbstractDownloadStrategy
- VCSDownloadStrategy
- CVSDownloadStrategy
- Defined in:
- download_strategy/cvs_download_strategy.rb
Overview
Strategy for downloading a CVS repository.
Constant Summary
Constants inherited from VCSDownloadStrategy
VCSDownloadStrategy::REF_TYPES
Constants inherited from AbstractDownloadStrategy
AbstractDownloadStrategy::HOMEBREW_CONTROLLED_STRATEGIES
Instance Attribute Summary
Attributes inherited from VCSDownloadStrategy
Attributes inherited from AbstractDownloadStrategy
Instance Method Summary collapse
-
#initialize(url, name, version, **meta) ⇒ void
constructor
private
Formula
urlspecs reach download strategies as arbitrary options. -
#source_modified_time ⇒ Time
Returns the most recent modified time for all files in the current working directory after stage.
Methods inherited from VCSDownloadStrategy
#command_sandbox, #commit_outdated?, #fetch, #fetch_last_commit, #fetching?, #head?, #last_commit, #sandbox_write_path
Methods inherited from AbstractDownloadStrategy
#basename, #cached_location, #chdir, #clear_cache, expand_deferred_environment_for?, #fetch, #fetched_size, #ohai, #quiet!, #quiet?, #source_revision, #stage, #total_size
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_once, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_incompatible, #pretty_install_status, #pretty_installed, #pretty_removed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning
Methods included from SystemCommand::Mixin
#command_sandbox, #system_command, #system_command!
Methods included from Context
current, current=, #debug?, #deferred_environment_expansion?, #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.
Formula url specs reach download strategies as arbitrary options.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'download_strategy/cvs_download_strategy.rb', line 12 def initialize(url, name, version, **) super @url = T.let(@url.sub(%r{^cvs://}, ""), String) resolved_module = if .key?(:module) .fetch(:module) elsif !@url.match?(%r{:[^/]+$}) name else parts = @url.split(":") mod = parts.pop raise ArgumentError, "CVS URL #{@url.inspect} does not end with a module name" if mod.nil? @url = T.let(parts.join(":"), String) mod end @module = T.let(resolved_module, 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.
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'download_strategy/cvs_download_strategy.rb', line 35 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 |