Class: SubversionDownloadStrategy

Inherits:
VCSDownloadStrategy show all
Defined in:
Library/Homebrew/download_strategy.rb

Constant Summary

Constants inherited from VCSDownloadStrategy

VCSDownloadStrategy::REF_TYPES

Instance Attribute Summary

Attributes inherited from AbstractDownloadStrategy

#cached_location, #meta, #name, #resource, #shutup, #version

Instance Method Summary collapse

Methods inherited from VCSDownloadStrategy

#cached_location, #commit_outdated?, #fetch_last_commit

Methods inherited from AbstractDownloadStrategy

#clear_cache, #expand_safe_system_args, #ohai, #puts, #quiet_safe_system, #safe_system, #shutup!

Methods included from FileUtils

#make, mkdir, mktemp, #old_mkdir, #old_ruby, #ruby, #scons, #xcodebuild

Constructor Details

#initialize(name, resource) ⇒ SubversionDownloadStrategy

Returns a new instance of SubversionDownloadStrategy



608
609
610
611
# File 'Library/Homebrew/download_strategy.rb', line 608

def initialize(name, resource)
  super
  @url = @url.sub("svn+http://", "")
end

Instance Method Details

#fetchObject



613
614
615
616
# File 'Library/Homebrew/download_strategy.rb', line 613

def fetch
  clear_cache unless @url.chomp("/") == repo_url || quiet_system("svn", "switch", @url, cached_location)
  super
end

#last_commitObject



628
629
630
# File 'Library/Homebrew/download_strategy.rb', line 628

def last_commit
  Utils.popen_read("svn", "info", "--show-item", "revision", cached_location.to_s).strip
end

#source_modified_timeObject



623
624
625
626
# File 'Library/Homebrew/download_strategy.rb', line 623

def source_modified_time
  xml = REXML::Document.new(Utils.popen_read("svn", "info", "--xml", cached_location.to_s))
  Time.parse REXML::XPath.first(xml, "//date/text()").to_s
end

#stageObject



618
619
620
621
# File 'Library/Homebrew/download_strategy.rb', line 618

def stage
  super
  quiet_safe_system "svn", "export", "--force", cached_location, Dir.pwd
end