<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Ambethia</title>
	<link>http://ambethia.com</link>
	<description>The journal and personal website of Jason L Perry</description>
	<pubDate>Mon, 23 Jun 2008 16:06:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Git Railed</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F06%2F23%2Fgit-railed%2F&amp;seed_title=Git+Railed</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F06%2F23%2Fgit-railed%2F&amp;seed_title=Git+Railed#comments</comments>
		<pubDate>Mon, 23 Jun 2008 16:02:52 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2008/06/23/git-railed/</guid>
		<description><![CDATA[	This is just a little something I threw together this weekend to make life a little easier. git-railed is a simple script that creates a new rails app, initializes a new git repository, moving the db config and setting up the ignores for you. You can use it as a gem, and just run it [...]]]></description>
			<content:encoded><![CDATA[	<p>This is just a little something I threw together this weekend to make life a little easier. <tt>git-railed</tt> is a simple script that creates a new rails app, initializes a new git repository, moving the db config and setting up the ignores for you. You can use it as a gem, and just run it like:</p>

	<div class="code bash" style="font-family: monospace;"><br />
git-railed obligatory_blog<br />
<br />
&nbsp;</div>

	<p>Or, just install it as a <a href="http://errtheblog.com/posts/60-sake-bomb">sake</a> task, and run it llike:</p>

	<div class="code bash" style="font-family: monospace;"><br />
sake git-railed <span style="color: #0000ff;">APP=</span>obligatory_blog<br />
<br />
&nbsp;</div>

	<p>Installation notes can be found in the <span class="caps">README</span>, get it at github: <a href="http://github.com/ambethia/git-railed/tree/master">http://github.com/ambethia/git-railed/tree/master</a></p>

	<p>Please fork it, and customize the behaviors to your hearts content (git-merbed?).</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F06%2F23%2Fgit-railed%2F&amp;seed_title=Git+Railed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Makes for some ugly SQL, but&#8230;</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F06%2F19%2Fmakes-for-some-ugly-sql-but%2F&amp;seed_title=Makes+for+some+ugly+SQL%2C+but%26%238230%3B</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F06%2F19%2Fmakes-for-some-ugly-sql-but%2F&amp;seed_title=Makes+for+some+ugly+SQL%2C+but%26%238230%3B#comments</comments>
		<pubDate>Thu, 19 Jun 2008 14:43:52 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2008/06/19/makes-for-some-ugly-sql-but/</guid>
		<description><![CDATA[	
class Listing &#60; ActiveRecord::Base
&#160; belongs_to :book
&#160; belongs_to :guide
&#160; 
&#160; def &#60;=&#62;&#40;other&#41;
&#160; &#160; self.guide.name &#60;=&#62; other.guide.name
&#160; end
end

Book.find&#40;1&#41;.listings.map&#123; &#124;l&#124; l.guide.name &#125;
# =&#62; [&#34;XYZZY&#34;, &#34;BAR&#34;, &#34;FOO&#34;, &#34;QUUX&#34;]

Book.find&#40;1&#41;.listings.sort.map&#123; &#124;l&#124; l.guide.name &#125;
# =&#62; [&#34;BAR&#34;, &#34;FOO&#34;, &#34;QUUX&#34;, &#34;XYZZY&#34;]

&#160;

	Nice.]]></description>
			<content:encoded><![CDATA[	<div class="code ruby" style="font-family: monospace;"><br />
<span style="color:#9966CC; font-weight:bold;">class</span> Listing &lt; ActiveRecord::Base<br />
&nbsp; belongs_to :book<br />
&nbsp; belongs_to :guide<br />
&nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> &lt;=&gt;<span style="color:#006600; font-weight:bold;">&#40;</span>other<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">guide</span>.<span style="color:#9900CC;">name</span> &lt;=&gt; other.<span style="color:#9900CC;">guide</span>.<span style="color:#9900CC;">name</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
Book.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">listings</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span> |l| l.<span style="color:#9900CC;">guide</span>.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#008000; font-style:italic;"># =&gt; [&quot;XYZZY&quot;, &quot;BAR&quot;, &quot;FOO&quot;, &quot;QUUX&quot;]</span><br />
<br />
Book.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">listings</span>.<span style="color:#9900CC;">sort</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span> |l| l.<span style="color:#9900CC;">guide</span>.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#008000; font-style:italic;"># =&gt; [&quot;BAR&quot;, &quot;FOO&quot;, &quot;QUUX&quot;, &quot;XYZZY&quot;]</span><br />
<br />
&nbsp;</div>

	<p>Nice.</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F06%2F19%2Fmakes-for-some-ugly-sql-but%2F&amp;seed_title=Makes+for+some+ugly+SQL%2C+but%26%238230%3B/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I can do anything</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F04%2F07%2Fi-can-do-anything%2F&amp;seed_title=I+can+do+anything</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F04%2F07%2Fi-can-do-anything%2F&amp;seed_title=I+can+do+anything#comments</comments>
		<pubDate>Mon, 07 Apr 2008 19:35:06 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Distraction]]></category>

		<guid isPermaLink="false">http://ambethia.com/2008/04/07/i-can-do-anything/</guid>
		<description><![CDATA[I can do anything in quicksilver&#8230; I can probably kill you through Quicksilver
- Chris Rohde]]></description>
			<content:encoded><![CDATA[<blockquote>I can do anything in quicksilver&#8230; I can probably kill you through Quicksilver</blockquote>
<p>- <a href="http://chrisrohde.net/">Chris Rohde</a></p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F04%2F07%2Fi-can-do-anything%2F&amp;seed_title=I+can+do+anything/feed/</wfw:commentRss>
		</item>
		<item>
		<title>You can&#8217;t cache that</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F03%2F19%2Fyou-cant-cache-that%2F&amp;seed_title=You+can%26%238217%3Bt+cache+that</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F03%2F19%2Fyou-cant-cache-that%2F&amp;seed_title=You+can%26%238217%3Bt+cache+that#comments</comments>
		<pubDate>Wed, 19 Mar 2008 14:51:21 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Distraction]]></category>

		<guid isPermaLink="false">http://ambethia.com/2008/03/19/you-cant-cache-that/</guid>
		<description><![CDATA[	&#60;Jason L Perry&#62; the addresses dont change, they dont need to be geocoded every time
&#60;Jason L Perry&#62; wtf
&#60;K. Adam Christensen&#62; no&#8230;..shifting tectonic plates
&#60;K. Adam Christensen&#62; don&#x27;t you watch discovery?
&#60;K. Adam Christensen&#62; fucking n00b
&#60;K. Adam Christensen&#62; you can&#x27;t cache that]]></description>
			<content:encoded><![CDATA[	<p><strong>&lt;Jason L Perry&gt;</strong> the addresses dont change, they dont need to be geocoded every time<br />
<strong>&lt;Jason L Perry&gt;</strong> wtf<br />
<strong>&lt;K. Adam Christensen&gt;</strong> no&#8230;..shifting tectonic plates<br />
<strong>&lt;K. Adam Christensen&gt;</strong> don&#x27;t you watch discovery?<br />
<strong>&lt;K. Adam Christensen&gt;</strong> fucking n00b<br />
<strong>&lt;K. Adam Christensen&gt;</strong> you can&#x27;t cache that</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F03%2F19%2Fyou-cant-cache-that%2F&amp;seed_title=You+can%26%238217%3Bt+cache+that/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MicroTip #1</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F01%2F23%2Fmicrotip-1%2F&amp;seed_title=MicroTip+%231</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F01%2F23%2Fmicrotip-1%2F&amp;seed_title=MicroTip+%231#comments</comments>
		<pubDate>Wed, 23 Jan 2008 16:31:05 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2008/01/23/microtip-1/</guid>
		<description><![CDATA[	
# Prevent those race conditions in RSpec specs.
@time_now = Time.now
Time.stub!&#40;:now&#41;.and_return&#40;@time_now&#41;

&#160;]]></description>
			<content:encoded><![CDATA[	<div class="code ruby" style="font-family: monospace;"><br />
<span style="color:#008000; font-style:italic;"># Prevent those race conditions in RSpec specs.</span><br />
@time_now = Time.<span style="color:#9900CC;">now</span><br />
Time.<span style="color:#9900CC;">stub</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>:now<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">and_return</span><span style="color:#006600; font-weight:bold;">&#40;</span>@time_now<span style="color:#006600; font-weight:bold;">&#41;</span><br />
<br />
&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2008%2F01%2F23%2Fmicrotip-1%2F&amp;seed_title=MicroTip+%231/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Exclusive Conditions for ActiveRecord&#8217;s has_many</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F11%2F28%2Fexclusive-conditions-for-activerecords-has_many%2F&amp;seed_title=Exclusive+Conditions+for+ActiveRecord%26%238217%3Bs+has_many</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F11%2F28%2Fexclusive-conditions-for-activerecords-has_many%2F&amp;seed_title=Exclusive+Conditions+for+ActiveRecord%26%238217%3Bs+has_many#comments</comments>
		<pubDate>Wed, 28 Nov 2007 16:18:04 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/11/28/exclusive-conditions-for-activerecords-has_many/</guid>
		<description><![CDATA[	I&#8217;ll start with some code.

	
class User &#60; ActiveRecord::Base
&#160; has_many :things, :exclusive_conditions =&#62; %q&#40;`things`.user_id = #{id} OR #{admin?})
end

&#160;

	Assuming, we have 2 users, Alice and Bob.

	
user = User.find_by_username&#40;&#34;alice&#34;&#41; # =&#62; Alice is an admin.
user.id # =&#62; 1
thing = user.things.find_by_name&#40;&#34;Bob's Thing&#34;&#41;
thing.user_id # =&#62; 2, It's still bobs thing.

&#160;

	Now in my controller&#8217;s I can just say something like:

	
class ThingsController [...]]]></description>
			<content:encoded><![CDATA[	<p>I&#8217;ll start with some code.</p>

	<div class="code ruby" style="font-family: monospace;"><br />
<span style="color:#9966CC; font-weight:bold;">class</span> User &lt; ActiveRecord::Base<br />
&nbsp; has_many :things, :exclusive_conditions =&gt; %q<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">`things`</span>.<span style="color:#9900CC;">user_id</span> = <span style="color:#008000; font-style:italic;">#{id} OR #{admin?})</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp;</div>

	<p>Assuming, we have 2 users, Alice and Bob.</p>

	<div class="code ruby" style="font-family: monospace;"><br />
user = User.<span style="color:#9900CC;">find_by_username</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;alice&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># =&gt; Alice is an admin.</span><br />
user.<span style="color:#9900CC;">id</span> <span style="color:#008000; font-style:italic;"># =&gt; 1</span><br />
thing = user.<span style="color:#9900CC;">things</span>.<span style="color:#9900CC;">find_by_name</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Bob's Thing&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
thing.<span style="color:#9900CC;">user_id</span> <span style="color:#008000; font-style:italic;"># =&gt; 2, It's still bobs thing.</span><br />
<br />
&nbsp;</div>

	<p>Now in my controller&#8217;s I can just say something like:</p>

	<div class="code ruby" style="font-family: monospace;"><br />
<span style="color:#9966CC; font-weight:bold;">class</span> ThingsController &lt; ApplicationController<br />
&nbsp; <span style="color:#008000; font-style:italic;"># using restful_authentication or acts_as_authenticated here.</span><br />
&nbsp; before_filter :login_required<br />
&nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> update<br />
&nbsp; &nbsp;@thing = current_user.<span style="color:#9900CC;">things</span>.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span>:id<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#008000; font-style:italic;"># ...</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp;</div>

	<p>Now I don&#8217;t have to write any other code to check ownership, <span class="caps">AND</span> an admin can<br />
still play with anyone else&#8217;s things.</p>

	<p>What I&#8217;ve done here is added an <tt>:exclusive_conditions</tt> option to<br />
has_many. It&#8217;s not possible to express this idea with the <tt>:conditions</tt><br />
option.</p>

	<p>Observe:</p>

	<div class="code ruby" style="font-family: monospace;"><br />
User.<span style="color:#9900CC;">has_many</span> :things, :conditions =&gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;your_condition = ?&quot;</span>, <span style="color:#996600;">&quot;yes&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
<br />
&nbsp;</div>

	<p>Will result in <span class="caps">SQL</span> like:</p>

	<p><code lang="SQL"><br />
<span class="caps">SELECT</span> * <span class="caps">FROM</span> things <span class="caps">WHERE</span> (user_id = 1) <span class="caps">AND</span> (your_condition = &#8216;yes&#8217;)<br />
</code></p>

	<p>The &#8220;<tt>(user_id = 1) <span class="caps">AND</span> &#8230;</tt>&#8220; is hard coded. So I can&#8217;t say<br />
&#8220;<tt>(user_id = 1) OR (something_else)</tt>&#8220; with has_many without writing out<br />
the entire statement using <tt>:finder_sql</tt>.</p>

	<p>But then if I do that, I lose all the fun proxy methods, preventing me from<br />
doing things like <tt><code>user.things.find&#60;/tt&#62; or &#60;tt&#62;</code>user.things.create</tt><br />
which are of course, in the scope of that user.</p>

	<p>Here&#8217;s the plugin, <a href="http://subvert.itred.org/has_many_exclusive_conditions/">http://subvert.itred.org/has_many_exclusive_conditions/</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F11%2F28%2Fexclusive-conditions-for-activerecords-has_many%2F&amp;seed_title=Exclusive+Conditions+for+ActiveRecord%26%238217%3Bs+has_many/feed/</wfw:commentRss>
		</item>
		<item>
		<title>attr_protected my left foot.</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F11%2F09%2Fattr_protected-my-left-foot%2F&amp;seed_title=attr_protected+my+left+foot.</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F11%2F09%2Fattr_protected-my-left-foot%2F&amp;seed_title=attr_protected+my+left+foot.#comments</comments>
		<pubDate>Fri, 09 Nov 2007 19:33:22 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/11/09/attr_protected-my-left-foot/</guid>
		<description><![CDATA[	I don&#8217;t like the idea of attr_protected, and attr_accessible in ActiveRecord.

	
		They makes me put more code in the controller, and sometimes worse, I&#8217;m forced to express model ideas in the controller.
	
	
		They make me put things in the model that should be handled by the controller.
	

	From the Rails API docs:

This is meant to protect sensitive attributes [...]]]></description>
			<content:encoded><![CDATA[	<p>I don&#8217;t like the idea of attr_protected, and attr_accessible in ActiveRecord.</p>

	<ol>
		<li>They makes me put more code in the controller, and sometimes worse, I&#8217;m forced to express model ideas in the controller.</li>
	</ol>
	<ol>
		<li>They make me put things in the model that should be handled by the controller.</li>
	</ol>

	<p>From the <a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001018">Rails <span class="caps">API</span> docs</a>:</p>

<blockquote>This is meant to protect sensitive attributes from being overwritten by URL/form hackers.</blockquote>

	<p>That&#8217;s what the freaking controller is for. </p>

	<p>Give me param_protected and param_accessible. Instead of:</p>

	<div class="code ruby" style="font-family: monospace;"><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">class</span> Customer &lt; ActiveRecord::Base<br />
&nbsp; &nbsp; attr_protected :credit_rating<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">class</span> CustomersController &lt; Application<br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> extra_crap_i_dont_need<br />
&nbsp; &nbsp; &nbsp; &nbsp;...<br />
&nbsp; &nbsp; &nbsp; &nbsp;@customer.<span style="color:#9900CC;">credit_rating</span> = :foo<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp;</div>

	<p>I want:</p>

<pre><code>
  class CustomersController &#60; Application
    param_protected :customer =&#62; [:credit_rating, :etc]
  end
</code></pre>

	<p>If no one else has done it (I haven&#8217;t looked yet), perhaps I will.</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F11%2F09%2Fattr_protected-my-left-foot%2F&amp;seed_title=attr_protected+my+left+foot./feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using assert_select outside of the controller context</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F10%2F11%2Fassert_select%2F&amp;seed_title=Using+assert_select+outside+of+the+controller+context</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F10%2F11%2Fassert_select%2F&amp;seed_title=Using+assert_select+outside+of+the+controller+context#comments</comments>
		<pubDate>Thu, 11 Oct 2007 15:18:12 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/10/11/assert_select/</guid>
		<description><![CDATA[	Testing your Rails helpers in an isolated context is made a lot easier with Geoffrey Grosenbach&#8217;s HelperTestCases. One thing however is still missing. assert_select is great for cutting through the response bodies in your functional and integration tests. Here&#8217;s how to use it outside those contexts:

	
require File.dirname(__FILE__) + &#8216;/../../test_helper&#8217;
require &#8216;ostruct&#8217;

	class BuyerHelperTest < HelperTestCase

  include [...]]]></description>
			<content:encoded><![CDATA[	<p>Testing your Rails helpers in an isolated context is made a lot easier with Geoffrey Grosenbach&#8217;s <a href="http://nubyonrails.com/articles/test-your-helpers">HelperTestCases</a>. One thing however is still missing. <a href="http://cheat.errtheblog.com/s/assert_select/">assert_select</a> is great for cutting through the response bodies in your functional and integration tests. Here&#8217;s how to use it outside those contexts:</p>

	<p><code><pre><br />
require File.dirname(__FILE__) + &#8216;/../../test_helper&#8217;<br />
require &#8216;ostruct&#8217;</p>

	<p>class BuyerHelperTest < HelperTestCase</p>

  include BuyerHelper

  def test_should_render_latest_posts
    # capture the output of your helper
    html = render_latest_posts(feed_uri)

    @response = OpenStruct.new :body => html, :headers => {&#8220;Content-Type&#8221; => &#8220;text/html&#8221;}
    assert_select &#8220;table.latest_posts tr&#8221; do |rows|
      ...
    end
  end

	<p>end<br />
</pre></code></p>

	<p>If you&#8217;re already using a mocking/stubbing library in your tests, you can forgo the OpenStruct stuff (including &#8216;ostruct&#8217;), in favor of just stubbing it out:</p>

	<p><code>&#60;pre&#62;@response = stub(:body =&#62; html, :headers =&#62; {&#34;Content-Type&#34; =&#62; &#34;text/html&#34;})&#60;/pre&#62;</code></p>

	<p>For Rails 2.0 you&#8217;ll also need to make some adjustments:</p>

	<p><code>&#60;pre&#62;@response = stub(:body =&#62; html, :content_type =&#62; &#34;text/html&#34;)&#60;/pre&#62;</code></p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F10%2F11%2Fassert_select%2F&amp;seed_title=Using+assert_select+outside+of+the+controller+context/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Backing up your RailsRumble repository</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F09%2F10%2Fbacking-up-your-railsrumble-repository%2F&amp;seed_title=Backing+up+your+RailsRumble+repository</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F09%2F10%2Fbacking-up-your-railsrumble-repository%2F&amp;seed_title=Backing+up+your+RailsRumble+repository#comments</comments>
		<pubDate>Mon, 10 Sep 2007 20:55:33 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/09/10/backing-up-your-railsrumble-repository/</guid>
		<description><![CDATA[	So you busted you butt all weekend, and want to make sure you can backup all the work, or import it (including the revision history) into your own subversion respository? We don&#8217;t have shell access to the subversion server, and an svnsync won&#8217;t work because we can&#8217;t access the root level of the repository. What [...]]]></description>
			<content:encoded><![CDATA[	<p>So you busted you butt all weekend, and want to make sure you can backup all the work, or import it (including the revision history) into your own subversion respository? We don&#8217;t have shell access to the subversion server, and an svnsync won&#8217;t work because we can&#8217;t access the root level of the repository. What to do? Well, here&#8217;s what I did.</p>

	<p><a href=&#8217;http://rubybrigade.org&#8221; title=&#8217;RubyBrigade.org&#8217;><img src='http://ambethia.com/blog/wp-content/uploads/2007/09/rubybrigadeorg-20070910-thumb.png' alt='RubyBrigade.org' align="right" /></a></p>

	<p>Note: I&#8217;m working from a Mac (nuala), and didn&#8217;t want to jump through the hoops needed to install the dependencies locally, so I installed the needed tool and ran the export from an Ubuntu linux server (goldie) I have access to.</p>

	<p><code>&#60;pre&#62;jlperry@nuala:~$ ssh goldie&#60;/pre&#62;</code></p>

	<p>First, I installed the SVN::Core perl bindings.</p>

	<p><code>&#60;pre&#62;jlperry@goldie:~$ sudo apt-get install libsvn-core-perl&#60;/pre&#62;</code></p>

	<p>Then, I downloaded <a href="http://search.cpan.org/~clkao/SVN-Mirror-0.73/">SVM</a> a tool for mirroring Subversion repositories.</p>

	<p><code>&#60;pre&#62;
jlperry@goldie:~$ wget http://search.cpan.org/CPAN/authors/id/C/CL/CLKAO/SVN-Mirror-0.73.tar.gz
jlperry@goldie:~$ tar -zxvf SVN-Mirror-0.73.tar.gz
jlperry@goldie:~$ cd SVN-Mirror-0.73/
&#60;/pre&#62;</code></p>

	<p>Run the make file, saying &#8220;yes&#8221; to the questions about autoconfig and dependencies, and &#8220;yes&#8221; to &#8220;Should we try to install the required module(s) anyway?&#8221;. Just press <span class="caps">ENTER</span> to stuff about <span class="caps">UUID</span> state storage and default umask</p>

	<p><code>&#60;pre&#62;
jlperry@goldie:~/SVN-Mirror-0.73$  perl Makefile.PL
jlperry@goldie:~/SVN-Mirror-0.73$ sudo make
&#60;/pre&#62;</code></p>

	<p>And install it:</p>

	<p><code>&#60;pre&#62;
jlperry@goldie:~/SVN-Mirror-0.73$ sudo make install
jlperry@goldie:~$ cd ~
&#60;/pre&#62;</code></p>

	<p>Now, lets get ready to do the export.</p>

	<p>You need to create an &#8220;~/svn&#8221; folder, I think you can change the path svm wants to use, but whatver, this worked for me.</p>

	<p><code>&#60;pre&#62;jlperry@goldie:~$ mkdir svn&#60;/pre&#62;</code></p>

	<p>Cache our authentication and acceptance of the self-signed https cert from the server before we can sync:</p>

	<p><code>&#60;pre&#62;jlperry@goldie:~$ svn info https://svn.railsrumble.com/paintitred&#60;/pre&#62;</code></p>

	<p><code>&#60;pre&#62;
jlperry@goldie:~$ svm init . https://svn.railsrumble.com/paintitred
jlperry@goldie:~$ svm sync .
jlperry@goldie:~$ svnadmin dump svn/svm &#62; rumble_dump
&#60;/pre&#62;</code></p>

	<p>Wow, that was easy.</p>

	<p><code>&#60;pre&#62;
jlperry@goldie:~$ logout
jlperry@nuala:~$ scp goldie:~/rumble_dump .
&#60;/pre&#62;</code></p>

	<p>Now, make sure you can import your dump</p>

	<p><code>&#60;pre&#62;
jlperry@nuala:~$ mkdir tmp
jlperry@nuala:~$ svnadmin create tmp/rumble
jlperry@nuala:~$ svnadmin load tmp/rumble/ &#60; rumble_dump
&#60;/pre&#62;</code></p>

	<p>All the above steps worked for me, your mileage may vary. I just wanted to share these tips with anyone else who might be looking to backup their work from this weekend. It was a blast. There&#8217;s a lot of good projects in there, and I&#8217;m proud of our team for <em>finishing</em> our entire <a href="http://rubybrigade.org">app</a> by the deadline.</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F09%2F10%2Fbacking-up-your-railsrumble-repository%2F&amp;seed_title=Backing+up+your+RailsRumble+repository/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RubyConf 2007</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F09%2F06%2Frubyconf-2007%2F&amp;seed_title=RubyConf+2007</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F09%2F06%2Frubyconf-2007%2F&amp;seed_title=RubyConf+2007#comments</comments>
		<pubDate>Fri, 07 Sep 2007 02:44:26 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Distraction]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/09/06/rubyconf-2007/</guid>
		<description><![CDATA[	

	Registration has opened for RubyConf 2007 in Charlotte, and with my grandparent&#8217;s bed-and-breakfast just an hour away it looks like I&#8217;m in for some nice road-trippin-family-visiting-geekin-early-birthday fun in November.]]></description>
			<content:encoded><![CDATA[	<p><img src='http://ambethia.com/blog/wp-content/uploads/2007/09/pinebrae_ph1_lg.jpg' alt='Pinebrae Manor' align="right" /></p>

	<p><a href="http://www.chadfowler.com/2007/9/6/rubyconf-registration-is-open">Registration has opened</a> for RubyConf 2007 in Charlotte, and with my grandparent&#8217;s bed-and-breakfast just an hour away it looks like I&#8217;m in for some nice road-trippin-family-visiting-geekin-early-birthday fun in November.</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F09%2F06%2Frubyconf-2007%2F&amp;seed_title=RubyConf+2007/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Direction of RailsForge</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F07%2F05%2Fthe-direction-of-railsforge%2F&amp;seed_title=The+Direction+of+RailsForge</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F07%2F05%2Fthe-direction-of-railsforge%2F&amp;seed_title=The+Direction+of+RailsForge#comments</comments>
		<pubDate>Fri, 06 Jul 2007 03:55:11 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/07/05/the-direction-of-railsforge/</guid>
		<description><![CDATA[	So far the responses to the survey have been overwhelmingly positive and encouraging. There has, however, been a few detractors with some noteworthy comments.

	The main complaint I&#8217;ve seen so far is from people getting the impression we want to somehow &#8220;reimplement&#8221; Rubyforge or create another repository for gems or plugins1. I can&#8217;t imagine something like [...]]]></description>
			<content:encoded><![CDATA[	<p>So far the responses to the <a href="http://railsforge.com/survey">survey</a> have been overwhelmingly positive and encouraging. There has, however, been a few detractors with some noteworthy comments.</p>

	<p>The main complaint I&#8217;ve seen so far is from people getting the impression we want to somehow &#8220;reimplement&#8221; <a href="http://rubyforge.com">Rubyforge</a> or create another repository for gems or plugins<sup>1</sup>. I can&#8217;t imagine something like this could be of any real benefit to Ruby, or Rails.</p>

	<p>There&#8217;s already a <a href="http://agilewebdevelopment.com/plugins">list of plugins</a>, There&#8217;s all ready rubyforge, there&#8217;s this, there&#8217;s that. We don&#8217;t want to take away from any of that. We want to tie them all together&#8212;and make it easy. That&#8217;s the most important bit, making it easy. Easy to find. Easy to keep up with. Easy to change.</p>

	<p>I think the &#8220;forge&#8221; in &#8220;RailsForge&#8221; is causing a visceral reaction in some people, and I understand that. Perhaps &#8220;RailsForge&#8221; is misleading. It seemed an easy and available choice for a name, but maybe not the best.</p>

	<p>&#8212;</p>

	<p><sup>1</sup>There&#8217;s some debate about plugins and gems, or &#8220;plugins vs. gems&#8221; I should say. I&#8217;ve got to say straight up I side with the concept of sharing code between apps using the gems system.</p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F07%2F05%2Fthe-direction-of-railsforge%2F&amp;seed_title=The+Direction+of+RailsForge/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Number One iPhone Annoyance</title>
		<link>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F07%2F05%2Fnumber-one-iphone-annoyance%2F&amp;seed_title=Number+One+iPhone+Annoyance</link>
		<comments>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F07%2F05%2Fnumber-one-iphone-annoyance%2F&amp;seed_title=Number+One+iPhone+Annoyance#comments</comments>
		<pubDate>Thu, 05 Jul 2007 13:03:16 +0000</pubDate>
		<dc:creator>Jason Perry</dc:creator>
		
		<category><![CDATA[Distraction]]></category>

		<guid isPermaLink="false">http://ambethia.com/2007/07/05/number-one-iphone-annoyance/</guid>
		<description><![CDATA[	The alarm clock volume is the same as the ringer volume.

	This should NOT be.

	I had the ringer turned down last via the volume buttons on the side. Thankfully, I woke up on my own initiative just before the alarm went of. A few minutes later&#8230; a faint buzzing on the nightstand. That&#8217;s it. At least [...]]]></description>
			<content:encoded><![CDATA[	<p>The alarm clock volume is the same as the ringer volume.</p>

	<p>This should <span class="caps">NOT</span> be.</p>

	<p>I had the ringer turned down last via the volume buttons on the side. Thankfully, I woke up on my own initiative just before the alarm went of. A few minutes later&#8230; a faint buzzing on the nightstand. That&#8217;s it. At least now I know I can&#8217;t rely on it&#8217;s alarm for mission critical wake ups. Here&#8217;s to hoping this is a bug, not a a &#8220;feature&#8221; </p>]]></content:encoded>
			<wfw:commentRss>http://ambethia.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fambethia.com%2F2007%2F07%2F05%2Fnumber-one-iphone-annoyance%2F&amp;seed_title=Number+One+iPhone+Annoyance/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
