{"id":383,"date":"2007-11-10T12:48:00","date_gmt":"2007-11-10T16:48:00","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=383"},"modified":"2011-12-17T12:24:27","modified_gmt":"2011-12-17T16:24:27","slug":"preparing-a-rails-application-for-svn","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2007\/11\/preparing-a-rails-application-for-svn\/","title":{"rendered":"Preparing a Rails Application for SVN"},"content":{"rendered":"<p>The key for a rails application in SVN is to make sure not to check in stuff that is part of the run time.   Rails could organize this better &#8211; but it is not so bad.   This post describes how I did it.  Here are some references:<br \/>\n<a href=http:\/\/svnbook.red-bean.com\/en\/1.1\/ch07s02.html target=_new>Using svn propset<\/a><br \/>\n<a href=http:\/\/wiki.rubyonrails.org\/rails\/pages\/HowtoUseRailsWithSubversion target=_new>Howto User Rails With Subversion<\/a><br \/>\nMy process is a variant of the above link.<\/p>\n<p><!--more--><br \/>\nFirst I check out my place in SVN that I want to add the application below. If I need to add a new directory &#8211; I make the directory and commit it.<br \/>\nThen I go into the empty directory and copy in my rails app.<br \/>\nThen I run these commands in the directory before checkin:<br \/>\nrm tmp\/*\/*<br \/>\nrm log\/*<br \/>\nrm `find . -name &#8216;.DS_Store&#8217;`<br \/>\nrm `find . -name &#8216;*~&#8217;`<br \/>\nrm `find . -name &#8216;*.sqlite3&#8217; `<br \/>\nrake db:migrate VERSION=0<br \/>\nI just made a little script to do this so I don&#8217;t forget steps.<br \/>\nThen I do an<br \/>\nsvn add<br \/>\nsvn commit -m &#8220;Initial commit&#8221;<br \/>\nThen after the commit I do a bunch of propsets<br \/>\nsvn propset svn:ignore &#8220;*.log&#8221; log\/<br \/>\nsvn propset svn:ignore &#8220;*&#8221; tmp\/sessions tmp\/cache tmp\/sockets<br \/>\nsvn propset svn:ignore &#8220;*.rb\\n*.sqlite3&#8221; db<br \/>\nsvn propset svn:ignore &#8220;.DS_Store&#8221; .<br \/>\nsvn commit -m &#8220;Setup initial ignores&#8221;<br \/>\nEdit your ~\/.subversion\/config and add this line:<br \/>\nglobal-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.sqlite3 schema.rb *.log<br \/>\nSo folks can develop and not be bothered in their svn status output<br \/>\nwhen their running ruby system makes files.<br \/>\nIf you want see all this cleverness in action &#8211; run the checked out app and then do this:<br \/>\nsvn status &#8211;no-ignore<br \/>\nYou will see something like this:<br \/>\nI      log\/development.log<br \/>\nI      db\/development.sqlite3<br \/>\nI      tmp\/sessions\/ruby_sess.33f0133496165daf<br \/>\nWhich means it is working.<br \/>\nSome Rails\/SVN experts would suggest that you do not check in the database.yml and a few bits of public like dispatch.cgi and dispatch.fcgi.<br \/>\nSure &#8211; I see the point there.  But I erred on the side of making the developer&#8217;s life easier and having a fully functional sqlite3 version when it comes out of SVN.  Since we will have lots of developers and a fewer production instances &#8211; I figured that the right choice was to have production folks make the overlay rather than every single developer.  Or perhaps make the overlay happen as part of the build of a release &#8211; which is a complex script anyways.  Make it easy for the developer I always say.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The key for a rails application in SVN is to make sure not to check in stuff that is part of the run time. Rails could organize this better &#8211; but it is not so bad. This post describes how I did it. Here are some references: Using svn propset Howto User Rails With Subversion [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-383","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":2494,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/383\/revisions\/2494"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}