SVN to Tar archive.rb
#
# tar_svn.rb
# Tars a svn co
#
# Created by Caius Durling <dev at caius dot name> on 2007-06-19.
# Copyright 2007 Hentan Software.
# Licenced under the Creative Commons Attribution-NonCommercial-ShareAlike 2.0 License.
#
#
'ftools'
# If you pass URL PATH on the command line, then it uses them.
"USAGE: tar_svn «url» «path» «version»"# Post config processing
"/").last
@config[:svn] = `which svn``which tar`"Please make sure svn is in the path""no svn in""Please make sure tar is in the path""no tar in")
# Make sure theres a / on the end of the path
"/""").last == "/""Checking out svn"
# SVN checkout doesn't exist
`#{@config[:svn]} checkout #{@config[:url]} #{folder}`"Svn checkout finished""Updating svn"
`#{@config[:svn]} update #{folder}`
p "Update complete""#{folder}/trunk""#{folder}/trunk""#{folder}/trunk/#{item}", "#{folder}/#{item}""Tarring file"
`cd #{@config[:path]} && #{@config[:tar]} -jcf #{@config[:folder]}_#{@config[:version]}.tar #{@config[:folder]}`
p "File tarred"
p "Cleaning up"
`rm -rf #{folder}`
`#{@config[:svn]} checkout #{@config[:url]} #{folder}`"Finished!"
Example 1 -- tar_svn.rb -- Select Code