<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Ruby script for creating new rails project and initial SVN import (with ignoring/removing log/other files)</title>
	<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/</link>
	<description>Exploring RubyOnRails</description>
	<pubDate>Thu, 21 Aug 2008 18:01:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>

	<item>
		<title>by: Jerry</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-21088</link>
		<pubDate>Fri, 30 May 2008 13:20:11 +0000</pubDate>
		<guid>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-21088</guid>
					<description>Early bird gets the worm,</description>
		<content:encoded><![CDATA[<p>Early bird gets the worm,
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: sb</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-3380</link>
		<pubDate>Mon, 27 Aug 2007 15:22:29 +0000</pubDate>
		<guid>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-3380</guid>
					<description>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</description>
		<content:encoded><![CDATA[<p>The download link here is broken but don&#8217;t worry, you can find a modified one here: <a href="http://topher.88-mph.net/2007/6/21/ruby-script-for-creating-a-rails-app" rel="nofollow">http://topher.88-mph.net/2007/6/21/ruby-script-for-creating-a-rails-app</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: osmos</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-2769</link>
		<pubDate>Wed, 01 Aug 2007 05:30:21 +0000</pubDate>
		<guid>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-2769</guid>
					<description>This sounds good, but the download link doesn't work. Could you update the link or file?</description>
		<content:encoded><![CDATA[<p>This sounds good, but the download link doesn&#8217;t work. Could you update the link or file?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: alex</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-631</link>
		<pubDate>Thu, 12 Apr 2007 20:03:47 +0000</pubDate>
		<guid>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-631</guid>
					<description>hi nice site.</description>
		<content:encoded><![CDATA[<p>hi nice site.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Tom Chappell</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-111</link>
		<pubDate>Thu, 15 Feb 2007 03:05:04 +0000</pubDate>
		<guid>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-111</guid>
					<description>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 &#124;path&#124;
      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.</description>
		<content:encoded><![CDATA[<p>Nice script!  There is a small bug in the handling of the &#8216;tmp&#8217; directory, which can be easily corrected:</p>
<p>Add the following line to the top of the file:<br />
require &#8216;find&#8217;</p>
<p>Then, replace these lines&#8230;</p>
<p>system(&#8221;svn commit -m \&#8221;removing the temp directory from subversion \&#8221; &#8220;)<br />
    puts  &#8220;Ignoring tmp dir&#8221;<br />
    system(&#8221;svn propset svn:ignore \&#8221;*\&#8221; tmp&#8221;+s)<br />
    puts  &#8220;Updating and commiting again&#8230;.&#8221;<br />
    system(&#8221;svn update tmp&#8221;+s)<br />
    system(&#8221;svn commit -m \&#8221;Ignore the whole tmp&#8221;+s+&#8221; directory, might not work on subdirectories? \&#8221; &#8220;)<br />
&#8230;with these lines:</p>
<p>    # Traverse the &#8220;tmp&#8221; subtree, ignoring directories which start with &#8220;.&#8221;,<br />
    # marking any remaining directories with a property to ignore all files,<br />
    # and removing any files therein from subversion.<br />
    Find.find(&#8221;tmp&#8221;) do |path|<br />
      if FileTest.directory?(path)<br />
        if File.basename(path)[0] == ?.<br />
          Find.prune       # Skip this directory (e.g. &#8220;..&#8221;, &#8220;.svn&#8221;)<br />
        else<br />
          # Tell subversion to ignore all files in this directory.<br />
          system(&#8221;svn propset svn:ignore \&#8221;*\&#8221; &#8220;+path)<br />
        end<br />
     else<br />
       # Remove any files from subversion.<br />
       system(&#8221;svn remove &#8220;+path)<br />
      end<br />
    end<br />
    system(&#8221;svn commit -m \&#8221;removing the tmp subtree from subversion \&#8221; &#8220;)</p>
<p>&#8230;and the tmp subtree will be properly excluded from subversion.</p>
<p>The problem was that the old code was not marking subdirectories of &#8216;tmp&#8217; with the svn:ignore property.  The new code removes any stray files under tmp, and marks the &#8216;tmp&#8217; directory and all subdirectories of &#8216;tmp&#8217; with the svn:ignore property.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Danger</title>
		<link>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-104</link>
		<pubDate>Fri, 09 Feb 2007 17:45:12 +0000</pubDate>
		<guid>http://webonrails.com/2007/02/08/ruby-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/#comment-104</guid>
					<description>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!</description>
		<content:encoded><![CDATA[<p>If you put a shebang at the top of the file then it won&#8217;t require the .rb extension or need to be run by Ruby when it&#8217;s on a *nix system.<br />
#!/usr/bin/env ruby</p>
<p>Thanks for this!
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
