Sha256: e7ae439d8e3b9ced37c423b625e4933de0e9f4464a333a9577d3ea1dccdd5c8d
Contents?: true
Size: 1.38 KB
Versions: 4
Compression:
Stored size: 1.38 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}" op = ['-rLvz', '--delete'] # maybe -p ? # add filter options. The commandline version didn't seem # to work, so I opted for creating an .rsync_filter file for # all cases. filter_file = File.join(source,'.rsync-filter') unless file?(filter_file) File.open(filter_file, 'w') do |f| exclude.map{|e| f << "- #{e}\n"} protect.map{|e| f << "P #{e}\n"} end end op << "--filter='dir-merge #{filter_file}'" #if file?(filter_file) # op << "--filter='dir-merge #{filter_file}'" #else # NOT WORKING? # 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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ratch-0.2.1 | data/ratch/rubyproject/publish |
ratch-0.2.2 | data/ratch/rubyproject/publish |
ratch-0.2.3 | lib/ratch/toolset/ruby/publish |
ratch-0.3.0 | lib/ratch/toolset/ruby/publish |