Class: BazaarDownloadStrategy
- Inherits:
-
VCSDownloadStrategy
- Object
- AbstractDownloadStrategy
- VCSDownloadStrategy
- BazaarDownloadStrategy
- Defined in:
- download_strategy.rb
Overview
Strategy for downloading a Bazaar repository.
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) ⇒ BazaarDownloadStrategy
constructor
A new instance of BazaarDownloadStrategy.
-
#last_commit ⇒ String
Return last commit's unique identifier for the repository.
-
#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?
Methods inherited from AbstractDownloadStrategy
#basename, #clear_cache, #fetch, #quiet!, #quiet?, #stage
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) ⇒ BazaarDownloadStrategy
Returns a new instance of BazaarDownloadStrategy.
1343 1344 1345 1346 |
# File 'download_strategy.rb', line 1343 def initialize(url, name, version, **) super @url = @url.sub(%r{^bzr://}, "") end |
Instance Method Details
#last_commit ⇒ String
Return last commit's unique identifier for the repository.
1364 1365 1366 1367 |
# File 'download_strategy.rb', line 1364 def last_commit out, = silent_command("bzr", args: ["revno", cached_location]) out.chomp end |
#source_modified_time ⇒ Time
Returns the most recent modified time for all files in the current working directory after stage.
1352 1353 1354 1355 1356 1357 1358 |
# File 'download_strategy.rb', line 1352 def source_modified_time out, = silent_command("bzr", args: ["log", "-l", "1", "--timezone=utc", cached_location]) = out.chomp raise "Could not get any timestamps from bzr!" if .blank? Time.parse() end |