Class: BazaarDownloadStrategy

Inherits:
VCSDownloadStrategy show all
Extended by:
T::Sig
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

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) ⇒ BazaarDownloadStrategy

Returns a new instance of BazaarDownloadStrategy.



1200
1201
1202
1203
# File 'download_strategy.rb', line 1200

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

Instance Method Details

#last_commitString



1219
1220
1221
1222
# File 'download_strategy.rb', line 1219

def last_commit
  out, = silent_command("bzr", args: ["revno", cached_location])
  out.chomp
end

#source_modified_timeTime



1208
1209
1210
1211
1212
1213
1214
# File 'download_strategy.rb', line 1208

def source_modified_time
  out, = silent_command("bzr", args: ["log", "-l", "1", "--timezone=utc", cached_location])
  timestamp = out.chomp
  raise "Could not get any timestamps from bzr!" if timestamp.blank?

  Time.parse(timestamp)
end