Comments on: Ruby script for creating new rails project and initial SVN import (with ignoring/removing log/other files) /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/ Its all about Ruby On Rails Thu, 14 Mar 2013 06:19:42 +0000 hourly 1 #/?v= By: Jerry /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/comment-page-1/#comment-266 Jerry Fri, 30 May 2008 13:20:11 +0000 /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-266 Early bird gets the worm, Early bird gets the worm,

]]>
By: sb /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/comment-page-1/#comment-265 sb Mon, 27 Aug 2007 15:22:29 +0000 /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-265 The download link here is broken but don't worry, you can find a modified one here: http://topher.88-mph.net/2007/6/21/ruby-script-for-creating-a-rails-app The download link here is broken but don’t worry, you can find a modified one here: http://topher.88-mph.net/2007/6/21/ruby-script-for-creating-a-rails-app

]]>
By: osmos /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/comment-page-1/#comment-264 osmos Wed, 01 Aug 2007 05:30:21 +0000 /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-264 This sounds good, but the download link doesn't work. Could you update the link or file? This sounds good, but the download link doesn’t work. Could you update the link or file?

]]>
By: alex /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/comment-page-1/#comment-263 alex Thu, 12 Apr 2007 20:03:47 +0000 /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-263 hi nice site. hi nice site.

]]>
By: Tom Chappell /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/comment-page-1/#comment-262 Tom Chappell Thu, 15 Feb 2007 03:05:04 +0000 /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-262 Nice script! There is a small bug in the handling of the 'tmp' directory, which can be easily corrected: Add the following line to the top of the file: require 'find' Then, replace these lines... system("svn commit -m \"removing the temp directory from subversion \" ") puts "Ignoring tmp dir" system("svn propset svn:ignore \"*\" tmp"+s) puts "Updating and commiting again...." system("svn update tmp"+s) system("svn commit -m \"Ignore the whole tmp"+s+" directory, might not work on subdirectories? \" ") ...with these lines: # Traverse the "tmp" subtree, ignoring directories which start with ".", # marking any remaining directories with a property to ignore all files, # and removing any files therein from subversion. Find.find("tmp") do |path| if FileTest.directory?(path) if File.basename(path)[0] == ?. Find.prune # Skip this directory (e.g. "..", ".svn") else # Tell subversion to ignore all files in this directory. system("svn propset svn:ignore \"*\" "+path) end else # Remove any files from subversion. system("svn remove "+path) end end system("svn commit -m \"removing the tmp subtree from subversion \" ") ...and the tmp subtree will be properly excluded from subversion. The problem was that the old code was not marking subdirectories of 'tmp' with the svn:ignore property. The new code removes any stray files under tmp, and marks the 'tmp' directory and all subdirectories of 'tmp' with the svn:ignore property. Nice script! There is a small bug in the handling of the ‘tmp’ directory, which can be easily corrected:

Add the following line to the top of the file:
require ‘find’

Then, replace these lines…

system(“svn commit -m \”removing the temp directory from subversion \” “)
puts “Ignoring tmp dir”
system(“svn propset svn:ignore \”*\” tmp”+s)
puts “Updating and commiting again….”
system(“svn update tmp”+s)
system(“svn commit -m \”Ignore the whole tmp”+s+” directory, might not work on subdirectories? \” “)
…with these lines:

# Traverse the “tmp” subtree, ignoring directories which start with “.”,
# marking any remaining directories with a property to ignore all files,
# and removing any files therein from subversion.
Find.find(“tmp”) do |path|
if FileTest.directory?(path)
if File.basename(path)[0] == ?.
Find.prune # Skip this directory (e.g. “..”, “.svn”)
else
# Tell subversion to ignore all files in this directory.
system(“svn propset svn:ignore \”*\” “+path)
end
else
# Remove any files from subversion.
system(“svn remove “+path)
end
end
system(“svn commit -m \”removing the tmp subtree from subversion \” “)

…and the tmp subtree will be properly excluded from subversion.

The problem was that the old code was not marking subdirectories of ‘tmp’ with the svn:ignore property. The new code removes any stray files under tmp, and marks the ‘tmp’ directory and all subdirectories of ‘tmp’ with the svn:ignore property.

]]>
By: Danger /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/comment-page-1/#comment-261 Danger Fri, 09 Feb 2007 17:45:12 +0000 /2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-261 If you put a shebang at the top of the file then it won't require the .rb extension or need to be run by Ruby when it's on a *nix system. #!/usr/bin/env ruby Thanks for this! If you put a shebang at the top of the file then it won’t require the .rb extension or need to be run by Ruby when it’s on a *nix system.
#!/usr/bin/env ruby

Thanks for this!

]]>