Class: GitDownloadStrategy
- Inherits:
-
VCSDownloadStrategy
- Object
- AbstractDownloadStrategy
- VCSDownloadStrategy
- GitDownloadStrategy
- Defined in:
- download_strategy.rb
Overview
Strategy for downloading a Git repository.
Direct Known Subclasses
Constant Summary
Constants inherited from VCSDownloadStrategy
VCSDownloadStrategy::REF_TYPES
Instance Attribute Summary
Attributes inherited from AbstractDownloadStrategy
#cache, #cached_location, #url
Instance Method Summary collapse
-
#initialize(url, name, version, **meta) ⇒ GitDownloadStrategy
constructor
A new instance of GitDownloadStrategy.
-
#last_commit ⇒ String
-
#source_modified_time ⇒ Time
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) ⇒ GitDownloadStrategy
Returns a new instance of GitDownloadStrategy.
833 834 835 836 837 838 839 840 841 |
# File 'download_strategy.rb', line 833 def initialize(url, name, version, **) # Needs to be before the call to `super`, as the VCSDownloadStrategy's # constructor calls `cache_tag` and sets the cache path. @only_path = [:only_path] super @ref_type ||= :branch @ref ||= "master" end |
Instance Method Details
#last_commit ⇒ String
854 855 856 857 |
# File 'download_strategy.rb', line 854 def last_commit out, = silent_command("git", args: ["--git-dir", git_dir, "rev-parse", "--short=7", "HEAD"]) out.chomp end |