Sha256: f62362061774c19e396fd11437990ed8dc7cb9ba70896c9e972b1a93aa327c98
Contents?: true
Size: 1017 Bytes
Versions: 9
Compression:
Stored size: 1017 Bytes
Contents
#!/usr/bin/env ratch # Publish website to rubyforge # # This task publishes the source dir (deafult 'doc') # to a rubyforge website. main :publish do config = configuration['publish'] project = config['project'] subdir = config['subdir'] source = config['source'] || "doc" 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
9 entries across 9 versions & 1 rubygems