Class: Drupid::DownloadStrategy::Fossil

Inherits:
Base
  • Object
show all
Defined in:
lib/drupid/download_strategy.rb

Instance Attribute Summary

Attributes inherited from Base

#dest, #name, #staged_path, #url

Instance Method Summary collapse

Methods included from Utils

#blah, #bzr, #compare_paths, #curl, #cvs, #debug, #dont_debug, #git, #hg, #ignore_interrupts, #interactive_shell, #odie, #ofail, #ohai, #owarn, #runBabyRun, #svn, #tempdir, #uncompress, #which, #writeFile

Constructor Details

#initialize(url, dest, name, download_specs = {}) ⇒ Fossil

Returns a new instance of Fossil.



540
541
542
543
# File 'lib/drupid/download_strategy.rb', line 540

def initialize  url, dest, name, download_specs = {}
  super
  @clone = @dest + @name
end

Instance Method Details

#fetchObject



545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/drupid/download_strategy.rb', line 545

def fetch
  raise "You must install fossil first" unless which "fossil"

  blah "Cloning #{@url}"
  unless @clone.exist?
    url=@url.sub(%r[^fossil://], '')
    runBabyRun 'fossil', ['clone', url, @clone]
  else
    blah "Updating #{@clone}"
    runBabyRun 'fossil', ['pull', '-R', @clone]
  end
end

#stageObject



558
559
560
561
562
563
564
565
# File 'lib/drupid/download_strategy.rb', line 558

def stage
  # TODO: The 'open' and 'checkout' commands are very noisy and have no '-q' option.
  runBabyRun 'fossil', ['open', @clone]
  #if @spec and @ref
  # ohai "Checking out #{@spec} #{@ref}"
  # safe_system 'fossil', 'checkout', @ref
  #end
end