Sha256: 4f6b17267568aa37e907cf3a1424e85a85b729cfbef053956f8962d50637c3fb

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ratch

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

main :publish do
  config = configuration['publish']

  project     = config['project']
  subdir      = config['subdir']
  source      = config['source'] || "doc/site"
  username    = config['username']
  protect     = %w{usage statcvs statsvn robot.txt wiki}
  exclude     = %w{.svn}

  abort "no project"  unless project
  abort "no username" unless username

  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.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]

  rsync(*args.to_params)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-2.0.0 task/publish
facets-2.0.1 task/publish
facets-2.0.2 task/publish