<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>ConceptSpace blog feed</title>
		<link>http://conceptspace.wikidot.com</link>
		<description>Open Source Projects,  Blog for Ruby on Rails, Erlang, Firefox, Linux</description>
				<copyright></copyright>
		<lastBuildDate>Fri, 03 Apr 2026 23:39:31 +0000</lastBuildDate>
		
					<item>
				<guid>http://conceptspace.wikidot.com/blog:comparison-of-java-and-ruby-on-rails-with-hobo</guid>
				<title>Comparison of Java and Ruby on Rails with Hobo</title>
				<link>http://conceptspace.wikidot.com/blog:comparison-of-java-and-ruby-on-rails-with-hobo</link>
				<description>

&lt;p&gt;Do you want to see the difference of Ruby and Java?&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 14 Apr 2016 02:41:25 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Do you want to see the difference of Ruby and Java?</p> <h2><span>Here is the Ruby code:</span></h2> <p><iframe src="http://conceptspace.wikidot.com//pastebin.com/embed_iframe/eBSW5L08" style="border:none;width:70%;height:24em"></iframe></p> <h2><span>And here is the corresponding Java code:</span></h2> <p><iframe src="http://conceptspace.wikidot.com//pastebin.com/embed_iframe/i8K5cBgr" style="border:none;width:70%;height:120em"></iframe></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:self-publishing:publitory</guid>
				<title>Self Publishing: Publitory and Opal Browser</title>
				<link>http://conceptspace.wikidot.com/blog:self-publishing:publitory</link>
				<description>

&lt;p&gt;&lt;a href=&quot;https://publitory.com&quot;&gt;Publitory&lt;/a&gt; is a self publising site. You can publish PDF and EPUB directly or you can convert word documents to EPUB. There are free as well as paid eBooks.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 31 Aug 2015 13:01:41 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p><a href="https://publitory.com">Publitory</a> is a self publising site. You can publish PDF and EPUB directly or you can convert word documents to EPUB. There are free as well as paid eBooks.</p> <p>I built the site using Ruby on Rails and Coffeescript.</p> <p>Event using Coffeescript, page scripting took too much time. Now I will rewrite the scripts using <a href="https://github.com/opal/opal-browser">Opal Browser</a>. With <a href="https://github.com/opal/opal-browser">Opal Browser</a> you use Ruby instead of Javascript. Simply using Ruby, you don't need many Javascript frameworks. Create and unit test Ruby classes. It's just there. It's high level.</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:cool-scopes-with-rails-3</guid>
				<title>Cool scopes with Rails 3</title>
				<link>http://conceptspace.wikidot.com/blog:cool-scopes-with-rails-3</link>
				<description>

&lt;p&gt;Usually testing existance of associations with SQL is a hell. But rails 3 handles very difficult cases without extra gems. There is no need to use INNER OUTER JOINS, etc. If somebody wants to define the scopes below then SQL comes to mind first. I`ve searched Stack Overflow and could not find any good examples:&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 04 Jul 2013 15:24:53 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Usually testing existance of associations with SQL is a hell. But rails 3 handles very difficult cases without extra gems. There is no need to use INNER OUTER JOINS, etc. If somebody wants to define the scopes below then SQL comes to mind first. I`ve searched Stack Overflow and could not find any good examples:</p> <p><strong>writers</strong><br /> Users who are working on a book</p> <p><strong>not in writers</strong><br /> Users who have not got any book</p> <p><strong>authors</strong><br /> Users who have at least a book published</p> <p><strong>not_in_authors</strong><br /> Users who have not got any book published</p> <p>So here is the code:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-reserved">class</span><span class="hl-code"> </span><span class="hl-identifier">User</span><span class="hl-code"> </span><span class="hl-identifier">has_many</span><span class="hl-code"> :</span><span class="hl-identifier">books</span><span class="hl-code">, </span><span class="hl-identifier">dependent</span><span class="hl-code">: :</span><span class="hl-identifier">destroy</span><span class="hl-code">, </span><span class="hl-identifier">inverse_of</span><span class="hl-code">: :</span><span class="hl-identifier">owner</span><span class="hl-code">, </span><span class="hl-identifier">foreign_key</span><span class="hl-code">: </span><span class="hl-quotes">'</span><span class="hl-string">owner_id</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-comment">#**writers**</span><span class="hl-code"> </span><span class="hl-comment"># Users who are working on a book</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-reserved">self</span><span class="hl-code">.</span><span class="hl-identifier">writers</span><span class="hl-code"> </span><span class="hl-identifier">joins</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">books</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">uniq</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-comment">#**not in writers**</span><span class="hl-code"> </span><span class="hl-comment"># Users who have not got any book</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-reserved">self</span><span class="hl-code">.</span><span class="hl-identifier">not_in_writers</span><span class="hl-code"> </span><span class="hl-identifier">eager_load</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">books</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">where</span><span class="hl-brackets">(</span><span class="hl-identifier">books</span><span class="hl-code">:{</span><span class="hl-identifier">id</span><span class="hl-code">: </span><span class="hl-reserved">nil</span><span class="hl-code">}</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">uniq</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-comment">#**authors**</span><span class="hl-code"> </span><span class="hl-comment"># Users who have at least a book published</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-reserved">self</span><span class="hl-code">.</span><span class="hl-identifier">authors</span><span class="hl-code"> </span><span class="hl-identifier">joins</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">books</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">where</span><span class="hl-brackets">(</span><span class="hl-identifier">books</span><span class="hl-code">: {</span><span class="hl-identifier">published_date</span><span class="hl-code">: </span><span class="hl-quotes">'</span><span class="hl-string">NOT NULL</span><span class="hl-quotes">'</span><span class="hl-code">}</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">uniq</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-comment">#**not_in_authors**</span><span class="hl-code"> </span><span class="hl-comment"># Users who have not got any book published</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-reserved">self</span><span class="hl-code">.</span><span class="hl-identifier">not_in_authors</span><span class="hl-code"> </span><span class="hl-identifier">eager_load</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">books</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">where</span><span class="hl-brackets">(</span><span class="hl-identifier">books</span><span class="hl-code">:{</span><span class="hl-identifier">published_date</span><span class="hl-code">: </span><span class="hl-reserved">nil</span><span class="hl-code">}</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">uniq</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">class</span><span class="hl-code"> </span><span class="hl-identifier">Book</span><span class="hl-code"> </span><span class="hl-identifier">belongs_to</span><span class="hl-code"> :</span><span class="hl-identifier">owner</span><span class="hl-code">, </span><span class="hl-identifier">class_name</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">User</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-identifier">inverse_of</span><span class="hl-code">: :</span><span class="hl-identifier">books</span><span class="hl-code"> </span><span class="hl-reserved">end</span></pre></div> </div> <p>Ok, writing <em>published_date: 'NOT NULL'</em>, I cheated a bit. Nevertheless better than full SQL!</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:powerful-rails-3-templates</guid>
				<title>Powerful Rails 3 Templates</title>
				<link>http://conceptspace.wikidot.com/blog:powerful-rails-3-templates</link>
				<description>

&lt;p&gt;Rails 3 templates or Thor scripts can do any kind of modification on source code. As regular expressions can hunt for syntax patterns; you can replace existing methods with new definitions. For example:&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 30 Aug 2012 09:28:23 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Rails 3 templates or Thor scripts can do any kind of modification on source code. As regular expressions can hunt for syntax patterns; you can replace existing methods with new definitions. For example:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-identifier">match_mtd</span><span class="hl-brackets">(</span><span class="hl-identifier">mtd</span><span class="hl-brackets">)</span><span class="hl-quotes"> /</span><span class="hl-string">^</span><span class="hl-special">\s</span><span class="hl-string">*def (#{mtd})</span><span class="hl-special">\s</span><span class="hl-string">+((?!end).)*</span><span class="hl-special">\s</span><span class="hl-string">+end</span><span class="hl-special">\s</span><span class="hl-string">*$</span><span class="hl-quotes">/m</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">gsub_file</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">app/models/post.rb</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-identifier">match_mtd</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">create_permitted</span><span class="hl-special">\?</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">, &lt;&lt;-</span><span class="hl-identifier">CODE</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> \\</span><span class="hl-number">1</span><span class="hl-code"> </span><span class="hl-identifier">acting_user</span><span class="hl-code">.</span><span class="hl-identifier">signed_up</span><span class="hl-code">? </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">CODE</span><span class="hl-code"> </span><span class="hl-identifier">gsub_file</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">app/models/post.rb</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-identifier">match_mtd</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">update_permitted</span><span class="hl-special">\?</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">, &lt;&lt;-</span><span class="hl-identifier">CODE</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> \\</span><span class="hl-number">1</span><span class="hl-code"> </span><span class="hl-identifier">owner_is</span><span class="hl-code">? </span><span class="hl-identifier">acting_user</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">CODE</span></pre></div> </div> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rake</span><span class="hl-code"> </span><span class="hl-identifier">rails</span><span class="hl-code">:</span><span class="hl-identifier">template</span><span class="hl-code"> </span><span class="hl-identifier">LOCATION</span><span class="hl-code">=..</span><span class="hl-quotes">/</span><span class="hl-string">my_template</span></pre></div> </div> <p>Existing methods are found and replaced. Now you have your create_permitted? and update_permitted? methods.<br /> This is extremely useful for automating the replacement of framework generated source code.</p> <p><strong>Notes</strong>:</p> <ul> <li>In create_permitted\?, ? is escaped because it is inserted in a regular expression. In a regular expression ? only means match any character.</li> <li>def \\1. Double escaped 1? If it's not escaped \1 means character with ascii code 1 and it gets replaced. \1 in a regex replacement means first match expression which is the method name here.</li> </ul> <p>Ok. Ok. You cannot match any syntax with a regex. But it has untapped powers to handle most of the cases. ((?!end).)* means zero or more times something that's not 'end'. Let's analyize the expression.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-quotes">/</span><span class="hl-string">^</span><span class="hl-special">\s</span><span class="hl-string">*def (#{mtd})</span><span class="hl-special">\s</span><span class="hl-string">+((?!end).)*</span><span class="hl-special">\s</span><span class="hl-string">+end</span><span class="hl-special">\s</span><span class="hl-string">*$</span><span class="hl-quotes">/m</span></pre></div> </div> <p>\s* # 0 or more spaces<br /> def (#{mtd}) # def &lt;mtd&gt;<br /> \s+ # 1 or more spaces<br /> ((?!end).)* # 0 or more whatever that's not end<br /> \s+ # 1 or more spaces<br /> end # end<br /> \s* # 0 or more spaces<br /> $ # end of line<br /> /m # match multiline</p> <p>As you see this expression would not be good if there was an extra end used in the method definition.</p> <p>Maybe the next idea should be to support Thor with Ruby parser?</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:hobo-template-creating-a-blog-under-a-minute</guid>
				<title>Hobo Template - Creating a blog under a minute</title>
				<link>http://conceptspace.wikidot.com/blog:hobo-template-creating-a-blog-under-a-minute</link>
				<description>

&lt;p&gt;You can use &lt;a href=&quot;https://gist.github.com/3405055&quot; target=&quot;_blank&quot;&gt;this template&lt;/a&gt; to create a blog with hobo in a few seconds:&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 20 Aug 2012 15:23:10 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>You can use <a href="https://gist.github.com/3405055" target="_blank">this template</a> to create a blog with hobo in a few seconds:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">say</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">Installing gems so that we can scaffold...</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">run</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">bundle install</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">generate</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">hobo:setup_wizard</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-identifier">yes</span><span class="hl-code">? </span><span class="hl-quotes">&quot;</span><span class="hl-string">Wanna run hobo:setup_wizard?</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">generate</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">hobo:resource</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">Post title:string text:text</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">inject_into_class</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">app/models/post.rb</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">Post</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> &lt;&lt;-</span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-identifier">attr_accessible</span><span class="hl-code"> :</span><span class="hl-identifier">title</span><span class="hl-code">, :</span><span class="hl-identifier">text</span><span class="hl-code"> </span><span class="hl-identifier">default_scope</span><span class="hl-code"> :</span><span class="hl-identifier">order</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">created_at DESC</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">validates</span><span class="hl-code"> :</span><span class="hl-identifier">title</span><span class="hl-code">, :</span><span class="hl-identifier">presence</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">true</span><span class="hl-code">, :</span><span class="hl-identifier">length</span><span class="hl-code"> =&gt; { :</span><span class="hl-identifier">minimum</span><span class="hl-code"> =&gt; </span><span class="hl-number">5</span><span class="hl-code"> } </span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">route</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">root :to =&gt; 'posts#index'</span><span class="hl-quotes">&quot;</span></pre></div> </div> <p>Clean and DRY&#8230; Hobo is very productive&#8230;</p> <p>Hobo do not use templates while creating a project so use it after creating a project</p> <div class="code"> <pre><code>hobo new demo_blog --skip-setup cd demo_blog rake rails:template LOCATION=../template_demo_blog_hobo.rb</code></pre></div> <p>This adventure require at least Hobo 1.4 . It is not released yet at the time of writing. <a href="http://conceptspace.wikidot.com/blog:trying-hobo-for-rails-3-2-or-trying-an-unreleased-gem-d">You might need to install it directly from GitHub</a></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:template-for-dryer-rails-demo-blog</guid>
				<title>Template for DRYer rails demo blog</title>
				<link>http://conceptspace.wikidot.com/blog:template-for-dryer-rails-demo-blog</link>
				<description>

&lt;p&gt;In &lt;a href=&quot;http://conceptspace.wikidot.com/blog:getting-started-with-dryer-rails-3-2&quot; target=&quot;_blank&quot;&gt;Getting Started with DRYer Rails 3.2&lt;/a&gt;, I showed how small code you need to create a blog or any other application. But where is the code to try? Here is &lt;a href=&quot;https://gist.github.com/3378950&quot; target=&quot;_blank&quot;&gt;the rails template to create a DRY demo blog&lt;/a&gt; for you. Simply do&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;demo_blog&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;https&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;raw&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;github&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;gist&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;3378950&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;699589853464e4654ae7e5d183de126b11f4720f&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;template_umur_demo_blog&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Note that you need bundler and rails gems in your system or current rvm environment.&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Usage example: rails new demo_blog -m demo_blog_recipe.rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# Required gems&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;therubyracer&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;platforms&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&amp;gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Rails need&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;inherited_resources&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;has_scope&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;append_file&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;Gemfile&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;git://github.com/tablatom/hobo.git&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;hobo_fields&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#gem &#039;dryml&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;hobo_support&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#gem &#039;hobo&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# Custom generators for DRY code&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;append_file&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;config/application.rb&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#{@app_name.camelize}::Application.configure do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; |&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;|
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test_framework&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;shoulda&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;fallbacks&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;shoulda&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test_unit&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;fixture_replacement&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;factory_girl&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;scaffold_controller&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;inherited_resources_controller&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;orm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;hobo&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;to_sym&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#TODO: Introduce steak/capybara for integration test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;init&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;-a -m &#039;Initial commit&#039;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;####&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# Let&#039;s make a demo blog now&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;####&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;say&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;Installing gems so that we can scaffold...&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;bundle install&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;scaffold&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,  &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;Post title:string text:text&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;root :to =&amp;gt; &#039;posts#index&#039;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;inject_into_class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;app/models/post.rb&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;Post&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;attr_accessible&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;default_scope&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;created_at DESC&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;validates&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;presence&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,
                    :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; { :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;minimum&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; }
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;inject_into_class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;app/controllers/posts_controller.rb&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;PostsController&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;respond_to&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;EOS&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;db:migrate&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# More template commands are in&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# http://rdoc.info/github/wycats/thor/master/Thor/Actions.html&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that you need bundler and rails gems in your system or current rvm environment.&lt;br /&gt;
Andrea Singh describes &lt;a href=&quot;http://blog.madebydna.com/all/code/2010/10/11/cooking-up-a-custom-rails3-template.html&quot;&gt;a cool way to create a new rvm gemset&lt;/a&gt; for your new project down in section &amp;quot;Using RVM&amp;quot;. I advice you to use &lt;a href=&quot;http://blog.madebydna.com/all/code/2010/10/11/cooking-up-a-custom-rails3-template.html&quot;&gt;her bootstrap.rb&lt;/a&gt;. I am thinking about making it a global Thor script.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 17 Aug 2012 14:15:54 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>In <a href="http://conceptspace.wikidot.com/blog:getting-started-with-dryer-rails-3-2" target="_blank">Getting Started with DRYer Rails 3.2</a>, I showed how small code you need to create a blog or any other application. But where is the code to try? Here is <a href="https://gist.github.com/3378950" target="_blank">the rails template to create a DRY demo blog</a> for you. Simply do</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rails</span><span class="hl-code"> </span><span class="hl-identifier">new</span><span class="hl-code"> </span><span class="hl-identifier">demo_blog</span><span class="hl-code"> -</span><span class="hl-identifier">m</span><span class="hl-code"> </span><span class="hl-identifier">https</span><span class="hl-code">:</span><span class="hl-quotes">//</span><span class="hl-identifier">raw</span><span class="hl-code">.</span><span class="hl-identifier">github</span><span class="hl-code">.</span><span class="hl-identifier">com</span><span class="hl-quotes">/</span><span class="hl-string">gist</span><span class="hl-quotes">/</span><span class="hl-number">3378950</span><span class="hl-quotes">/</span><span class="hl-string">699589853464e4654ae7e5d183de126b11f4720f</span><span class="hl-quotes">/</span><span class="hl-identifier">template_umur_demo_blog</span><span class="hl-code">.</span><span class="hl-identifier">rb</span><span class="hl-code"> </span><span class="hl-comment">#Note that you need bundler and rails gems in your system or current rvm environment.</span></pre></div> </div> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#Usage example: rails new demo_blog -m demo_blog_recipe.rb</span><span class="hl-code"> </span><span class="hl-comment"># Required gems</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">therubyracer</span><span class="hl-quotes">'</span><span class="hl-code">, :</span><span class="hl-identifier">platforms</span><span class="hl-code"> =&gt; :</span><span class="hl-identifier">ruby</span><span class="hl-code">, :</span><span class="hl-identifier">group</span><span class="hl-code">=&gt;:</span><span class="hl-identifier">assets</span><span class="hl-code"> </span><span class="hl-comment">#Rails need</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">inherited_resources</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">has_scope</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">append_file</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">Gemfile</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> &lt;&lt;-</span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-identifier">git</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">git://github.com/tablatom/hobo.git</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">hobo_fields</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-comment">#gem 'dryml'</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">hobo_support</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-comment">#gem 'hobo'</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-comment"># Custom generators for DRY code</span><span class="hl-code"> </span><span class="hl-identifier">append_file</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">config/application.rb</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> &lt;&lt;-</span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-comment">#{@app_name.camelize}::Application.configure do</span><span class="hl-code"> </span><span class="hl-identifier">config</span><span class="hl-code">.</span><span class="hl-identifier">generators</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> |</span><span class="hl-identifier">g</span><span class="hl-code">| </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">test_framework</span><span class="hl-code"> :</span><span class="hl-identifier">shoulda</span><span class="hl-code"> </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">fallbacks</span><span class="hl-brackets">[</span><span class="hl-code">:</span><span class="hl-identifier">shoulda</span><span class="hl-brackets">]</span><span class="hl-code"> = :</span><span class="hl-identifier">test_unit</span><span class="hl-code"> </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">fixture_replacement</span><span class="hl-code"> :</span><span class="hl-identifier">factory_girl</span><span class="hl-code"> </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">scaffold_controller</span><span class="hl-code"> :</span><span class="hl-identifier">inherited_resources_controller</span><span class="hl-code"> </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">orm</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">hobo</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-identifier">to_sym</span><span class="hl-code"> </span><span class="hl-comment">#TODO: Introduce steak/capybara for integration test</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">git</span><span class="hl-code"> :</span><span class="hl-identifier">init</span><span class="hl-code"> </span><span class="hl-identifier">git</span><span class="hl-code"> :</span><span class="hl-identifier">add</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">&quot;</span><span class="hl-string">.</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">git</span><span class="hl-code"> :</span><span class="hl-identifier">commit</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">&quot;</span><span class="hl-string">-a -m 'Initial commit'</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-comment">####</span><span class="hl-code"> </span><span class="hl-comment"># Let's make a demo blog now</span><span class="hl-code"> </span><span class="hl-comment">####</span><span class="hl-code"> </span><span class="hl-identifier">say</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">Installing gems so that we can scaffold...</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">run</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">bundle install</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">generate</span><span class="hl-code"> :</span><span class="hl-identifier">scaffold</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">Post title:string text:text</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">route</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">root :to =&gt; 'posts#index'</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">inject_into_class</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">app/models/post.rb</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">Post</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> &lt;&lt;-</span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-identifier">attr_accessible</span><span class="hl-code"> :</span><span class="hl-identifier">title</span><span class="hl-code">, :</span><span class="hl-identifier">text</span><span class="hl-code"> </span><span class="hl-identifier">default_scope</span><span class="hl-code"> :</span><span class="hl-identifier">order</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">created_at DESC</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">validates</span><span class="hl-code"> :</span><span class="hl-identifier">title</span><span class="hl-code">, :</span><span class="hl-identifier">presence</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">true</span><span class="hl-code">, :</span><span class="hl-identifier">length</span><span class="hl-code"> =&gt; { :</span><span class="hl-identifier">minimum</span><span class="hl-code"> =&gt; </span><span class="hl-number">5</span><span class="hl-code"> } </span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">inject_into_class</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">app/controllers/posts_controller.rb</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">PostsController</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> &lt;&lt;-</span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-identifier">respond_to</span><span class="hl-code"> :</span><span class="hl-identifier">html</span><span class="hl-code">, :</span><span class="hl-identifier">json</span><span class="hl-code"> </span><span class="hl-identifier">EOS</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">rake</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">db:migrate</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-comment"># More template commands are in</span><span class="hl-code"> </span><span class="hl-comment"># http://rdoc.info/github/wycats/thor/master/Thor/Actions.html</span></pre></div> </div> <p>Note that you need bundler and rails gems in your system or current rvm environment.<br /> Andrea Singh describes <a href="http://blog.madebydna.com/all/code/2010/10/11/cooking-up-a-custom-rails3-template.html">a cool way to create a new rvm gemset</a> for your new project down in section &quot;Using RVM&quot;. I advice you to use <a href="http://blog.madebydna.com/all/code/2010/10/11/cooking-up-a-custom-rails3-template.html">her bootstrap.rb</a>. I am thinking about making it a global Thor script.</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:trying-hobo-for-rails-3-2-or-trying-an-unreleased-gem-d</guid>
				<title>Trying HOBO for Rails 3.2 -or- Trying an unreleased Gem directly from GitHub</title>
				<link>http://conceptspace.wikidot.com/blog:trying-hobo-for-rails-3-2-or-trying-an-unreleased-gem-d</link>
				<description>

&lt;p&gt;&lt;a href=&quot;http://hobocentral.net/&quot; target=&quot;_blank&quot;&gt;Hobo&lt;/a&gt; is an excellent framework to generate production ready applications in a minute. However, it&#039;s not realeased yet for Rails 3.2 . You can use the strategy described here in general to create projects installing edge gems directly from GitHub.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 07 Aug 2012 11:41:39 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p><a href="http://hobocentral.net/" target="_blank">Hobo</a> is an excellent framework to generate production ready applications in a minute. However, it's not realeased yet for Rails 3.2 . You can use the strategy described here in general to create projects installing edge gems directly from GitHub.</p> <p>First we need to create a project to define a gemset that will contain hobo. I assume that you already have <a href="https://rvm.io/rvm/install/">RVM</a>.</p> <div class="code"> <pre><code>mkdir new-project--hobo cd new-project--hobo rvm use --create --rvmrc 1.9.3@new-project--hobo</code></pre></div> <p>Create the <strong>Gemfile</strong> to contain prerequisites of Hobo</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#Prerequisites of hobo</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">will_paginate</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">jquery-rails</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">jquery-ui-themes</span><span class="hl-quotes">'</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">rails</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">~&gt;3.2</span><span class="hl-quotes">'</span></pre></div> </div> <p>And &quot;$ bundle install&quot;</p> <p>Next get a clone of hobo into the project and install it</p> <div class="code"> <pre><code>new-project--hobo&gt;$ git clone git://github.com/tablatom/hobo.git pushd hobo rake gem[build,force] rake gem[install,force] popd</code></pre></div> <p>Now you've got your hobo gem so that you can create new rails projects instantly with it.</p> <p>To create a new project, I suggest that you copy the gemset to the gemset of the new project</p> <div class="code"> <pre><code>mkdir myproject pushd myproject rvm use @new-project--hobo SOURCE=`rvm gemset gemdir` rvm use --create --rvmrc @myproject TARGET=`rvm gemset gemdir` cp -a $SOURCE/* $TARGET #Now you've got hobo gems in your project gemset popd hobo new myproject #Now we are back to creating a normal hobo project cd myproject hobo g setup_wizard</code></pre></div> <p>Enjoy your new <a href="http://hobocentral.net/" target="_blank">Hobo</a> project.<br /> Note I made a thor script to copy a gemset better than repeating the commands above: <a href="https://gist.github.com/3403866">https://gist.github.com/3403866</a></p> <hr /> <p>You can generalize this strategy to create gemsets to initialize other projects. With or without edge gems. Even for standard Rails. It saves a lot of time not to download the gems. For the gemsets that I use as project factories I use the name pattern:</p> <div class="code"> <pre><code>new-project--&lt;FactoryName&gt;</code></pre></div> <hr /> <p>After going through all that hassle you see this on executing hobo:</p> <div class="code"> <pre><code>Set the HOBODEV ENV variable to your local hobo git-repository path in order to use your local dev version instead of the installed gem.</code></pre></div> <p>That means you can just clone Hobo and use it. Maybe you could use the idea here to try out other gems in development.</p> <p>Nevertheless, once you have created a hard to install gemset you can use it to initialize other gemsets easily using my thor script: <a href="https://gist.github.com/3403866">https://gist.github.com/3403866</a></p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#thor gemset:new target-gemset -s source-gemset</span><span class="hl-code"> </span><span class="hl-identifier">thor</span><span class="hl-code"> </span><span class="hl-identifier">gemset</span><span class="hl-code">:</span><span class="hl-identifier">new</span><span class="hl-code"> </span><span class="hl-identifier">my</span><span class="hl-code">-</span><span class="hl-identifier">new</span><span class="hl-code">-</span><span class="hl-identifier">project</span><span class="hl-code"> -</span><span class="hl-identifier">s</span><span class="hl-code"> </span><span class="hl-identifier">my</span><span class="hl-code">-</span><span class="hl-identifier">hobo</span><span class="hl-code">-</span><span class="hl-identifier">edge</span><span class="hl-code">-</span><span class="hl-identifier">gemset</span></pre></div> </div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:getting-started-with-dryer-rails-3-2</guid>
				<title>Getting Started with DRYer Rails &quot;~&gt;3.2&quot;</title>
				<link>http://conceptspace.wikidot.com/blog:getting-started-with-dryer-rails-3-2</link>
				<description>

&lt;p&gt;Following &lt;a href=&quot;http://edgeguides.rubyonrails.org/getting_started.html&quot;&gt;Edge Rails Guides&lt;/a&gt; gives you a demo blog. You can make a much DRYer version. This allows you quickly protype yet staying in the boundaries of standard &amp;quot;Rails&amp;quot;. After creating new rails project Append this bit to the end of &amp;quot;config/application.rb&amp;quot;:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Reference: http://asciicasts.com/episodes/216-generators-in-rails-3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;DemoBlog&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Application&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;configure&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; |&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;|
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;scaffold_controller&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;inherited_resources_controller&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;orm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;hobo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;If prefer this way of appending custom generators instead of modifying the code block. So that I can use this in a simple script/template/builder.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And make requested gems available. Append to your &amp;quot;Gemfile&amp;quot;:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;gem &#039;inherited_resources&#039;
gem &#039;has_scope&#039;

git &#039;git://github.com/tablatom/hobo.git&#039; do
  gem &#039;hobo_fields&#039;
  #gem &#039;dryml&#039;
  gem &#039;hobo_support&#039;
  #gem &#039;hobo&#039;
end

group :test do
  gem &amp;quot;shoulda&amp;quot;
  gem &amp;quot;factory_girl&amp;quot;
 #TODO: Introduce steak/capybara for integration test
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you see, I am able to use gems directly from github. (HoboFields for Rails 3.2 is only on GitHub at this date)&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Now. Let&#039;s Finish It DRY!&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Now you can scaffold a blog Post:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;  rails g scaffold Post title:string text:text&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And provide your DRY controller:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;class PostsController &amp;lt; InheritedResources::Base
  respond_to :html, :json
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Along with your DRYer model:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;class Post &amp;lt; ActiveRecord::Base
  default_scope :order =&amp;gt; &#039;created_at DESC&#039;

  fields do
    title :string
    text  :text
    timestamps
  end

  validates :title, :presence =&amp;gt; true,
                    :length =&amp;gt; { :minimum =&amp;gt; 5 }
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This model allows automatic migratoins:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;rails g hobo:migrations&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Just rapid ruby on rails to the point with the help of 2 generators. Now you can focus your energy more to the user interface. You dont wanna code more, right?&lt;/p&gt;
&lt;p&gt;To create the code mentioned here, &lt;a href=&quot;http://conceptspace.wikidot.com/blog:template-for-dryer-rails-demo-blog&quot; target=&quot;_blank&quot;&gt;you can use this template&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Moreover&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This kind of application is ready to work on &lt;a href=&quot;http://www.heroku.com/&quot;&gt;the cloud (Heroku)&lt;/a&gt;. Just go and deploy your project to the world.&lt;/p&gt;
&lt;p&gt;Rails contains a myriad of options. You should use &lt;a href=&quot;https://github.com/RailsApps/rails-composer/&quot;&gt;RailsComposer&lt;/a&gt; to create new projects&amp;#8230; And see &lt;a href=&quot;http://railsapps.github.com/&quot;&gt;more Rails examples&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;References&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/josevalim/inherited_resources/&quot;&gt;https://github.com/josevalim/inherited_resources/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cookbook.hobocentral.net/manual/hobo_fields&quot;&gt;http://cookbook.hobocentral.net/manual/hobo_fields&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://asciicasts.com/episodes/216-generators-in-rails-3&quot;&gt;http://asciicasts.com/episodes/216-generators-in-rails-3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span&gt;Note&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;I am not touching AJAX, Styling or whatever here intentionally. There are zillions of ways and preferences for that&amp;#8230;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Another Note&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Like all blog posts, this one will become out of date one day and it won&#039;t work any more. It would be nice if we could &amp;quot;unit test&amp;quot; and debug blog posts. Technically possible. However it would be nice if had a DSL that fits naturally to blogging. Does anybody have an inspiration?&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 07 Aug 2012 09:34:54 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Following <a href="http://edgeguides.rubyonrails.org/getting_started.html">Edge Rails Guides</a> gives you a demo blog. You can make a much DRYer version. This allows you quickly protype yet staying in the boundaries of standard &quot;Rails&quot;. After creating new rails project Append this bit to the end of &quot;config/application.rb&quot;:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#Reference: http://asciicasts.com/episodes/216-generators-in-rails-3</span><span class="hl-code"> </span><span class="hl-identifier">DemoBlog</span><span class="hl-code">::</span><span class="hl-identifier">Application</span><span class="hl-code">.</span><span class="hl-identifier">configure</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> </span><span class="hl-identifier">config</span><span class="hl-code">.</span><span class="hl-identifier">generators</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> |</span><span class="hl-identifier">g</span><span class="hl-code">| </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">scaffold_controller</span><span class="hl-code"> :</span><span class="hl-identifier">inherited_resources_controller</span><span class="hl-code"> </span><span class="hl-identifier">g</span><span class="hl-code">.</span><span class="hl-identifier">orm</span><span class="hl-code"> :</span><span class="hl-identifier">hobo</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span></pre></div> </div> <p><em>If prefer this way of appending custom generators instead of modifying the code block. So that I can use this in a simple script/template/builder.</em></p> <p>And make requested gems available. Append to your &quot;Gemfile&quot;:</p> <div class="code"> <pre><code>gem 'inherited_resources' gem 'has_scope' git 'git://github.com/tablatom/hobo.git' do gem 'hobo_fields' #gem 'dryml' gem 'hobo_support' #gem 'hobo' end group :test do gem &quot;shoulda&quot; gem &quot;factory_girl&quot; #TODO: Introduce steak/capybara for integration test end</code></pre></div> <p>As you see, I am able to use gems directly from github. (HoboFields for Rails 3.2 is only on GitHub at this date)</p> <h2><span>Now. Let's Finish It DRY!</span></h2> <p>Now you can scaffold a blog Post:</p> <div class="code"> <pre><code> rails g scaffold Post title:string text:text</code></pre></div> <p>And provide your DRY controller:</p> <div class="code"> <pre><code>class PostsController &lt; InheritedResources::Base respond_to :html, :json end</code></pre></div> <p>Along with your DRYer model:</p> <div class="code"> <pre><code>class Post &lt; ActiveRecord::Base default_scope :order =&gt; 'created_at DESC' fields do title :string text :text timestamps end validates :title, :presence =&gt; true, :length =&gt; { :minimum =&gt; 5 } end</code></pre></div> <p>This model allows automatic migratoins:</p> <div class="code"> <pre><code>rails g hobo:migrations</code></pre></div> <p>Just rapid ruby on rails to the point with the help of 2 generators. Now you can focus your energy more to the user interface. You dont wanna code more, right?</p> <p>To create the code mentioned here, <a href="http://conceptspace.wikidot.com/blog:template-for-dryer-rails-demo-blog" target="_blank">you can use this template</a>.</p> <h2><span>Moreover</span></h2> <p>This kind of application is ready to work on <a href="http://www.heroku.com/">the cloud (Heroku)</a>. Just go and deploy your project to the world.</p> <p>Rails contains a myriad of options. You should use <a href="https://github.com/RailsApps/rails-composer/">RailsComposer</a> to create new projects&#8230; And see <a href="http://railsapps.github.com/">more Rails examples</a></p> <h2><span>References</span></h2> <ul> <li><a href="https://github.com/josevalim/inherited_resources/">https://github.com/josevalim/inherited_resources/</a></li> <li><a href="http://cookbook.hobocentral.net/manual/hobo_fields">http://cookbook.hobocentral.net/manual/hobo_fields</a></li> <li><a href="http://asciicasts.com/episodes/216-generators-in-rails-3">http://asciicasts.com/episodes/216-generators-in-rails-3</a></li> </ul> <h2><span>Note</span></h2> <p>I am not touching AJAX, Styling or whatever here intentionally. There are zillions of ways and preferences for that&#8230;</p> <h2><span>Another Note</span></h2> <p>Like all blog posts, this one will become out of date one day and it won't work any more. It would be nice if we could &quot;unit test&quot; and debug blog posts. Technically possible. However it would be nice if had a DSL that fits naturally to blogging. Does anybody have an inspiration?</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:getting-started-with-rails-edge</guid>
				<title>Fixing &quot;Getting Started with Rails.Edge&#039;</title>
				<link>http://conceptspace.wikidot.com/blog:getting-started-with-rails-edge</link>
				<description>

&lt;p&gt;Newly generated rails 3.2 projects has a very small small glitch. Follow &lt;a href=&quot;http://edgeguides.rubyonrails.org/getting_started.html&quot; target=&quot;_blank&quot;&gt;Edge Rails Getting Started&lt;/a&gt;. However, before starting&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;rails server&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;br /&gt;
uncomment this line in &#039;Gemfile&#039;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;therubyracer&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;platforms&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ruby&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
.
&lt;p&gt;Now rails server will not complain about Javascript runtime&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;`autodetect&#039;: Could not find a JavaScript runtime.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Just keep uncommenting that line in new rails projects until this bug is fixed&amp;#8230;&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 02 Aug 2012 10:22:38 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Newly generated rails 3.2 projects has a very small small glitch. Follow <a href="http://edgeguides.rubyonrails.org/getting_started.html" target="_blank">Edge Rails Getting Started</a>. However, before starting</p> <div class="code"> <pre><code>rails server</code></pre></div> <br /> uncomment this line in 'Gemfile' <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">therubyracer</span><span class="hl-quotes">'</span><span class="hl-code">, :</span><span class="hl-identifier">platforms</span><span class="hl-code"> =&gt; :</span><span class="hl-identifier">ruby</span></pre></div> </div> <br /> . <p>Now rails server will not complain about Javascript runtime</p> <div class="code"> <pre><code>`autodetect': Could not find a JavaScript runtime.</code></pre></div> <p>Just keep uncommenting that line in new rails projects until this bug is fixed&#8230;</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:begin-ruby-on-rails</guid>
				<title>Begin Ruby on Rails</title>
				<link>http://conceptspace.wikidot.com/blog:begin-ruby-on-rails</link>
				<description>

&lt;p&gt;See &lt;a href=&quot;http://sprng.me/e515u&quot; target=&quot;_blank&quot;&gt;Begin Ruby on Rails Here&lt;/a&gt; . I compiled links to start learning Ruby and Rails when a friend asked me where to look. So &lt;a href=&quot;http://sprng.me/e515u&quot;&gt;here is a good set of links to start learning Ruby on Rails&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 14 May 2012 14:38:14 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>See <a href="http://sprng.me/e515u" target="_blank">Begin Ruby on Rails Here</a> . I compiled links to start learning Ruby and Rails when a friend asked me where to look. So <a href="http://sprng.me/e515u">here is a good set of links to start learning Ruby on Rails</a>.</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:installing-gosu-the-game-engine-for-ruby</guid>
				<title>Installing GOSU - The game engine for Ruby</title>
				<link>http://conceptspace.wikidot.com/blog:installing-gosu-the-game-engine-for-ruby</link>
				<description>

&lt;p&gt;Even the kids can write games however, you need those libraries on your Ubuntu. After that you can enjoy &lt;a href=&quot;http://ruby4kids.com/&quot; target=&quot;_blank&quot;&gt;Ruby4Kids&lt;/a&gt; and follow &lt;a href=&quot;http://http://www.libgosu.org/&quot;&gt;installation instructions for Gosu&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;apt&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;mesa&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;common&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libopenal&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libvorbis&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libsndfile1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libfreeimage&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libsdl1&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;.2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libsdl&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ttf2&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;.0&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;freeglut3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libgl1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;mesa&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libglu1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;mesa&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;freeglut3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;libopengl&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ruby1&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;.9.1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I am just assuming that you&#039;re using &lt;a href=&quot;http://beginrescueend.com/rvm/install/&quot; target=&quot;_blank&quot;&gt;RVM&lt;/a&gt; and Ruby1.9!!!&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 24 Mar 2012 22:09:24 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Even the kids can write games however, you need those libraries on your Ubuntu. After that you can enjoy <a href="http://ruby4kids.com/" target="_blank">Ruby4Kids</a> and follow <a href="http://http://www.libgosu.org/">installation instructions for Gosu</a>:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">sudo</span><span class="hl-code"> </span><span class="hl-identifier">apt</span><span class="hl-code">-</span><span class="hl-identifier">get</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">mesa</span><span class="hl-code">-</span><span class="hl-identifier">common</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libopenal</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libvorbis</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libsndfile1</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libfreeimage</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libsdl1</span><span class="hl-number">.2</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libsdl</span><span class="hl-code">-</span><span class="hl-identifier">ttf2</span><span class="hl-number">.0</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">freeglut3</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libgl1</span><span class="hl-code">-</span><span class="hl-identifier">mesa</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libglu1</span><span class="hl-code">-</span><span class="hl-identifier">mesa</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">freeglut3</span><span class="hl-code">-</span><span class="hl-identifier">dev</span><span class="hl-code"> </span><span class="hl-identifier">libopengl</span><span class="hl-code">-</span><span class="hl-identifier">ruby1</span><span class="hl-number">.9.1</span></pre></div> </div> <p>I am just assuming that you're using <a href="http://beginrescueend.com/rvm/install/" target="_blank">RVM</a> and Ruby1.9!!!</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:start-your-html5-graphics-applications</guid>
				<title>Start your HTML5 Graphics Applications</title>
				<link>http://conceptspace.wikidot.com/blog:start-your-html5-graphics-applications</link>
				<description>

&lt;p&gt;&lt;a href=&quot;http://processingjs.org/&quot; target=&quot;_blank&quot;&gt;Processing.js&lt;/a&gt; is the sister project of the popular Processing visual programming language, designed for the web. Processing.js makes your data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 17 Feb 2012 14:05:16 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p><a href="http://processingjs.org/" target="_blank">Processing.js</a> is the sister project of the popular Processing visual programming language, designed for the web. Processing.js makes your data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins.</p> <img src="http://processingjs.org/images/exhibition/fizz-processingjs.png" alt="fizz-processingjs.png" class="image" /> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:ruby-on-rails-weblog</guid>
				<title>Ruby on Rails Weblog</title>
				<link>http://conceptspace.wikidot.com/blog:ruby-on-rails-weblog</link>
				<description>

&lt;p&gt;&lt;a href=&quot;http://trailmeme.com/trails/Ruby_on_Rails_Weblog&quot;&gt;Ruby on Rails Weblog&lt;/a&gt; is nice collection of pages about Ruby. You walk the pages without leaving the trail.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 04 Feb 2012 04:34:45 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p><a href="http://trailmeme.com/trails/Ruby_on_Rails_Weblog">Ruby on Rails Weblog</a> is nice collection of pages about Ruby. You walk the pages without leaving the trail.</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:tagging-ruby-on-rails</guid>
				<title>Tagging &amp; Ruby on Rails</title>
				<link>http://conceptspace.wikidot.com/blog:tagging-ruby-on-rails</link>
				<description>

&lt;p&gt;Just read &lt;a href=&quot;http://ohm.keyvalue.org/examples/tagging.html&quot; target=&quot;_blank&quot;&gt;Tagging Tutorial&lt;/a&gt; and get ready for blazing fast and easy tagging on your objects. All thanks to &lt;a href=&quot;https://github.com/soveran/ohm&quot; target=&quot;_blank&quot;&gt;Soveran/ Ohm&lt;/a&gt;: The library that maps ruby objects to Redis .&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 07 Jun 2011 15:17:07 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Just read <a href="http://ohm.keyvalue.org/examples/tagging.html" target="_blank">Tagging Tutorial</a> and get ready for blazing fast and easy tagging on your objects. All thanks to <a href="https://github.com/soveran/ohm" target="_blank">Soveran/ Ohm</a>: The library that maps ruby objects to Redis .</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:rails:search-comments-only</guid>
				<title>Rails: Search Comments Only</title>
				<link>http://conceptspace.wikidot.com/blog:rails:search-comments-only</link>
				<description>

&lt;p&gt;You can only inside the comments of your ruby files:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;notes&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;custom&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ANNOTATION&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=\&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;find_me&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.*\&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Noted from &lt;a href=&quot;http://rbjl.net/13-organise-your-code-comments-with-rake-notes-todo&quot; target=&quot;_blank&quot;&gt;code needs smileys J-_-L&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 04 Jun 2011 12:51:33 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>You can only inside the comments of your ruby files:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rake</span><span class="hl-code"> </span><span class="hl-identifier">notes</span><span class="hl-code">:</span><span class="hl-identifier">custom</span><span class="hl-code"> </span><span class="hl-identifier">ANNOTATION</span><span class="hl-code">=\</span><span class="hl-brackets">(</span><span class="hl-code">.*</span><span class="hl-identifier">find_me</span><span class="hl-code">.*\</span><span class="hl-brackets">)</span></pre></div> </div> <p>Noted from <a href="http://rbjl.net/13-organise-your-code-comments-with-rake-notes-todo" target="_blank">code needs smileys J-_-L</a></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:redis-server</guid>
				<title>Redis Server Setup on Ubuntu</title>
				<link>http://conceptspace.wikidot.com/blog:redis-server</link>
				<description>

&lt;p&gt;If you have maverick:&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 22 Mar 2011 15:34:16 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>If you have maverick:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">apt</span><span class="hl-code">-</span><span class="hl-identifier">get</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">redis</span><span class="hl-code">-</span><span class="hl-identifier">server</span></pre></div> </div> <p>Else (lucid, karmic, jaunty):</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">cd</span><span class="hl-quotes"> /</span><span class="hl-string">tmp curl -O http:</span><span class="hl-quotes">//</span><span class="hl-string">redis.googlecode.com</span><span class="hl-quotes">/</span><span class="hl-identifier">files</span><span class="hl-quotes">/</span><span class="hl-string">redis-2.2.2.tar.gz tar xzf redis-2.2.2.tar.gz cd redis-2.2.2 make sudo make install sudo cp utils</span><span class="hl-quotes">/</span><span class="hl-identifier">redis_init_script</span><span class="hl-quotes"> /</span><span class="hl-string">etc</span><span class="hl-quotes">/i</span><span class="hl-identifier">nit</span><span class="hl-code">.</span><span class="hl-identifier">d</span><span class="hl-quotes">/</span><span class="hl-string">redis sudo mkdir </span><span class="hl-quotes">/</span><span class="hl-identifier">etc</span><span class="hl-quotes">/</span><span class="hl-string">redis sudo cp redis.conf </span><span class="hl-quotes">/</span><span class="hl-identifier">etc</span><span class="hl-quotes">/</span><span class="hl-string">redis</span><span class="hl-quotes">/</span><span class="hl-number">6379.</span><span class="hl-identifier">conf</span></pre></div> </div> <p>Have fun with <a href="http://redis.io/">Redis</a></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:using-hobo-edge-on-rails-3</guid>
				<title>Using Hobo Edge on Rails 3</title>
				<link>http://conceptspace.wikidot.com/blog:using-hobo-edge-on-rails-3</link>
				<description>

&lt;div&gt;
&lt;p&gt;!!!Hobo is not yet compatible with rails 3.2 so be sure to have &amp;quot;gem rails, &amp;quot;=3.1&amp;quot; in your Gemrfile.&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;p&gt;I describe here installing Hobo Edge on Rails 3 using rvm. And command prompt shows your current gemset. To keep my existing applicaitons happy, I will also define a gemset for Rails 2 Hobo applications.&lt;/p&gt;
&lt;table style=&quot;margin:0; padding:0&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;margin:0; padding:0&quot;&gt;
&lt;div id=&quot;toc&quot;&gt;
&lt;div id=&quot;toc-action-bar&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;Fold&lt;/a&gt;&lt;a style=&quot;display: none&quot; href=&quot;javascript:;&quot;  &gt;Unfold&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;title&quot;&gt;Table of Contents&lt;/div&gt;
&lt;div id=&quot;toc-list&quot;&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc0&quot;&gt;rvm&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc1&quot;&gt;Rails 2&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc2&quot;&gt;Rails 3&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc3&quot;&gt;Hobo Rails 3 Reference&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc4&quot;&gt;Summary&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc5&quot;&gt;Dynamic Bash Shell Prompt&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc6&quot;&gt;Bundle&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc7&quot;&gt;Bundle Rails 2&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#toc8&quot;&gt;Adding Bundle to Rails 2&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc9&quot;&gt;Bundle Rails 3&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h1&gt;&lt;span&gt;rvm&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Followed the instructions on &lt;a href=&quot;http://rvm.beginrescueend.com/&quot;&gt;http://rvm.beginrescueend.com/&lt;/a&gt; to install rvm&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;bash&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &amp;lt; &amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;beginrescueend&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;releases&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then edited ~/.rvmrc so that on exiting a project directory the environment returns to system defaults.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm_pretty_print_flag&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm_project_rvmrc_default&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Intalled ruby with rvm so that I can create project gemsets under it. And of course we need bundler&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.8.7&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.8.7&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;RVM uses project and/or ruby specific gems:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gemdir&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can hunt code in gems using rvm gemdir. For example find definition of task in rake.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;def task&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; `&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gemdir&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;` | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then proceeded to install gems that I need globally for development&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;@global&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;bundler&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;wirble&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#for irb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;utility_belt&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#for_irb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;jeweler&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;yard&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;Rails 2&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;We need to use different gem sets for rails2 and rails3. Having them only in project gemsets are not enough. Then you cannot create projects.&lt;/p&gt;
&lt;p&gt;Note that you can always switch to the global gemset: &#039;rvm use @global&#039; .&lt;br /&gt;
Let&#039;s create rails2 gemset:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-comment&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;$HOME/.rvm/scripts/rvm&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.8.7&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;@rails2hobo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Gemset&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;: `&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gemset&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;`
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;2.3.11&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sqlite3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.3.3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;will_paginate&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;2.3.11&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;hobo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.0.2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;haml&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;3.0.12&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dalli&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.0.2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rspec&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.3.1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rspec&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.3.3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;steak&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;0.3.8&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;capybara&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;0.4.1.2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;shoulda&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;2.11.3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;mocha&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;0.9.12&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;factory_girl&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.3.3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# Other usual suspects for testing&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# gem install delorean --version 1.0.0 #Change Time.now in tests&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# gem install database_cleaner --version 0.6.4 #Remove data&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# gem install spork --version 0.8.4 #Solid test server&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# Fixing the gem versions because future versions might be Rails 2 incompatible&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;Rails 3&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Lets create and switch to rails3 gemset and install Rails3 and Hobo&lt;br /&gt;
We&#039;ll instal Hobo from github. So that we can easily create projects.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-comment&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;$HOME/.rvm/scripts/rvm&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;@rails3hobo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Gemset&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;: `&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gemset&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;`
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sqlite3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;hobo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;pre&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;haml&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;dalli&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rspec&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;steak&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;capybara&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;shoulda&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;mocha&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;factory_girl&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
 &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;delorean&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Change Time.now in tests&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;database_cleaner&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Remove data&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;spork&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;prerelease&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Solid test server&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;&lt;span&gt;Hobo Rails 3 Reference&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Refer to &lt;a href=&quot;http://hobocentral.net/blog/2010/09/30/hobo-1-3-for-rails-3-pre-release/&quot;&gt;Using Hobo 1.3&lt;/a&gt; to start using Hobo.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://barquin.lighthouseapp.com/projects/63775/tickets/6/a/914283/rapid-rails-3-with-hobo-2011-02-15-3-draft.pdf&quot;&gt;Rapid Rails 3 with Hobo.pdf&lt;/a&gt; is the Tutorial maintained at &lt;a href=&quot;https://barquin.lighthouseapp.com/projects/63775-rapid-rails-3-with-hobo/overview&quot;&gt;LightHouse&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;&lt;span&gt;Summary&lt;/span&gt;&lt;/h1&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Use the operating system installation&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.8.7&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Switching to global gems. Use global gems and use Ruby 1.8.7&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;@rails2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#use rails2 with current Ruby&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;@rails3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#use rails3 with current Ruby&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;1.8.7&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;@rails3&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#use rails3 with Ruby 1.8.7&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gemdir&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;Dynamic Bash Shell Prompt&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Shell prompt can show your current git branch and rvm gemset. It saves your fingers. Use or adapt the prompt ~/.bashrc file below. I kept it short so that you can easily extend your existing .bashrc.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-reserved&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;$PS1&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; ; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Remember rmv does not like return&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# OTHER THINGS THAT YOU WANT TO HAVE&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;parse_git_branch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; {
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;no&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt; /&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sed&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;/^[^*]/d&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;s/* &lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\(&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;.*&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\)&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;/(&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\1&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;)/&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
}
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm_gem_set&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; {
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gemset&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; \&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;
}
 
function proml {
PROMPT_COMMAND=&#039;PS1=&amp;quot;[$(date +%H:%M)]\
[&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\u&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\h&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;: **&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;W&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm_gem_set&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;parse_git_branch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;&#039;
PS2=&#039;&amp;gt; &#039;
PS4=&#039;+ &#039;
}
proml
 
[[ -s &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;.rvm&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;scripts&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rvm&amp;quot; ]] &amp;amp;&amp;amp; source &amp;quot;$HOME&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;scripts&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;  # This loads rvm
fi&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;Bundle&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Using gemsets are fine for quickly getting up and running. However, each project should have its gem bundle.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Bundle Rails 2&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This is a typical &lt;strong&gt;Gemfile&lt;/strong&gt; for Rails 2 projects:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;http://rubygems.org/&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,                &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;=2.3.11&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;hobo&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,                 &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;=1.0.2&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;haml&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,                 &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;=3.0.12&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;will_paginate&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,        &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;&amp;gt;=2.3.11&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;dalli&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;builder&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;tzinfo&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;system_timer&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;sqlite3&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;development&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;factory_girl&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;shoulda&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;mocha&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rspec&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,              &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;= 1.3.1&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,  :&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rspec-rails&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,        &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;= 1.3.3&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,  :&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;steak&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;capybara&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;delorean&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Change Time.now in tests&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;database_cleaner&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#Remove data&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;spork&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,        &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;~&amp;gt; 0.9.0.rc4&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;ruby-debug&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;development&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;&lt;span&gt;Adding Bundle to Rails 2&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;You need to change&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;config/boot.rb&lt;/li&gt;
&lt;li&gt;config/environment.rb&lt;/li&gt;
&lt;li&gt;config/preinitializer.rb&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;config/boot.rb&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-comment&quot;&gt;# ... run method modified and extend_environment method added&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Boot&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;load_initializer&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
      &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Initializer&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;set_load_path&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;extend_environment&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;extend_environment&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Initializer&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;class_eval&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;old_load&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;instance_method&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;load_gems&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;define_method&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;load_gems&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;old_load&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Bundler&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;RAILS_ENV&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;        
        &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# ...&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;config/environment.rb&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-comment&quot;&gt;#...&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Initializer&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; |&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;|
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#...&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;active_support&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#This line is added&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;#...&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;config/preinitializer.rb&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-reserved&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Pathname&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  
  &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;empty&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;?  
    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;to_s&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;empty&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;?  
  &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  
 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;# Fallback on doing the resolve at runtime.  &lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rubygems&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;bundler&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Bundler&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;setup&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;&lt;span&gt;Bundle Rails 3&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This is a typical &lt;strong&gt;Gemfile&lt;/strong&gt; for Rails 3 projects:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;http://rubygems.org/&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;will_paginate&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;hobo&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,        &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;~&amp;gt; 1.3.0.pre29&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;haml&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;dalli&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;builder&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;tzinfo&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;system_timer&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;pony&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;sinatra&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;vegas&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;yajl-ruby&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;redis-namespace&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;redis&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;sqlite3&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;development&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;factory_girl&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;shoulda&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;mocha&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rspec&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,                :&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;rspec-rails&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,          :&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;steak&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;capybara&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;ruby-debug&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;development&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sun, 06 Mar 2011 01:18:42 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <div> <p>!!!Hobo is not yet compatible with rails 3.2 so be sure to have &quot;gem rails, &quot;=3.1&quot; in your Gemrfile.</p> </div> <hr /> <p>I describe here installing Hobo Edge on Rails 3 using rvm. And command prompt shows your current gemset. To keep my existing applicaitons happy, I will also define a gemset for Rails 2 Hobo applications.</p> <table style="margin:0; padding:0"> <tr> <td style="margin:0; padding:0"> <div id="toc"> <div id="toc-action-bar"><a href="javascript:;" >Fold</a><a style="display: none" href="javascript:;" >Unfold</a></div> <div class="title">Table of Contents</div> <div id="toc-list"> <div style="margin-left: 1em;"><a href="#toc0">rvm</a></div> <div style="margin-left: 1em;"><a href="#toc1">Rails 2</a></div> <div style="margin-left: 1em;"><a href="#toc2">Rails 3</a></div> <div style="margin-left: 2em;"><a href="#toc3">Hobo Rails 3 Reference</a></div> <div style="margin-left: 1em;"><a href="#toc4">Summary</a></div> <div style="margin-left: 1em;"><a href="#toc5">Dynamic Bash Shell Prompt</a></div> <div style="margin-left: 1em;"><a href="#toc6">Bundle</a></div> <div style="margin-left: 2em;"><a href="#toc7">Bundle Rails 2</a></div> <div style="margin-left: 3em;"><a href="#toc8">Adding Bundle to Rails 2</a></div> <div style="margin-left: 2em;"><a href="#toc9">Bundle Rails 3</a></div> </div> </div> </td> </tr> </table> <h1><span>rvm</span></h1> <p>Followed the instructions on <a href="http://rvm.beginrescueend.com/">http://rvm.beginrescueend.com/</a> to install rvm</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">bash</span><span class="hl-code"> &lt; &lt;</span><span class="hl-brackets">(</span><span class="hl-code"> </span><span class="hl-identifier">curl</span><span class="hl-code"> </span><span class="hl-identifier">http</span><span class="hl-code">:</span><span class="hl-quotes">//</span><span class="hl-identifier">rvm</span><span class="hl-code">.</span><span class="hl-identifier">beginrescueend</span><span class="hl-code">.</span><span class="hl-identifier">com</span><span class="hl-quotes">/</span><span class="hl-string">releases</span><span class="hl-quotes">/</span><span class="hl-identifier">rvm</span><span class="hl-code">-</span><span class="hl-identifier">install</span><span class="hl-code">-</span><span class="hl-identifier">head</span><span class="hl-code"> </span><span class="hl-brackets">)</span></pre></div> </div> <p>Then edited ~/.rvmrc so that on exiting a project directory the environment returns to system defaults.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">export</span><span class="hl-code"> </span><span class="hl-identifier">rvm_pretty_print_flag</span><span class="hl-code">=</span><span class="hl-number">1</span><span class="hl-code"> </span><span class="hl-identifier">export</span><span class="hl-code"> </span><span class="hl-identifier">rvm_project_rvmrc_default</span><span class="hl-code">=</span><span class="hl-number">1</span></pre></div> </div> <p>Intalled ruby with rvm so that I can create project gemsets under it. And of course we need bundler</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-number">1.8.7</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> --</span><span class="hl-identifier">default</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-number">1.8.7</span></pre></div> </div> <p>RVM uses project and/or ruby specific gems:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">gemdir</span></pre></div> </div> <p>You can hunt code in gems using rvm gemdir. For example find definition of task in rake.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">grep</span><span class="hl-code"> -</span><span class="hl-identifier">R</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">def task</span><span class="hl-quotes">'</span><span class="hl-code"> `</span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">gemdir</span><span class="hl-code">` | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-identifier">rake</span></pre></div> </div> <p>Then proceeded to install gems that I need globally for development</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-var">@global</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">bundler</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">wirble</span><span class="hl-code"> </span><span class="hl-comment">#for irb</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">utility_belt</span><span class="hl-code"> </span><span class="hl-comment">#for_irb</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">jeweler</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">yard</span></pre></div> </div> <h1><span>Rails 2</span></h1> <p>We need to use different gem sets for rails2 and rails3. Having them only in project gemsets are not enough. Then you cannot create projects.</p> <p>Note that you can always switch to the global gemset: 'rvm use @global' .<br /> Let's create rails2 gemset:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#!/bin/bash</span><span class="hl-code"> </span><span class="hl-identifier">source</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">$HOME/.rvm/scripts/rvm</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-number">1.8.7</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-var">@rails2hobo</span><span class="hl-code"> --</span><span class="hl-identifier">create</span><span class="hl-code"> </span><span class="hl-identifier">echo</span><span class="hl-code"> </span><span class="hl-identifier">Gemset</span><span class="hl-code">: `</span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">gemset</span><span class="hl-code"> </span><span class="hl-identifier">name</span><span class="hl-code">` </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">rails</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">2.3.11</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">sqlite3</span><span class="hl-code">-</span><span class="hl-identifier">ruby</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">1.3.3</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">will_paginate</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">2.3.11</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">hobo</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">1.0.2</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">haml</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">3.0.12</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">dalli</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">1.0.2</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">rspec</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">1.3.1</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">rspec</span><span class="hl-code">-</span><span class="hl-identifier">rails</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">1.3.3</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">steak</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">0.3.8</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">capybara</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">0.4.1.2</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">shoulda</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">2.11.3</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">mocha</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">0.9.12</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">factory_girl</span><span class="hl-code"> --</span><span class="hl-identifier">version</span><span class="hl-code"> </span><span class="hl-number">1.3.3</span><span class="hl-code"> </span><span class="hl-comment"># Other usual suspects for testing</span><span class="hl-code"> </span><span class="hl-comment"># gem install delorean --version 1.0.0 #Change Time.now in tests</span><span class="hl-code"> </span><span class="hl-comment"># gem install database_cleaner --version 0.6.4 #Remove data</span><span class="hl-code"> </span><span class="hl-comment"># gem install spork --version 0.8.4 #Solid test server</span><span class="hl-code"> </span><span class="hl-comment"># Fixing the gem versions because future versions might be Rails 2 incompatible</span></pre></div> </div> <h1><span>Rails 3</span></h1> <p>Lets create and switch to rails3 gemset and install Rails3 and Hobo<br /> We'll instal Hobo from github. So that we can easily create projects.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#!/bin/bash</span><span class="hl-code"> </span><span class="hl-identifier">source</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">$HOME/.rvm/scripts/rvm</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-var">@rails3hobo</span><span class="hl-code"> --</span><span class="hl-identifier">create</span><span class="hl-code"> </span><span class="hl-identifier">echo</span><span class="hl-code"> </span><span class="hl-identifier">Gemset</span><span class="hl-code">: `</span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">gemset</span><span class="hl-code"> </span><span class="hl-identifier">name</span><span class="hl-code">` </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">rails</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">sqlite3</span><span class="hl-code">-</span><span class="hl-identifier">ruby</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">hobo</span><span class="hl-code"> --</span><span class="hl-identifier">pre</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">haml</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">dalli</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">rspec</span><span class="hl-code">-</span><span class="hl-identifier">rails</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">steak</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">capybara</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">shoulda</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">mocha</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">factory_girl</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">delorean</span><span class="hl-code"> </span><span class="hl-comment">#Change Time.now in tests</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">database_cleaner</span><span class="hl-code"> </span><span class="hl-comment">#Remove data</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-identifier">install</span><span class="hl-code"> </span><span class="hl-identifier">spork</span><span class="hl-code"> --</span><span class="hl-identifier">prerelease</span><span class="hl-code"> </span><span class="hl-comment">#Solid test server</span></pre></div> </div> <h2><span>Hobo Rails 3 Reference</span></h2> <p>Refer to <a href="http://hobocentral.net/blog/2010/09/30/hobo-1-3-for-rails-3-pre-release/">Using Hobo 1.3</a> to start using Hobo.</p> <p><a href="https://barquin.lighthouseapp.com/projects/63775/tickets/6/a/914283/rapid-rails-3-with-hobo-2011-02-15-3-draft.pdf">Rapid Rails 3 with Hobo.pdf</a> is the Tutorial maintained at <a href="https://barquin.lighthouseapp.com/projects/63775-rapid-rails-3-with-hobo/overview">LightHouse</a>.</p> <h1><span>Summary</span></h1> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-identifier">system</span><span class="hl-code"> </span><span class="hl-comment">#Use the operating system installation</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-number">1.8.7</span><span class="hl-code"> </span><span class="hl-comment">#Switching to global gems. Use global gems and use Ruby 1.8.7</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-var">@rails2</span><span class="hl-code"> </span><span class="hl-comment">#use rails2 with current Ruby</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-var">@rails3</span><span class="hl-code"> </span><span class="hl-comment">#use rails3 with current Ruby</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">use</span><span class="hl-code"> </span><span class="hl-number">1.8.7</span><span class="hl-var">@rails3</span><span class="hl-code"> </span><span class="hl-comment">#use rails3 with Ruby 1.8.7</span><span class="hl-code"> </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">gemdir</span></pre></div> </div> <h1><span>Dynamic Bash Shell Prompt</span></h1> <p>Shell prompt can show your current git branch and rvm gemset. It saves your fingers. Use or adapt the prompt ~/.bashrc file below. I kept it short so that you can easily extend your existing .bashrc.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-brackets">[[</span><span class="hl-code"> -</span><span class="hl-identifier">n</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">$PS1</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-brackets">]]</span><span class="hl-code"> ; </span><span class="hl-reserved">then</span><span class="hl-code"> </span><span class="hl-comment">#Remember rmv does not like return</span><span class="hl-code"> </span><span class="hl-comment"># OTHER THINGS THAT YOU WANT TO HAVE</span><span class="hl-code"> </span><span class="hl-identifier">function</span><span class="hl-code"> </span><span class="hl-identifier">parse_git_branch</span><span class="hl-code"> { </span><span class="hl-identifier">git</span><span class="hl-code"> </span><span class="hl-identifier">branch</span><span class="hl-code"> --</span><span class="hl-identifier">no</span><span class="hl-code">-</span><span class="hl-identifier">color</span><span class="hl-code"> </span><span class="hl-number">2</span><span class="hl-code">&gt;</span><span class="hl-quotes"> /</span><span class="hl-string">dev</span><span class="hl-quotes">/</span><span class="hl-identifier">null</span><span class="hl-code"> | </span><span class="hl-identifier">sed</span><span class="hl-code"> -</span><span class="hl-identifier">e</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">/^[^*]/d</span><span class="hl-quotes">'</span><span class="hl-code"> -</span><span class="hl-identifier">e</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">s/* </span><span class="hl-special">\(</span><span class="hl-string">.*</span><span class="hl-special">\)</span><span class="hl-string">/(</span><span class="hl-special">\1</span><span class="hl-string">)/</span><span class="hl-quotes">'</span><span class="hl-code"> } </span><span class="hl-identifier">function</span><span class="hl-code"> </span><span class="hl-identifier">rvm_gem_set</span><span class="hl-code"> { </span><span class="hl-identifier">rvm</span><span class="hl-code"> </span><span class="hl-identifier">gemset</span><span class="hl-code"> </span><span class="hl-identifier">name</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> -</span><span class="hl-identifier">v</span><span class="hl-code"> \</span><span class="hl-quotes">/</span><span class="hl-string"> } function proml { PROMPT_COMMAND='PS1=&quot;[$(date +%H:%M)]\ [</span><span class="hl-special">\u</span><span class="hl-string">@</span><span class="hl-special">\h</span><span class="hl-string">: **</span><span class="hl-quotes">/</span><span class="hl-code">\</span><span class="hl-identifier">W</span><span class="hl-code">] </span><span class="hl-var">$(</span><span class="hl-identifier">rvm_gem_set</span><span class="hl-code">) </span><span class="hl-var">$(</span><span class="hl-identifier">parse_git_branch</span><span class="hl-code">) </span><span class="hl-var">$ </span><span class="hl-quotes">&quot;</span><span class="hl-string">' PS2='&gt; ' PS4='+ ' } proml [[ -s </span><span class="hl-quotes">&quot;</span><span class="hl-var">$HOME</span><span class="hl-quotes">/</span><span class="hl-string">.rvm</span><span class="hl-quotes">/</span><span class="hl-identifier">scripts</span><span class="hl-quotes">/</span><span class="hl-string">rvm&quot; ]] &amp;&amp; source &quot;$HOME</span><span class="hl-quotes">/</span><span class="hl-code">.</span><span class="hl-identifier">rvm</span><span class="hl-quotes">/</span><span class="hl-string">scripts</span><span class="hl-quotes">/</span><span class="hl-identifier">rvm</span><span class="hl-quotes">&quot;</span><span class="hl-string"> # This loads rvm fi</span></pre></div> </div> <h1><span>Bundle</span></h1> <p>Using gemsets are fine for quickly getting up and running. However, each project should have its gem bundle.</p> <h2><span>Bundle Rails 2</span></h2> <p>This is a typical <strong>Gemfile</strong> for Rails 2 projects:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">source</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">http://rubygems.org/</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rails</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">=2.3.11</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">hobo</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">=1.0.2</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">haml</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">=3.0.12</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">will_paginate</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">&gt;=2.3.11</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">dalli</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">builder</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">tzinfo</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">system_timer</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">sqlite3</span><span class="hl-quotes">&quot;</span><span class="hl-code">, :</span><span class="hl-identifier">groups</span><span class="hl-code"> =&gt; </span><span class="hl-brackets">[</span><span class="hl-code">:</span><span class="hl-identifier">test</span><span class="hl-code">, :</span><span class="hl-identifier">development</span><span class="hl-brackets">]</span><span class="hl-code"> </span><span class="hl-identifier">group</span><span class="hl-code"> :</span><span class="hl-identifier">test</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">factory_girl</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">shoulda</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">mocha</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rspec</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">= 1.3.1</span><span class="hl-quotes">&quot;</span><span class="hl-code">, :</span><span class="hl-reserved">require</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">nil</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rspec-rails</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">= 1.3.3</span><span class="hl-quotes">&quot;</span><span class="hl-code">, :</span><span class="hl-reserved">require</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">nil</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">steak</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">capybara</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">delorean</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-comment">#Change Time.now in tests</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">database_cleaner</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-comment">#Remove data</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">spork</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">~&gt; 0.9.0.rc4</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">ruby-debug</span><span class="hl-quotes">'</span><span class="hl-code">, :</span><span class="hl-identifier">groups</span><span class="hl-code"> =&gt; </span><span class="hl-brackets">[</span><span class="hl-code">:</span><span class="hl-identifier">test</span><span class="hl-code">, :</span><span class="hl-identifier">development</span><span class="hl-brackets">]</span></pre></div> </div> <h3><span>Adding Bundle to Rails 2</span></h3> <p>You need to change</p> <ul> <li>config/boot.rb</li> <li>config/environment.rb</li> <li>config/preinitializer.rb</li> </ul> <p>config/boot.rb</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment"># ... run method modified and extend_environment method added</span><span class="hl-code"> </span><span class="hl-reserved">class</span><span class="hl-code"> </span><span class="hl-identifier">Boot</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-identifier">run</span><span class="hl-code"> </span><span class="hl-identifier">load_initializer</span><span class="hl-code"> </span><span class="hl-identifier">Rails</span><span class="hl-code">::</span><span class="hl-identifier">Initializer</span><span class="hl-code">.</span><span class="hl-identifier">run</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">set_load_path</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">extend_environment</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-identifier">extend_environment</span><span class="hl-code"> </span><span class="hl-identifier">Rails</span><span class="hl-code">::</span><span class="hl-identifier">Initializer</span><span class="hl-code">.</span><span class="hl-identifier">class_eval</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> </span><span class="hl-identifier">old_load</span><span class="hl-code"> = </span><span class="hl-identifier">instance_method</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">load_gems</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-identifier">define_method</span><span class="hl-brackets">(</span><span class="hl-code">:</span><span class="hl-identifier">load_gems</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> </span><span class="hl-identifier">old_load</span><span class="hl-code">.</span><span class="hl-identifier">bind</span><span class="hl-brackets">(</span><span class="hl-reserved">self</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">call</span><span class="hl-code"> </span><span class="hl-identifier">Bundler</span><span class="hl-code">.</span><span class="hl-reserved">require</span><span class="hl-code"> :</span><span class="hl-identifier">default</span><span class="hl-code">, </span><span class="hl-identifier">RAILS_ENV</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-comment"># ...</span></pre></div> </div> <p>config/environment.rb</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-comment">#...</span><span class="hl-code"> </span><span class="hl-identifier">Rails</span><span class="hl-code">::</span><span class="hl-identifier">Initializer</span><span class="hl-code">.</span><span class="hl-identifier">run</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> |</span><span class="hl-identifier">config</span><span class="hl-code">| </span><span class="hl-comment">#...</span><span class="hl-code"> </span><span class="hl-reserved">require</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">active_support</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-comment">#This line is added</span><span class="hl-code"> </span><span class="hl-comment">#...</span></pre></div> </div> <p>config/preinitializer.rb</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-reserved">class</span><span class="hl-code"> </span><span class="hl-identifier">Pathname</span><span class="hl-code"> </span><span class="hl-reserved">def</span><span class="hl-code"> </span><span class="hl-identifier">empty</span><span class="hl-code">? </span><span class="hl-identifier">to_s</span><span class="hl-code">.</span><span class="hl-identifier">empty</span><span class="hl-code">? </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-comment"># Fallback on doing the resolve at runtime. </span><span class="hl-code"> </span><span class="hl-reserved">require</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rubygems</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-reserved">require</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">bundler</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">Bundler</span><span class="hl-code">.</span><span class="hl-identifier">setup</span></pre></div> </div> <h2><span>Bundle Rails 3</span></h2> <p>This is a typical <strong>Gemfile</strong> for Rails 3 projects:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">source</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">http://rubygems.org/</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rails</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">will_paginate</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">hobo</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">~&gt; 1.3.0.pre29</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">haml</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">dalli</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">builder</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">tzinfo</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">system_timer</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">pony</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">sinatra</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">vegas</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">yajl-ruby</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">redis-namespace</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">redis</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">sqlite3</span><span class="hl-quotes">&quot;</span><span class="hl-code">, :</span><span class="hl-identifier">groups</span><span class="hl-code"> =&gt; </span><span class="hl-brackets">[</span><span class="hl-code">:</span><span class="hl-identifier">test</span><span class="hl-code">, :</span><span class="hl-identifier">development</span><span class="hl-brackets">]</span><span class="hl-code"> </span><span class="hl-identifier">group</span><span class="hl-code"> :</span><span class="hl-identifier">test</span><span class="hl-code"> </span><span class="hl-reserved">do</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">factory_girl</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">shoulda</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">mocha</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rspec</span><span class="hl-quotes">&quot;</span><span class="hl-code">, :</span><span class="hl-reserved">require</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">nil</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">rspec-rails</span><span class="hl-quotes">&quot;</span><span class="hl-code">, :</span><span class="hl-reserved">require</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">nil</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">steak</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">&quot;</span><span class="hl-string">capybara</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-reserved">end</span><span class="hl-code"> </span><span class="hl-identifier">gem</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">ruby-debug</span><span class="hl-quotes">'</span><span class="hl-code">, :</span><span class="hl-identifier">groups</span><span class="hl-code"> =&gt; </span><span class="hl-brackets">[</span><span class="hl-code">:</span><span class="hl-identifier">test</span><span class="hl-code">, :</span><span class="hl-identifier">development</span><span class="hl-brackets">]</span></pre></div> </div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:rails:match-each-has-many-with-a-belongs-to</guid>
				<title>Rails: Match each has_many with a belongs_to</title>
				<link>http://conceptspace.wikidot.com/blog:rails:match-each-has-many-with-a-belongs-to</link>
				<description>

&lt;p&gt;Matching each belongs_to to a has_many might be tedious. You can check it on the bash shell:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;parent_class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;B&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;child_class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$B&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;*.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;has_many&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$A&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$A&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;*.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$B&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Then you&#039;ll see clearly parent and child classes are matching:
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;parent_class.rb:  has_many :child_classes,                                  :dependent=&amp;gt;:destroy
.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;child_class&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:  &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;belongs_to&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;parent_class&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And of course you did not forget :dependent option, right?&lt;/p&gt;
&lt;p&gt;Each has_many in your application should be one of those if it&#039;s not :through&lt;/p&gt;
&lt;p&gt;A) Parent has to destroy it&#039;s children&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;parent_class.rb:  has_many :child_classes,                                  :dependent=&amp;gt;:destroy&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;B) Children forgets parent&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;parent_class.rb:  has_many :child_classes,                                  :dependent=&amp;gt;:nullify&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;C) Parent is in use. It cannot be destroyed:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;parent_class.rb:  has_many :child_classes,                                  :dependent=&amp;gt;:restrict&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If your version of Rails do not have :restrict option then you can:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;parent_class.rb:  has_many :child_classes, :nullify
def destroy
  super if child_classes.empty?
end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;p&gt;Finally, it&#039;s a wise idea to peer review all has_many&#039;s in the application&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;has_many&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;*.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 25 Feb 2011 21:53:52 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Matching each belongs_to to a has_many might be tedious. You can check it on the bash shell:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">A</span><span class="hl-code">=</span><span class="hl-identifier">parent_class</span><span class="hl-code">; </span><span class="hl-identifier">B</span><span class="hl-code">=</span><span class="hl-identifier">child_class</span><span class="hl-code">; </span><span class="hl-identifier">grep</span><span class="hl-code"> -</span><span class="hl-identifier">R</span><span class="hl-code"> :</span><span class="hl-var">$B</span><span class="hl-code"> </span><span class="hl-identifier">app</span><span class="hl-quotes">/</span><span class="hl-string">models</span><span class="hl-quotes">/</span><span class="hl-code">*.</span><span class="hl-identifier">rb</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-identifier">has_many</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-var">$A</span><span class="hl-code">; </span><span class="hl-identifier">grep</span><span class="hl-code"> -</span><span class="hl-identifier">R</span><span class="hl-code"> :</span><span class="hl-var">$A</span><span class="hl-code"> </span><span class="hl-identifier">app</span><span class="hl-quotes">/</span><span class="hl-string">models</span><span class="hl-quotes">/</span><span class="hl-code">*.</span><span class="hl-identifier">rb</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-var">$B</span></pre></div> </div> <br /> Then you'll see clearly parent and child classes are matching: <div class="code"> <div class="hl-main"> <pre><span class="hl-code">.</span><span class="hl-quotes">/</span><span class="hl-string">parent_class.rb: has_many :child_classes, :dependent=&gt;:destroy .</span><span class="hl-quotes">/</span><span class="hl-identifier">child_class</span><span class="hl-code">.</span><span class="hl-identifier">rb</span><span class="hl-code">: </span><span class="hl-identifier">belongs_to</span><span class="hl-code"> :</span><span class="hl-identifier">parent_class</span></pre></div> </div> <p>And of course you did not forget :dependent option, right?</p> <p>Each has_many in your application should be one of those if it's not :through</p> <p>A) Parent has to destroy it's children</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-code">.</span><span class="hl-quotes">/</span><span class="hl-string">parent_class.rb: has_many :child_classes, :dependent=&gt;:destroy</span></pre></div> </div> <p>B) Children forgets parent</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-code">.</span><span class="hl-quotes">/</span><span class="hl-string">parent_class.rb: has_many :child_classes, :dependent=&gt;:nullify</span></pre></div> </div> <p>C) Parent is in use. It cannot be destroyed:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-code">.</span><span class="hl-quotes">/</span><span class="hl-string">parent_class.rb: has_many :child_classes, :dependent=&gt;:restrict</span></pre></div> </div> <p>If your version of Rails do not have :restrict option then you can:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-code">.</span><span class="hl-quotes">/</span><span class="hl-string">parent_class.rb: has_many :child_classes, :nullify def destroy super if child_classes.empty? end</span></pre></div> </div> <hr /> <p>Finally, it's a wise idea to peer review all has_many's in the application</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">grep</span><span class="hl-code"> -</span><span class="hl-identifier">R</span><span class="hl-code"> </span><span class="hl-identifier">has_many</span><span class="hl-code"> </span><span class="hl-identifier">app</span><span class="hl-quotes">/</span><span class="hl-string">models</span><span class="hl-quotes">/</span><span class="hl-code">*.</span><span class="hl-identifier">rb</span></pre></div> </div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:git-status-oh-my-god-there-are-many-untracked-deletes</guid>
				<title>git status. Oh my god there are many untracked deletes</title>
				<link>http://conceptspace.wikidot.com/blog:git-status-oh-my-god-there-are-many-untracked-deletes</link>
				<description>

&lt;p&gt;&lt;strong&gt;git status&lt;/strong&gt; is reporting that there are many deleted files. And you really want to remove them from repository. Do &#039;git rm&#039; one by one? No, you don&#039;t need to:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;deleted&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:  | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;cut&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;: -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;f2&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;xargs&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rm&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 22 Feb 2011 16:44:51 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p><strong>git status</strong> is reporting that there are many deleted files. And you really want to remove them from repository. Do 'git rm' one by one? No, you don't need to:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">git</span><span class="hl-code"> </span><span class="hl-identifier">status</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-identifier">deleted</span><span class="hl-code">: | </span><span class="hl-identifier">cut</span><span class="hl-code"> -</span><span class="hl-identifier">d</span><span class="hl-code">: -</span><span class="hl-identifier">f2</span><span class="hl-code"> | </span><span class="hl-identifier">xargs</span><span class="hl-code"> </span><span class="hl-identifier">git</span><span class="hl-code"> </span><span class="hl-identifier">rm</span></pre></div> </div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://conceptspace.wikidot.com/blog:ruby-on-rails:when-many-tests-are-failing</guid>
				<title>Ruby on Rails: When many tests are failing</title>
				<link>http://conceptspace.wikidot.com/blog:ruby-on-rails:when-many-tests-are-failing</link>
				<description>

&lt;p&gt;You need to correct an application but so many unit tests are failing. You&#039;re lost in the verbosity of the output. You can filter out the test results.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;cut&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;: -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;f1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sed&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;s/&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\[&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;//g&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You&#039;ll see a neat list of failing test files. Now you can concentrate on the problems one by one doing&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;units&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;TEST&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/o&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ne_of_them_tests&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;functionals&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;TEST&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;functional&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/o&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;ne_of_them_tests&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can actually open all the failing test files in your editor e.g. kate&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rake&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;grep&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;rb&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;cut&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;: -&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;f1&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sed&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;s/&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\[&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;//g&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;sed&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;s/&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;test/.&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;test/g&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;xargs&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;kate&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=208545&amp;amp;amp;size=small&amp;amp;amp;timestamp=1775259571&quot; alt=&quot;Umur&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=208545)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/umur&quot;  &gt;Umur&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 11 Feb 2011 15:08:57 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>You need to correct an application but so many unit tests are failing. You're lost in the verbosity of the output. You can filter out the test results.</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rake</span><span class="hl-code"> </span><span class="hl-identifier">test</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-identifier">test</span><span class="hl-code">.</span><span class="hl-identifier">rb</span><span class="hl-code"> | </span><span class="hl-identifier">cut</span><span class="hl-code"> -</span><span class="hl-identifier">d</span><span class="hl-code">: -</span><span class="hl-identifier">f1</span><span class="hl-code"> | </span><span class="hl-identifier">sed</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">s/</span><span class="hl-special">\[</span><span class="hl-string">//g</span><span class="hl-quotes">'</span></pre></div> </div> <p>You'll see a neat list of failing test files. Now you can concentrate on the problems one by one doing</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rake</span><span class="hl-code"> </span><span class="hl-identifier">test</span><span class="hl-code">:</span><span class="hl-identifier">units</span><span class="hl-code"> </span><span class="hl-identifier">TEST</span><span class="hl-code">=</span><span class="hl-identifier">test</span><span class="hl-quotes">/</span><span class="hl-string">unit</span><span class="hl-quotes">/o</span><span class="hl-identifier">ne_of_them_tests</span><span class="hl-code"> </span><span class="hl-identifier">rake</span><span class="hl-code"> </span><span class="hl-identifier">test</span><span class="hl-code">:</span><span class="hl-identifier">functionals</span><span class="hl-code"> </span><span class="hl-identifier">TEST</span><span class="hl-code">=</span><span class="hl-identifier">test</span><span class="hl-quotes">/</span><span class="hl-string">functional</span><span class="hl-quotes">/o</span><span class="hl-identifier">ne_of_them_tests</span></pre></div> </div> <p>You can actually open all the failing test files in your editor e.g. kate</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">rake</span><span class="hl-code"> </span><span class="hl-identifier">test</span><span class="hl-code"> | </span><span class="hl-identifier">grep</span><span class="hl-code"> </span><span class="hl-identifier">test</span><span class="hl-code">.</span><span class="hl-identifier">rb</span><span class="hl-code"> | </span><span class="hl-identifier">cut</span><span class="hl-code"> -</span><span class="hl-identifier">d</span><span class="hl-code">: -</span><span class="hl-identifier">f1</span><span class="hl-code"> | </span><span class="hl-identifier">sed</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">s/</span><span class="hl-special">\[</span><span class="hl-string">//g</span><span class="hl-quotes">'</span><span class="hl-code"> | </span><span class="hl-identifier">sed</span><span class="hl-code"> </span><span class="hl-quotes">'</span><span class="hl-string">s/</span><span class="hl-special">\/</span><span class="hl-string">test/.</span><span class="hl-special">\/</span><span class="hl-string">test/g</span><span class="hl-quotes">'</span><span class="hl-code"> | </span><span class="hl-identifier">xargs</span><span class="hl-code"> </span><span class="hl-identifier">kate</span></pre></div> </div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/umur" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=208545&amp;amp;size=small&amp;amp;timestamp=1775259571" alt="Umur" style="background-image:url(http://www.wikidot.com/userkarma.php?u=208545)" /></a><a href="http://www.wikidot.com/user:info/umur" >Umur</a></span></p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>