Class: Drupid::DownloadStrategy::Subversion
- Inherits:
-
Base
- Object
- Base
- Drupid::DownloadStrategy::Subversion
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 = {}) ⇒ Subversion
Returns a new instance of Subversion.
350
351
352
353
|
# File 'lib/drupid/download_strategy.rb', line 350
def initialize url, dest, name, download_specs = {}
super
@co = @dest + @name
end
|
Instance Method Details
#fetch ⇒ Object
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
# File 'lib/drupid/download_strategy.rb', line 355
def fetch
@url.sub!(/^svn\+/, '') if @url =~ %r[^svn\+http://]
blah "Checking out #{@url}"
if @specs.has_key?('revision')
fetch_repo @co, @url, @specs['revision']
else
fetch_repo @co, @url
end
end
|
#fetch_repo(target, url, revision = nil, ignore_externals = false) ⇒ Object
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
# File 'lib/drupid/download_strategy.rb', line 389
def fetch_repo target, url, revision=nil, ignore_externals=false
svncommand = target.exist? ? 'up' : 'checkout'
args = [svncommand]
args << '--non-interactive' unless @specs.has_key?('interactive') and 'true' == @specs.has_key?('interactive')
args << '--trust-server-cert'
args << url if !target.exist?
args << target
args << '-r' << revision if revision
args << '--ignore-externals' if ignore_externals
svn(*args)
end
|
#get_externals ⇒ Object
381
382
383
384
385
386
387
|
# File 'lib/drupid/download_strategy.rb', line 381
def get_externals
output = svn 'propget', 'svn:externals', @url
output.chomp.each_line do |line|
name, url = line.split(/\s+/)
yield name, url
end
end
|
#stage(wd = @dest) ⇒ Object
373
374
375
376
377
378
379
|
# File 'lib/drupid/download_strategy.rb', line 373
def stage wd = @dest
fetch unless @co.exist?
dont_debug { wd.mkpath }
debug "Staging into #{wd}"
target = wd + @co.basename
svn 'export', '--force', @co, target
end
|