Sha256: 88ef538ab5d29f6ff21dbe7a72852de932fb0aad085600d268545b3b5e03d960

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ratch

# publish website to rubyforge

# This task publishes the source dir (deafult doc/)
# to a rubyforge website.

config = config_load('publish')

project     = config['project']
subdir      = config['subdir']
source      = config['source'] || %w{web site doc}.find{|f| dir?(f)}
username    = config['username']
protect     = %w{usage statcvs statsvn robot.txt wiki}
exclude     = %w{.svn}

abort("no project name") unless project
abort("no username")     unless username
abort("no source dir")   unless source

if subdir
  destination = File.join(project, subdir)
else
  destination = project
end

dir = source.chomp('/') + '/'
url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{destination}"

# maybe -p ?
op = ['-rLvz', '--delete']
if File.file?(File.join(source,'.rsync-filter'))
  op << "--filter='dir-merge #{source}/.rsync-filter'"
else
  op.concat exclude.map{|e| "--filter='- #{e}'"}
  op.concat protect.map{|e| "--filter='P #{e}'"}
end

args = op + [dir, url]

#cd source do
  rsync *args
#end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ratch-0.1 data/mint/ratch/publish