<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[LaunchWare]]></title>
  <link href="http://launchware.com/atom.xml" rel="self"/>
  <link href="http://launchware.com/"/>
  <updated>2013-03-10T16:32:22-04:00</updated>
  <id>http://launchware.com/</id>
  <author>
    <name><![CDATA[LaunchWare]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Five Favorite Ruby Gems Presented to Boston Ruby Group]]></title>
    <link href="http://launchware.com/articles/five-favorite-ruby-gems-presented-to-boston-ruby-group/"/>
    <updated>2013-02-08T12:13:00-05:00</updated>
    <id>http://launchware.com/articles/five-favorite-ruby-gems-presented-to-boston-ruby-group</id>
    <content type="html"><![CDATA[<p><a href="https://twitter.com/mdenomy">Mike Denomy</a> and <a href="https://twitter.com/jboursiquot">Johnny Boursiquot</a> have been doing a great job organizing workshops and small talks as we continue to improve <a href="http://bostonrb.org">Boston Ruby Group</a> project nights.</p>

<!-- more -->


<p>Mike asked a few of us to speak about a selection of five of our favorite ruby gems as a way to expose beginners to some great libraries. You can find all the talks on the <a href="http://bostonrb.org/presentations">BostonRB presentation listing</a>. <a href="https://github.com/drapergeek">Jason Draper</a> also delivered a great talk on <a href="http://bostonrb.org/presentations/introduction-to-integration-testing">writing your first integration tests</a> that I definitely recommend checking out!</p>

<p>Video and slides from my presentation are below.</p>

<iframe width="640" height="360" src="http://www.youtube.com/embed/GC74Da_GZcY?feature=player_embedded" frameborder="0" allowfullscreen></iframe>




<iframe src="http://www.slideshare.net/slideshow/embed_code/16383686" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>


<p>Want to learn how to use these ruby gems and more? Our latest project, <a href="http://launchacademy.co">Launch Academy</a> aims to equip aspiring web technologists with the knowledge they need to become a junior developer in <strong>just 10 weeks</strong>. <a href="http://launchacademy.co/applications/new">Apply today</a>!</p>

<p>You can see the rest of our favorites in our rails template, <a href="https://github.com/launchware/ignition">ignition</a>. We use this template when starting new projects for clients.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Writing Command Line Applications With Ruby: A Presentation to the Route 9 Ruby Group]]></title>
    <link href="http://launchware.com/articles/writing-command-line-applications-with-ruby-a-presentation-to-the-route-9-ruby-group/"/>
    <updated>2012-11-19T13:39:00-05:00</updated>
    <id>http://launchware.com/articles/writing-command-line-applications-with-ruby-a-presentation-to-the-route-9-ruby-group</id>
    <content type="html"><![CDATA[<p>We&#8217;ve recently been dabbling with creating command line applications with ruby internally. You can do some really cool things with tools like <a href="https://github.com/davetron5000/gli">GLI</a> and <a href="https://github.com/geemus/formatador">Formatador</a> with relative ease.</p>

<p>I presented some of our learnings to the Route 9 Ruby Group and recorded it. There were some great questions and discussion.</p>

<!-- more -->


<p>Writing command line applications with ruby is a nice break from the web-based world. I find you can focus much more on the intent of the app than the aesthetic, so it might provide a useful way to prototype some data intensive applications.</p>

<p>The big takeaways I shared with the group:</p>

<ul>
<li>Just like you would in your web applicatiions, respect the design pattern of Model, View, Controller (MVC) - it keeps things nice and modularized</li>
<li>Test all permutations of commands, switches, and flags as best you can. Sometimes, you get some weird interferences or side effects</li>
<li>Delegate to an object oriented API to keep everything testable</li>
<li>Document how you want to use the command line application first. It really helps to keep it user friendly.</li>
<li>Get the excellent book: <a href="http://pragprog.com/book/dccar/build-awesome-command-line-applications-in-ruby">Build Awesome Command-Line Applications in Ruby</a></li>
</ul>


<iframe width="640" height="360" src="http://www.youtube.com/embed/OF4ylrYYeNw?feature=player_detailpage" frameborder="0" allowfullscreen></iframe>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[An Introduction to Ruby On Rails Presented At a Boston Ruby Group Project Night]]></title>
    <link href="http://launchware.com/articles/an-introduction-to-ruby-on-rails-presented-at-a-boston-ruby-group-project-night/"/>
    <updated>2012-09-10T20:14:00-04:00</updated>
    <id>http://launchware.com/articles/an-introduction-to-ruby-on-rails-presented-at-a-boston-ruby-group-project-night</id>
    <content type="html"><![CDATA[<p>I&#8217;ve recently begun presenting an Introduction to Rails Workshop at <a href="http://bostonrb.org">BostonRB</a> Project Nights. They&#8217;ve been a lot of fun and I plan to continue facilitating workshops at future project nights. We recorded the video from our last, remote session, and made it available on YouTube.</p>

<!-- more -->




<iframe width="560" height="315" src="http://www.youtube.com/embed/RSQzO14G6U4" frameborder="0" allowfullscreen></iframe>


<p>If you&#8217;re interested in learning about Rails or getting to know the BostonRB community, the project nights are a lot of fun. We&#8217;ve gotten great feedback, and we&#8217;re looking forward to improving them over time. The project nights are on the first Tuesday of every month and we&#8217;re thankful to the great team at <a href="http://thoughtbot.com">Thoughtbot</a> for hosting us.</p>

<p>At LaunchWare, helping others advance is <a href="http://launchware.com/about">core to our values</a>. We find that teaching is not only rewarding, but also helps to solidify our knowledge. We&#8217;re <a href="http://launchware.com/careers">currently hiring</a>, and we&#8217;re looking for developers that are eager to contribute to our wonderful Boston Ruby community in such meaningful ways. If you&#8217;re someone that loves to learn and give back, be sure to <a href="http://launchware.com/careers">check out our careers page</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Working at LaunchWare: a retrospective]]></title>
    <link href="http://launchware.com/articles/working-at-launchware-a-retrospective/"/>
    <updated>2012-08-10T13:46:00-04:00</updated>
    <id>http://launchware.com/articles/working-at-launchware-a-retrospective</id>
    <content type="html"><![CDATA[<p>Hey, I&#8217;m @jmondo. I&#8217;ve been working at LaunchWare since February 2011. A year and a half later, I&#8217;m leaving LaunchWare to move out to the West Coast and explore the world of startups, dev, and&#8230; west coast. Before I go, I want to provide a retrospective explaining what it&#8217;s like to work at LaunchWare, what I&#8217;ll miss, and why I&#8217;m leaving.</p>

<!-- more -->


<h2>What It&#8217;s Like (And What I&#8217;ll Miss)</h2>

<h3>Day to Day</h3>

<ul>
<li>We all work remotely, but we&#8217;re all located in the Boston area. This makes it easy for us to share dinners, co-work at the CiC, and meet with clients in person.</li>
<li>Standup is at 10:30 am via Google Plus hangout.</li>
<li><p>Correspondence throughout the day takes place on HipChat where there&#8217;s always something fun to read or rant about, measured in number of times we <code>@launch image me coolio</code>.</p>

<p>  <img src="http://launchware.com/images/coolio13.jpeg" alt="coolio image" /></p>

<p>  See? It&#8217;s fun.</p></li>
<li><p>Clients are easy to access through Pivotal Tracker comments and are generally quick and excited to respond.</p></li>
<li>We try to follow a week sprint schedule: freezing code at noon on Fridays, staging all of our 4-5 concurrent projects through the afternoon, smoke testing in staging on Monday, and then pushing to production.</li>
<li>We create feature branches each day, deploy to Github when finished, and Dan reviews code at 3:30 pm.</li>
<li>A couple times a week we have workshops where we all give feedback and suggestions around a particular topic that we can improve on, like client management, quality assurance, etc. Also remote via G+ hangouts with some live google docs action.</li>
<li>We&#8217;re expected to bill 35-40 hours a week, not eat sleep and breathe code</li>
<li>Transitioning from hourly to results-based work environment</li>
</ul>


<h3>People</h3>

<ul>
<li>There are 5 people at LaunchWare, including myself, not including LaunchBot (hopefully it doesn&#8217;t read this)</li>
<li>We&#8217;re funny dudes</li>
<li>We cover a large range of skills, while all proudly sporting the &#8216;full-stack&#8217; skill set. We&#8217;ve got people who pride themselves on abstractions, project management, product management, design and css strategies, and more. Each person has found their niche and developed it extensively since joining the company. This desire to learn and develop is core to our culture.</li>
</ul>


<h3>Dan the man</h3>

<p>Dan is our boss, and he&#8217;s the man. He gets his own ul.</p>

<ul>
<li>Super flexible in terms of travel, taking days off, etc.</li>
<li>Cares a ton about us, the code, and the clients</li>
<li>Works like a dog. The company is his baby and he&#8217;s always focused on making it bigger and better.</li>
<li>Willing to, happy to, and loves to be a mentor to his employees - both professionally and personally</li>
<li>Strict on code reviews - he&#8217;ll turn any mediocre coder into a master syntax, best practices, abstraction, framework, and api guru through his pull request feedback on Github.</li>
<li>Open to feedback and change. I harass him about business process/ strategy all the time, call him out when he makes mistakes, and challenge him on pull request feedback. This is how we all learn. And it&#8217;s not just to Dan, it&#8217;s company wide.</li>
<li><p>Cares about us personally. Example: when I roll out of bed, jump into the shower, and run to my computer at 10:29 am, I sometimes appear as if I&#8217;m still asleep during standup. I get this type of response.</p>

<pre><code>Dan: you looked tired this morning - everything ok?
John: haha yes i look tired every morning :p
</code></pre>

<p>What a guy.</p></li>
</ul>


<h3>Travel</h3>

<p>I started at LaunchWare while I was studying abroad in Hong Kong. Home of the 12 hour time difference from EDT. I checked in before bed and every morning, and worked while the team was sleeping. Dan saw past this in hiring me, and we pulled it off well. That&#8217;s a tough thing to do for any company, not just a software dev firm.</p>

<p>During that time and since then I&#8217;ve been all over the world, and LaunchWare has been very flexible in allowing me to do so. The rest of our team has been doing some serious traveling too! Due to our remote nature, traveling is not an interruption. And it&#8217;s not a surprise to show up for standup and someone&#8217;s background change to a train, lake, or even beach. Just try to pick somewhere with wifi.</p>

<p>Oh and vacation is on an as-you-need-it basis and Dan is very flexible here. Even in my final weeks, he has been very flexible on letting me take a day here and there. Love it.</p>

<h3>(Lack of) Bureaucracy</h3>

<p>We don&#8217;t do that. We try to optimize our process as often as possible, but we&#8217;re all very conscious of when things become too structured. Just like in our code, we don&#8217;t like premature optimization in our process. So some things, like that travel policy, are left ambiguous until we stumble across it.</p>

<h2>Why I&#8217;m leaving</h2>

<p>Although the above insights and comments stand on their own, they of course beg the question: <em>so why are you leaving?</em></p>

<p>The primary things you need to know about me:</p>

<ul>
<li>I&#8217;m a traveler: I&#8217;ve flown 57,500 miles since joining LaunchWare</li>
<li>I&#8217;ve lived in Massachusetts my whole life</li>
<li>I drive a red scooter (ok, irrelevant)</li>
<li>LaunchWare is the only non-freelance programming job I&#8217;ve held</li>
<li>I have an opportunity to live with one of my best friends from college in SF</li>
</ul>


<p>I chose those details very specifically of course and you can probably then guess why I&#8217;m leaving. I&#8217;m a traveler who&#8217;s lived in one place his entire life. I love the idea of getting rid of all my stuff, packing up what&#8217;s left and heading out to explore somewhere new. Also, the timing is right. I don&#8217;t have much stuff, and my friend is looking for a roommate.</p>

<p>The other part is that I&#8217;ve never held another &#8220;job&#8221; in the development space. This again is tough to say as the unstable explorer type, so it&#8217;s time to try some new things. If they aren&#8217;t awesome, I&#8217;ll be back!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Acceptance Testing: Asserting Sort Order]]></title>
    <link href="http://launchware.com/articles/acceptance-testing-asserting-sort-order/"/>
    <updated>2012-07-13T16:00:00-04:00</updated>
    <id>http://launchware.com/articles/acceptance-testing-asserting-sort-order</id>
    <content type="html"><![CDATA[<p>At LaunchWare, we&#8217;ve been looking for the best way to locate an element on a page in an Rspec request spec. Sometimes there&#8217;s just no getting around asserting that one piece of content appears before another, like when testing sort options. We&#8217;ve tried a few things:</p>

<!-- more -->


<h2>The exposition</h2>

<p>Imagine there are two comments on a post. We want to assert that the most recent comment appears first.</p>

<p>We have the following markup:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;div&gt;</span>
</span><span class='line'>  <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a newer comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/div&gt;</span>
</span><span class='line'>  <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/div&gt;</span>
</span><span class='line'><span class="nt">&lt;/div&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<h2>The most obvious way</h2>

<p>The most obvious way to assert that the newer commment appears first is:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:old_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:new_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="n">within</span> <span class="s2">&quot;div.comment:nth-child(1)&quot;</span> <span class="k">do</span>
</span><span class='line'>  <span class="n">page</span><span class="o">.</span><span class="n">should</span> <span class="n">have_content</span> <span class="n">new_comment</span><span class="o">.</span><span class="n">text</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="n">within</span> <span class="s2">&quot;div.comment:nth-child(2)&quot;</span> <span class="k">do</span>
</span><span class='line'>  <span class="n">page</span><span class="o">.</span><span class="n">should</span> <span class="n">have_content</span> <span class="n">old_comment</span><span class="o">.</span><span class="n">text</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>Or some variant of this. <code>page.find("div.comment:nth-child(1)")</code> works too.</p>

<p>But this approach is brittle. What if we go all HTML5 on this template and change the comment divs to article tags like so:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;article&gt;</span>
</span><span class='line'>  <span class="nt">&lt;article</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a newer comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/article&gt;</span>
</span><span class='line'>  <span class="nt">&lt;article</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/article&gt;</span>
</span><span class='line'><span class="nt">&lt;/article&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>Then our test is broken.</p>

<p>Or worse, if we add another comment into the mix as part of another test:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:old_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:new_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:some_other_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>Our markup becomes:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;article&gt;</span>
</span><span class='line'>  <span class="nt">&lt;article</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/article&gt;</span>
</span><span class='line'>  <span class="nt">&lt;article</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a newer comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/article&gt;</span>
</span><span class='line'>  <span class="nt">&lt;article</span> <span class="na">class=</span><span class="s">&quot;comment&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;p&gt;</span>Here is a comment!<span class="nt">&lt;/p&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/article&gt;</span>
</span><span class='line'><span class="nt">&lt;/article&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>Not nth-child 1 and 2 anymore&#8230;</p>

<p>But hey, we don&#8217;t really care which children they are, or what tags they are. We just want to know if the text of the new comment is on the page and placed somewhere before the old comment! Let&#8217;s test <em>that</em>. So, here you have it:</p>

<h2>The less brittle (and therefore better) way</h2>

<p>We know thse things:</p>

<ol>
<li>With capybara, you can grab the contents of the whole page as a string by calling <code>page.body</code>.</li>
<li>And with a Ruby string, you can grab the position (index) of a certain substring by calling <code>index(substring)</code>.</li>
<li>And with Rspec you can assert that one index/position is less than/before another using <code>index1.should_be &lt; index2</code>.</li>
</ol>


<p>So put that all together, and we replace the brittle approach above with this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:old_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:new_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="n">page</span><span class="o">.</span><span class="n">body</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">new_comment</span><span class="o">.</span><span class="n">text</span><span class="p">)</span><span class="o">.</span><span class="n">should</span> <span class="o">&lt;</span> <span class="n">page</span><span class="o">.</span><span class="n">body</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">old_comment</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>Awesome!</p>

<p>But there&#8217;s one more thing:</p>

<h2>The one more thing (best) way</h2>

<p>It would be annoying to type that over and over. What if you or the guys at LaunchWare figure out a better way to do this in the future? You wouldn&#8217;t want to have to find-and-replace your whole code base. And we wouldn&#8217;t either.</p>

<p>Try this Rspec custom matcher definition on for show:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="no">Rspec</span><span class="o">::</span><span class="no">Matchers</span><span class="o">.</span><span class="n">define</span> <span class="ss">:appear_before</span> <span class="k">do</span> <span class="o">|</span><span class="n">later_content</span><span class="o">|</span>
</span><span class='line'>  <span class="n">match</span> <span class="k">do</span> <span class="o">|</span><span class="n">earlier_content</span><span class="o">|</span>
</span><span class='line'>    <span class="n">page</span><span class="o">.</span><span class="n">body</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">earlier_content</span><span class="p">)</span> <span class="o">&lt;</span> <span class="n">page</span><span class="o">.</span><span class="n">body</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">later_content</span><span class="p">)</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>Once this is in play, you can now make this magical assertion:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:old_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'><span class="n">let!</span><span class="p">(</span><span class="ss">:new_comment</span><span class="p">)</span> <span class="p">{</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:comment</span><span class="p">)</span> <span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="n">new_comment</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">should</span> <span class="n">appear_before</span><span class="p">(</span><span class="n">old_comment</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>Definitely try this at home:</p>

<h2>How to add this to your project</h2>

<p>I&#8217;ve <a href="https://github.com/jmondo/orderly">released this as a gem</a>! so all you have to do is add</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">gem</span> <span class="s1">&#39;orderly&#39;</span>
</span></code></pre></td></tr></table></div></figure>


<p>to your gemfile. Then you can assert</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">this</span><span class="o">.</span><span class="n">appears_before</span><span class="p">(</span><span class="n">that</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>And you&#8217;re in business. #win</p>

<p>Follow me on Twitter at <a href="http://twitter.com/jmondo">jmondo</a> for &lt;= 140 char gems</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Boston Ruby Group Lightning Talk: The Rails Engine That Could?]]></title>
    <link href="http://launchware.com/articles/boston-ruby-group-lightning-talk-the-rails-engine-that-could/"/>
    <updated>2012-04-30T11:16:00-04:00</updated>
    <id>http://launchware.com/articles/boston-ruby-group-lightning-talk-the-rails-engine-that-could</id>
    <content type="html"><![CDATA[<p>On Tuesday, April 23rd, I gave a brief lightning talk about our most recent experiences with Rails Engines.</p>

<p>There were some great talks and questions asked during the session. One question was &#8220;How do you identify components in your application that should be extracted to an engine?&#8221;</p>

<!-- more -->


<p>Basically, you should apply the same principles to engine development as you do regular, object oriented development. Don&#8217;t repeat yourself, and identify opportunity for abstraction. If you find yourself building the same functionality across many different Rails apps, there is likely opportunity for you to extract a Rails engine.</p>

<script async class="speakerdeck-embed" data-id="4f9bf268a20ca6001f02d9f0" data-ratio="1.299492385786802" src="http://launchware.com//speakerdeck.com/assets/embed.js"></script>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Roboto: Search Engine Optimization for Your Rails Environment]]></title>
    <link href="http://launchware.com/articles/roboto-search-engine-optimization-for-your-rails-staging-environment/"/>
    <updated>2012-04-23T15:43:00-04:00</updated>
    <id>http://launchware.com/articles/roboto-search-engine-optimization-for-your-rails-staging-environment</id>
    <content type="html"><![CDATA[<p>The Google bots will thank you for not <a href="http://www.seomoz.org/learn-seo/duplicate-content">duplicating content on the InterWeb</a>.</p>

<!--more -->




<iframe width="420" height="315" src="http://www.youtube.com/embed/rcCS8AK6csg" frameborder="0" allowfullscreen></iframe>


<p>Introducing <a href="https://github.com/LaunchWare/roboto">Roboto</a>, a Rails Engine for providing environment specific robots.txt files. Use this to hide your staging and QA environments from search engines.</p>

<p>Google will penalize you if content is duplicated across multiple domain names. If you have a publicly accessible staging environment, this could be hurting your production environment&#8217;s search engine rankings. Follow along with this tutorial to hide your staging environment. Note, Roboto only works with Rails 3.1 and higher.</p>

<p>First, remove the generated robots.txt in your Rails App:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  #&gt; rm public/robots.txt</span></code></pre></td></tr></table></div></figure>


<p>Next, add roboto to your Gemfile:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  gem 'roboto'</span></code></pre></td></tr></table></div></figure>




<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  #&gt; bundle</span></code></pre></td></tr></table></div></figure>


<p>Then, add roboto to your routes (config/routes.rb):</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  Rails.application.routes.draw do
</span><span class='line'>    mount_roboto
</span><span class='line'>  end</span></code></pre></td></tr></table></div></figure>


<p>You can now specify environment specific robots.txt files in config/robots. So, in the case where we want to add a global disallow to our staging environment, we would create a file with the contents below at config/robots/staging.txt. If you haven&#8217;t done so already, copy config/environments/production.rb to config/environments/staging.rb and configure your staging server to run in the staging environment (<a href="http://shriikant.blogspot.com/2010/04/configure-staging-environment-for.html">Passenger</a>, <a href="https://devcenter.heroku.com/articles/multiple-environments">Heroku</a>, <a href="http://blog.sosedoff.com/2012/01/21/using-capistrano-unicorn-with-multistage-environment/">Unicorn</a>).</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>  User-Agent: *
</span><span class='line'>  Disallow: /</span></code></pre></td></tr></table></div></figure>


<p>You can also specify a fallback robots/default.txt for any environments you do not need to be explicit about.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Getting Sassy with Bourbon]]></title>
    <link href="http://launchware.com/articles/getting-sassy-with-bourbon/"/>
    <updated>2012-01-06T11:04:00-05:00</updated>
    <id>http://launchware.com/articles/getting-sassy-with-bourbon</id>
    <content type="html"><![CDATA[<p>One of my favorite new tools is the <a href="https://github.com/thoughtbot/bourbon">Bourbon</a>
gem from thoughbot.  It is a set of Sass mixins that greatly increases the speed of front-end
development.  While there are a lot of other options out there like
Compass, the simplicity of Bourbon has been its best feature.</p>

<!-- more -->


<p>To get started, just follow the instructions found on the github repo.
We use it in a Rails 3.1 project, so it was a simple as adding a splash
of bourbon to our gemfile and then including bourbon in our SCSS files.</p>

<p>The next step is to just start experimenting.  You&#8217;ll quickly find that
Bourbon&#8217;s syntax is intuitive and follows normal CSS syntax when
possible. It provides you with a basic set of tools and gets out of the
way.  Want a linear-gradient, box-shadow, and border-radius applied
to your awesome div?</p>

<figure class='code'><figcaption><span>Direct Mixin Examples</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>div.awesome {
</span><span class='line'>  @include linear-gradient(#f1f2f4, #ccc);
</span><span class='line'>  @include box-shadow(0px 1px 4px rgba(0, 0, 0, 0.3));
</span><span class='line'>  @include border-radius(4px);
</span><span class='line'>}</span></code></pre></td></tr></table></div></figure>


<p><img src="http://launchware.com/images/awesome_div.png" title="Awesome Div" alt="screen shot example of styled awesome div"></p>

<p>Want to apply your awesome div styles to other elements in a single
line? Want to do that while enabling the flexibility of changing the gradient colors?
All you have to do is create a Sass mixin and some variables.</p>

<figure class='code'><figcaption><span>Composite Mixins</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>
</span><span class='line'>// create the mixin
</span><span class='line'>
</span><span class='line'>@mixin awesome_mixin($top_color, $bottom_color) {
</span><span class='line'>  @include linear-gradient($top_color, $bottom_color);
</span><span class='line'>  @include box-shadow(0px 1px 4px rgba(0, 0, 0, 0.3));
</span><span class='line'>  @include border-radius(4px);
</span><span class='line'>}
</span><span class='line'>
</span><span class='line'>// awesomeness
</span><span class='line'>
</span><span class='line'>.div_needing_awesome {
</span><span class='line'>  @include awesome_mixin(#748BB9, #5570a7);
</span><span class='line'>}
</span></code></pre></td></tr></table></div></figure>


<p>Do you want to use Bourbon&#8217;s button add on, but modify your button&#8217;s margins
and padding on the fly?</p>

<figure class='code'><figcaption><span>Awesome Buttons</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>
</span><span class='line'>// create the mixin
</span><span class='line'>
</span><span class='line'>@mixin awesome_button($color, $margin, $padding){
</span><span class='line'>  @include button($color);
</span><span class='line'>  margin: $margin;
</span><span class='line'>  padding: $padding;
</span><span class='line'>}
</span><span class='line'>
</span><span class='line'>// button time!
</span><span class='line'>
</span><span class='line'>.big_awesome {
</span><span class='line'>  @include awesome_button(#5570a7, 4px, 20px 40px 24px 40px);
</span><span class='line'>  font-size: 22px;
</span><span class='line'>
</span><span class='line'>}
</span><span class='line'>.small_awesome {
</span><span class='line'>  @include awesome_button(#51c96e, 4px, 5px 7px 8px 7px);
</span><span class='line'>}
</span><span class='line'>
</span></code></pre></td></tr></table></div></figure>


<p><img src="http://launchware.com/images/awesome_buttons.png" title="Awesome Buttons" alt="screen shot example of styled awesome buttons"></p>

<p>Note above that you can use shorthand for the $margin and $padding
variables just like you would with plain css.  All you have to do is
comma delimit them when passing as an argument.</p>

<p>Be sure to find a list of all supported functions, mixins, and addons at
the bottom of the documentation.  There are some helpful functions like
tint and shade for altering colors and useful variables like
font-family.</p>

<p>Finally, you can <code>bundle open bourbon</code> to explore the gem.  The source
is well organized and readable.  You can see all the work thoughtbot put
into the project to make your life easier.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Semantics Over Aesthetics: Use Destroy Buttons Instead of Destroy Links]]></title>
    <link href="http://launchware.com/articles/semantics-over-aesthetics-use-destroy-buttons-instead-of-destroy-links/"/>
    <updated>2011-12-31T16:19:00-05:00</updated>
    <id>http://launchware.com/articles/semantics-over-aesthetics-use-destroy-buttons-instead-of-destroy-links</id>
    <content type="html"><![CDATA[<p>I was coding away this afternoon, and I introduced a destroy link to my codebase. It looked something like this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'>  <span class="o">&lt;%=</span> <span class="n">link_to</span> <span class="s2">&quot;Delete&quot;</span><span class="p">,</span> <span class="n">widget_path</span><span class="p">(</span><span class="vi">@widget</span><span class="p">),</span> <span class="nb">method</span><span class="p">:</span> <span class="ss">:delete</span> <span class="o">%&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<!-- more -->


<p>Every time I write something like this, it makes me think twice. The problem with this code is that it heavily relies on JavaScript and <a href="http://github.com/rails/jquery-ujs">jquery-ujs</a> to trigger the right action on the server (An HTTP DELETE request). Anchors are semantically only capable of linking to URL&#8217;s with a GET request.</p>

<p>Here&#8217;s why writing a link this way is bad:</p>

<ul>
<li>It relies heavily on javascript. Any user with a non-JavaScript capable browser will not be able to exercise this action.</li>
<li>It can be followed by a bot if you&#8217;re not careful. Search engines and other bots might catch this link and attempt to follow it.</li>
</ul>


<p>Sometimes, I&#8217;d write a link with a manual route so that I could use a proper link. Something like this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'>  <span class="o">&lt;%=</span> <span class="n">link_to</span> <span class="s2">&quot;Delete&quot;</span><span class="p">,</span> <span class="n">delete_widget_path</span><span class="p">(</span><span class="vi">@widget</span><span class="p">)</span> <span class="o">%&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>After properly configuring routes and a controller, this issues a GET to the widgets controller and destroys the widget via a delete instance method. This is even worse for a number of reasons:</p>

<ul>
<li>It violates RESTful conventions. A GET request should generally not cause writes to your domain objects.</li>
<li>It circumvents a bunch of Rails countermeasures and makes you succeptible to exploits. Things like cross site request forgery protection aren&#8217;t run on GET requests. That means a malignant user could try to impersonate another user by hijacking their session.</li>
<li>This link is even more succeptible to bots following it if you do not include a rel=&#8221;nofollow&#8221; attribute.</li>
</ul>


<p>With a desire for other opinions, I turned to twitter and had a great <a href="http://twitter.com/#!/dpickett/status/153190445931970560">conversation</a> with some smart folks. We were debating on how HTTP should not constrain a user&#8217;s experience and that there should be an accessible way to markup links that issue a DELETE request. Ultimately, it boiled down to a decision between using a link as opposed or a button and/or form element for this type of interaction. <a href="http://twitter.com/#!/gisikw/status/153194635890667520">Kevin&#8217;s tweet</a> really hit home for me.</p>

<p>A button would look something like this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'>  <span class="o">&lt;%=</span> <span class="n">button_to</span> <span class="s2">&quot;Delete&quot;</span><span class="p">,</span> <span class="n">widget_path</span><span class="p">(</span><span class="vi">@widget</span><span class="p">),</span> <span class="nb">method</span><span class="p">:</span> <span class="ss">:delete</span> <span class="o">%&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>Buttons and links look very different natively, but that&#8217;s not HTML&#8217;s fault. Browsers interpret them differently, making for very distinct renderings.</p>

<p><img src="http://launchware.com/images/delete_btn_vs_link.png" alt="Delete Button Vs Link" /></p>

<p>The markup or the HTML standard is not at fault here. The browser makes a certain assumption of how you want a button to look vs. how you would like a link to look. If you&#8217;re practicing sound web standards, aesthetics and presentation should be the responsibility of your CSS. So, I created a SCSS/SASS mixin to make a button look like a link.</p>

<script src="https://gist.github.com/1545151.js"> </script>




<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='scss'><span class='line'>  <span class="nt">input</span> <span class="p">{</span>
</span><span class='line'>    <span class="k">@include</span><span class="nd"> link_like_button</span><span class="p">;</span>
</span><span class='line'>    <span class="na">color</span><span class="o">:</span> <span class="nb">blue</span><span class="p">;</span>
</span><span class='line'>  <span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>Which looks much truer to form (note I&#8217;ve added color: blue in addition to the mixin):</p>

<p><img src="http://launchware.com/images/delete_btn_css_vs_link.png" alt="CSS Driven Button Vs Link" /></p>

<p><em>So in conclusion, don&#8217;t use a link to trigger write or destroy actions, especially for aesthetic reasons. You can override the styling opinions of the browser to make a button appear to the user like a link.</em></p>

<p>As an aside, Twitter can be such an awesome place to learn a thing or two. Since investing in community is part of our company values, we spend a lot of time there. If you&#8217;re new to Ruby or the Rails community, it is a great way to learn purely through osmosis.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Accessible Facebook Dialogs And Feed Posting With Rails]]></title>
    <link href="http://launchware.com/articles/accessible-facebook-dialogs-and-feed-posting-with-rails/"/>
    <updated>2011-12-16T11:19:00-05:00</updated>
    <id>http://launchware.com/articles/accessible-facebook-dialogs-and-feed-posting-with-rails</id>
    <content type="html"><![CDATA[<p>Don&#8217;t be jealous that we&#8217;ve been integrating facebook and chatting with babes all day.</p>

<iframe width="640" height="390" src="http://www.youtube.com/embed/2bkRGH4sJDE" frameborder="0" allowfullscreen></iframe>


<p>Let me show you how the users of your app can share activities on Facebook. Thankfully, the effort required to integrate a feature like that has gotten a lot easier with tools like <a href="https://github.com/intridea/omniauth">OmniAuth</a> and the introduction of <a href="http://developers.facebook.com/docs/reference/dialogs/">Facebook Dialogs</a>. What&#8217;s more, they&#8217;ve made it so that you can provide a <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">progressively enhanced</a> experience for your users. In this article, I&#8217;ll walk you through how to build a link that works with or without JavaScript enabled.</p>

<!-- more -->


<h2>Create Your App</h2>

<p>We won&#8217;t reinvent the wheel here. Check out the <a href="http://developers.facebook.com/docs/appsonfacebook/tutorial/">well written guide</a> on how to create your app. Be sure to note your AppId and Secret Key</p>

<h2>Integrate OmniAuth</h2>

<p>We used <a href="https://github.com/mkdynamic/omniauth-facebook">omniauth-facebook</a>. We don&#8217;t advocate the use of <a href="https://github.com/plataformatec/devise">devise&#8217;s</a> baked in omniauth support because it does not support the ability for users to have multiple identities. If you want to eventually support other authentication mechanisms like Google or Twitter, you&#8217;ll run into some architectural problems.</p>

<p>For more detail on getting omniauth set up, <a href="http://net.tutsplus.com/tutorials/ruby/how-to-use-omniauth-to-authenticate-your-users/">the tutorial over at NetTuts</a> isn&#8217;t too terrible.</p>

<h2>Show Dialog Links For Facebook Authenticated Users</h2>

<p>Add our little <a href="https://github.com/enlightsolutions/facebook_dialog">facebook_dialog</a> gem to your Gemfile.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">gem</span> <span class="s1">&#39;facebook_dialog&#39;</span>
</span></code></pre></td></tr></table></div></figure>


<p>Add your api key to an initializer like config/initializers/facebook_dialog.rb</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="no">FacebookDialog</span><span class="o">.</span><span class="n">api_key</span> <span class="o">=</span> <span class="s2">&quot;&lt;your appid/api key&gt;&quot;</span>
</span></code></pre></td></tr></table></div></figure>


<p>In your view, do something like this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="o">&lt;</span><span class="sx">%- feed_dialog = FacebookDialog::Feed.new({</span>
</span><span class='line'><span class="sx">  redirect_uri: &quot;http://www.example.com&quot;,</span>
</span><span class='line'><span class="sx">  link: &quot;http://www.example.com&quot;,</span>
</span><span class='line'><span class="sx">  name: &quot;Wow!&quot;,</span>
</span><span class='line'><span class="sx">  caption: &quot;Something pretty awesome&quot;,</span>
</span><span class='line'><span class="sx">  description: &quot;Zomg! You won&#39;t believe what I found on the web.&quot;</span>
</span><span class='line'><span class="sx">})-%&gt;</span>
</span><span class='line'><span class="sx">&lt;%= link_to &quot;Share on Facebook&quot;, feed_dialog.url, id: &quot;share_on_facebook&quot; %&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>You can then add the JavaScript pieces at the tail end of the body to optimize page loading. Check out our simple jQuery example below:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="o">&lt;</span><span class="sx">%= facebook_js %&gt;</span>
</span><span class='line'><span class="sx">&lt;%=</span> <span class="n">javascript_tag</span> <span class="k">do</span> <span class="sx">%&gt;</span>
</span><span class='line'><span class="sx">  &lt;%= fb_init_js %&gt;</span>
</span><span class='line'>  <span class="err">$</span><span class="p">(</span><span class="s2">&quot;#share_on_facebook&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">click</span><span class="p">(</span><span class="n">function</span><span class="p">(</span><span class="n">e</span><span class="p">){</span>
</span><span class='line'>  <span class="n">e</span><span class="o">.</span><span class="n">preventDefault</span><span class="p">();</span>
</span><span class='line'>    <span class="no">FB</span><span class="o">.</span><span class="n">ui</span><span class="p">(</span><span class="o">&lt;</span><span class="sx">%==</span>  <span class="n">feed_dialog</span><span class="o">.</span><span class="n">to_json</span> <span class="sx">%&gt;);</span>
</span><span class='line'><span class="sx">  });</span>
</span><span class='line'><span class="sx">&lt;%- end -%&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>The facebook_dialog gem supplies the facebook_js and fb_init_js helpers.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[INVEST in good user stories]]></title>
    <link href="http://launchware.com/articles/invest-in-good-user-stories/"/>
    <updated>2011-12-07T19:57:00-05:00</updated>
    <id>http://launchware.com/articles/invest-in-good-user-stories</id>
    <content type="html"><![CDATA[<p>As I work my way through
<a href="http://www.amazon.com/User-Stories-Applied-Software-Development/dp/0321205685/ref=sr_1_1?ie=UTF8&amp;qid=1323305968&amp;sr=8-1"><em>User Stories Applied</em></a>
and begin to write my own for an upcoming project, I keep coming back to
<a href="http://xp123.com/articles/invest-in-good-stories-and-smart-tasks/">Bill Wake&#8217;s</a>
INVEST acronym.  It helps me get in the right mindset. A good user story is independent, negotiable, valuable,
estimatable, small, testable.  If it can meet all those requirements,
you&#8217;ve done a good job.</p>

<h4>Independent</h4>

<p>Stories that are independent make the whole development
process easier.  You don&#8217;t have stories waiting for others to be
completed so estimation of development time becomes more precise.  Be
creative, sometimes stories can be combined or defined in a way to
decreases dependencies.</p>

<h4>Negotiable</h4>

<p>Stories help in the discovery and planning phase of a
project.  They facilitate the conversation between client and the
development team.  Remember to note high-level details and decisions
that are made in these meetings.</p>

<h4>Valuable</h4>

<p>Make sure each story provides value to either the purchaser
or user of the product.  This type of focus can help in the
proritization of stories.  Some clients are comfortable writing their
own stories and this can provide good insight into their vision of the
product.</p>

<h4>Estimatable</h4>

<p>If a story is not estimatable, it is usually too large or the development
team lacks the domain or technical knowledge necessary for an
estimation.  A conversation with the client can increase domain
understanding, while a developer can build technical understanding
before estimation.</p>

<h4>Small</h4>

<p>Small stories allow for the most accurate predictions.  If they are
too big or small, it is difficult to block out the correct about of
development time.  Combine or split stories to managable sizes.  Stories
can be split by user actions (separate create, edit, update stories).</p>

<h4>Testable</h4>

<p>A story is not complete until it can pass automated tests.  Non-functional or
overly subject requirements can lead to untestable conditions and should
be avoided.  As the code base evolves, you will continually use your
tests to ensure old stories are not broken.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Catch All Exception Handling Is Not Flow Control]]></title>
    <link href="http://launchware.com/articles/catch-all-exception-handling-is-not-flow-control/"/>
    <updated>2011-09-27T00:00:00-04:00</updated>
    <id>http://launchware.com/articles/catch-all-exception-handling-is-not-flow-control</id>
    <content type="html"><![CDATA[<p>There has been a lot of <a href="http://www.ngauthier.com/2011/09/using-exceptions-to-manage-control-flow.html">recent</a> <a href="http://avdi.org/devblog/exceptional-ruby/">discussion</a> about utilizing exception handling as flow control. It is my opinion that this is a bad practice, and results in code that is difficult to read and maintain.</p>

<p>Exceptions can be perceived as non-local GOTO statements. This can adversely affect the readability of your code and mislead team members as to the actual <em>intent</em> of your method. Let&#8217;s take an oft-used controller action for example.</p>

<script src="https://gist.github.com/1245348.js?file=bad_controller.rb"></script>


<p>This is bad for a few reasons. First, we&#8217;re utilizing what&#8217;s called a <em>catch all</em> exception here. This is <a href="http://www.enlightsolutions.com/articles/bad-design-catch-all-exceptions/">bad design</a> because we could be burying an error that developers need to know about. Perhaps there&#8217;s a hook that sends an email out upon creation, and the SMTP server is down. With this implementation, the developers would have no way of knowing about that exceptional case and users would continue to receive unprocessable entity status codes.</p>

<p>This is also a violation of REST. When something is exceptional or in an errant state, like an SMTP server being down, the proper status code to return is 500 (Server Error). Returning an unprocessable entity infers to the client that they have supplied invalid information and that they&#8217;re disobeying the API&#8217;s contract.</p>

<p>So, let&#8217;s improve this example a bit to remove the catch all exception:</p>

<script src="https://gist.github.com/1245348.js?file=better_controller.rb"></script>


<p>This is better because it expressly handles for an expected exception as opposed to any error that can happen in the ruby universe of errors. This way, if an SMTP server was unavailable or timed out, developers could be notified about that problem and address it.</p>

<p>There&#8217;s still a problem here, however. The code above is not <em>intentional</em> and should be considered a violation of the <a href="http://c2.com/cgi/wiki?PrincipleOfLeastAstonishment">Principle of Least Astonishment</a>. Programmers <a href="http://www.amazon.com/gp/product/0132350882/ref=as_li_ss_tl?ie=UTF8&amp;tag=enlsolinc-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0132350882">read code a heck of a lot more than they write it</a> so your code should be clear and intentional. Utilizing a conditional expressively states &#8220;I&#8217;m expecting this case to fail <em>sometimes</em>, and here&#8217;s how we handle it.&#8221;</p>

<script src="https://gist.github.com/1245348.js?file=best_controller.rb"></script>


<p>This also allows us to evaluate all the lines in each side of the conditional whereas a rescue halts execution.</p>

<p>There are also <a href="https://gist.github.com/1245342">moderate performance gains</a> to using conditionals because Ruby is optimized for that logic as opposed to exception handling.</p>

<p>This conversation is not new. To quote one of my favorite books (first published in October, 1999), <a href="http://www.amazon.com/gp/product/020161622X/ref=as_li_ss_tl?ie=UTF8&amp;tag=enlsolinc-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=020161622X">The Pragmatic Programmer</a>,</p>

<blockquote><p>&#8220;&#8230;exceptions should rarely be used as part of a program&#8217;s normal flow; exceptions should be reserved for unexpected events&#8221;</p></blockquote>

<p>If you&#8217;re still not convinced, <a href="http://lmgtfy.com/?q=do+not+use+exceptions+as+flow+control">let me google that for you</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Notes from RamenCamp 2011]]></title>
    <link href="http://launchware.com/articles/notes-from-ramencamp-2011/"/>
    <updated>2011-05-22T00:00:00-04:00</updated>
    <id>http://launchware.com/articles/notes-from-ramencamp-2011</id>
    <content type="html"><![CDATA[<p>Congratulations to the organizers of <a href="http://ramencamp.com/">Ramencamp</a>, a new Boston conference for bootstrapping your startup. The content was amazing and it was a great crowd of Boston professionals.</p>

<p>I&#8217;ve been playing around with <a href="http://springpadit.com/">SpringPad</a> and thought it would be cool to share my notebook from the day. <a href="http://sprng.me/aiug4">Check out my notes</a>.</p>

<p>After using SpringPad on my iPad for the day, I can see myself taking notes at other conferences in this way. I&#8217;ve really been enjoying the application, and I recommend you check it out. I also dig the Android app.</p>

<p>Another great idea the organizers incorporated into the agenda were lunch conversations with all of the speakers. It was a great way to facilitate a more interactive chat. The highlight of the day for me was watching <a href="http://twitter.com/launchbit">Elizabeth Yin</a> guide business oriented founders towards not rushing to build products and to make small steps towards building complex feature sets. She did a phenomenal job expressing <a href="http://theleanstartup.com/">Lean Startup</a> sentiments in a simple and understandable manner. Launchbit has done a great job assembling a toolkit for founders to assess their business ideas. I definitely recommend checking out the <a href="http://www.launchbit.com/index.php">Launchbit</a> site.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[What's New in Edge: Scoped Mass Assignment in Rails 3.1]]></title>
    <link href="http://launchware.com/articles/whats-new-in-edge-scoped-mass-assignment-in-rails-3-1/"/>
    <updated>2011-05-16T00:00:00-04:00</updated>
    <id>http://launchware.com/articles/whats-new-in-edge-scoped-mass-assignment-in-rails-3-1</id>
    <content type="html"><![CDATA[<p>Security is important. You don&#8217;t want malicious users chatting on IRC about how they Pwnd your web application.</p>

<iframe width="560" height="349" src="http://www.youtube.com/embed/O2rGTXHvPCQ" frameborder="0" allowfullscreen></iframe>


<p>If you&#8217;re using Rails and you want to be secure, you should be protecting against mass assignment. Basically, without declaring attr_accessible or attr_protected, malicious users can set any column value in your database, including foreign keys and secure data.</p>

<p>Here&#8217;s a brief introduction to how mass assignment protection works. Let&#8217;s say you have a user that belongs to a group:</p>

<script src="https://gist.github.com/974447.js?file=user_classic.rb"></script>


<p>When I set group_id to be protected, I&#8217;m disallowing it to be set by mass assignment.</p>

<p>My recommended approach, however, is to always set a whitelist of mass assignable attributes with attr_accessible instead of a blacklist with attr_protected. That way, you don&#8217;t unintentionally leave a secure attribute unprotected.</p>

<script src="https://gist.github.com/974447.js?file=user_attr_accessible.rb"></script>


<p>This was a great addition to the Rails framework, but I always found myself wanting to conditionally protect attributes based on the state and authorization of my user. For example, I might want disallow users from setting their roles when they update their profiles, but I might want to allow admins to adjust their role via an administrative backend. This is how you can get it done in Rails 3.1</p>

<script src="https://gist.github.com/974447.js?file=user_with_scope.rb"></script>


<p>Along with this helpful change, you can also circumvent mass assignment protection entirely. This is useful, for example, if you&#8217;re loading data and you control the source.</p>

<script src="https://gist.github.com/974447.js?file=user_without_protection.rb"></script>


<p>You should really only use without_protection if <em>you</em> control the inputted attributes. It isn&#8217;t something you&#8217;d want to have in a controller action, generally speaking.</p>

<p>For more information on scoped mass assignment and additional attack vectors you should be securing against, <a href="http://edgeguides.rubyonrails.org/security.html">check out the edge Rails guide on security</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Use VCR to make your API Integration Tests More Deterministic]]></title>
    <link href="http://launchware.com/articles/use-vcr-to-make-your-api-integration-tests-more-deterministic/"/>
    <updated>2011-04-12T00:00:00-04:00</updated>
    <id>http://launchware.com/articles/use-vcr-to-make-your-api-integration-tests-more-deterministic</id>
    <content type="html"><![CDATA[<p>I gave a quick talk at <a href="http://bostonrb.org">Boston.rb</a> this month about <a href="https://github.com/myronmarston/vcr">VCR</a>, a tool that can help make your integration tests more deterministic.</p>

<p>I&#8217;ve been enjoying the tool quite a bit. It makes it really easy to interact with web services in your tests in a way that doesn&#8217;t depend on the endpoint always being up. This approach leads to better, quicker, and more predictable tests. If you&#8217;re already using WebMock or FakeWeb, this tool will automate the process of pre-fetching your response/expected result for you.</p>

<p>Slides Below:</p>

<iframe src="http://www.slideshare.net/slideshow/embed_code/7606987" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>


<p>Hope you find them useful!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Integration Testing Braintree's Transparent Redirect with Rails and Cucumber]]></title>
    <link href="http://launchware.com/articles/integration-testing-braintrees-transparent-redirect-with-rails-and-cucumber/"/>
    <updated>2011-04-03T00:00:00-04:00</updated>
    <id>http://launchware.com/articles/integration-testing-braintrees-transparent-redirect-with-rails-and-cucumber</id>
    <content type="html"><![CDATA[<p>So you&#8217;ve got a solid idea, a nice niche, and a great web application that meets your customers&#8217; needs. Now it&#8217;s time to get PAID. It is all about the proverbial Benjamins after all.</p>

<object style="height: 390px; width: 640px"><param name="movie" value="http://www.youtube.com/v/aTTVkh6NX50?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/aTTVkh6NX50?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></object>


<h2>Go With Braintree Payment Solutions</h2>

<p>If you&#8217;re building a SaaS (Software as a Service) application then you probably need a merchant account, a payment processor, and a subscription billing system. After researching many options, Braintree Payment Solutions has a really stellar offering that really delivers in those three areas. Having been tasked with debugging payment processing issues in the past, having <strong>one</strong> provider to call is really convenient and simple.</p>

<h2>Go With Transparent Redirect</h2>

<p>In addition to being an all-in-one solution, Braintree has some pretty cool technology. In order to get around PCI compliance and all the liabilities with storing credit card data, they provide their customers with a system they call Transparent Redirect. This system allows you to post all client credit card information directly to Braintree without persisting any private data on your side.</p>

<p>Do you have custom attributes that you need to capture on registration in addition to the credit card data? No problem! Braintree will pass those through to your response handler.</p>

<p>For more details, <a href="http://www.braintreepaymentsolutions.com/gateway/api">check out their docs</a>.</p>

<h2>Implement Transparent Redirect</h2>

<p>I used the <a href="https://github.com/braintree/braintree_ruby">Braintree gem</a> to get things going.</p>

<h3>Initializer</h3>

<p>Put your Braintree configuration in an initializer like <strong>config/initializer/braintree.rb</strong></p>

<script src="https://gist.github.com/901023.js?file=braintree.rb"></script>


<h3>Schema Changes</h3>

<p>Add a column to your account/user abstraction to store Braintree&#8217;s unique identifier for the customer. This will link the account to Braintree&#8217;s record.</p>

<script src="https://gist.github.com/901023.js?file=schema_change.rb"></script>


<h3>Custom Attributes</h3>

<p>Use Braintree&#8217;s control panel to configure any custom attributes you want to store and/or forward. For more details on this, check out <a href="http://www.braintreepaymentsolutions.com/docs/ruby/general/custom_fields">their writeup</a>.</p>

<h3>Set up your form</h3>

<p>I&#8217;m doing some quick handwaving here - I had to create an activemodel compliant abstraction for the Braintree customer. The idea is to create a form that looks like this (hint: give plataformatec&#8217;s <a href="">simple_form</a> a try):</p>

<script src="https://gist.github.com/901023.js?file=new.html.erb"></script>


<h2>Integration Test</h2>

<p>This is <em>the</em> most important part of your app. You want to get paid and your customers don&#8217;t want to think twice about giving you their money. Let&#8217;s keep these transactions running smooth. Don&#8217;t leave a gaping hole in your test suite! I use <a href="http://cukes.info/">cucumber</a> for acceptance and integration testing.</p>

<h3>Remote Action Problems</h3>

<p>So cucumber isn&#8217;t always <a href="http://sfmoto.files.wordpress.com/2008/07/unicorns_rainbows.jpg">rainbows and unicorns</a>. Cucumber does this really fun thing where it assumes every form submission posts to localhost regardless of what&#8217;s actually set in the html.</p>

<p>To get around this, we have to hijack the local requests and basically emulate a post to Braintree directly.</p>

<script src="https://gist.github.com/901023.js?file=braintree_test_app.rb"></script>


<h3>Hack Yo&#8217; Rack</h3>

<p>But wait - more fun ensues! Braintree does this really neat and secure thing called request signing. It requires that the hash used to build the query string be ordered. By default on Ruby 1.8.7, hashes are not ordered, so we have to hack both Rack and Rack-Test a bit :-( (<a href="http://xil-reno.shackspace.com/Sad_Panda.jpg">Queue the sad panda</a>).</p>

<p>Warning! Horrendous monkey patching ahead!</p>

<script src="https://gist.github.com/901023.js?file=hack_rack.rb"></script>


<h3>Use VCR for Deterministic Tests</h3>

<p>Phew! That was a lot of hacking to get solid cucumber tests around your app. Let&#8217;s make sure that your tests aren&#8217;t dependent on Braintree&#8217;s sandbox being up and that your tests are generally deterministic. That way, you can run your test suite without necessarily having to be online, and you get repetitious, predictable tests.</p>

<p>To pull this off, I&#8217;m a huge fan of a tool called <a href="https://github.com/myronmarston/vcr">VCR</a>.</p>

<script src="https://gist.github.com/901023.js?file=vcr.rb"></script>


<p>This tool will record web requests and responses and allows you to run your tests without hitting the remote servers.</p>

<h3>Hide Your Logins, Hide Your Keys</h3>

<p>But wait! Don&#8217;t commit that code just yet. When you record requests and responses, you need to obscure all the secure stuff that gets passed into your requests and gets returned in your responses. Here&#8217;s a quick little utility I whipped up to hide the naughty bits:</p>

<script src="https://gist.github.com/901023.js?file=vcr_2_point_oh.rb"></script>


<p>It&#8217;s a lot of work, but what results are solid, deterministic tests that effectively exercise what your user experiences when signing up for your service. Delightful enrollment features leads to delighted customers, and delighted customers lead to delighted, well-paid entrepreneurs! Happy charging!</p>

<p>Also, here&#8217;s the <a href="https://gist.github.com/901023">complete GIST</a> for reference.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[An Introduction to Developing Mobile Applications with JQuery Mobile]]></title>
    <link href="http://launchware.com/articles/an-introduction-to-developing-mobile-applications-with-jquery-mobile/"/>
    <updated>2011-02-11T00:00:00-05:00</updated>
    <id>http://launchware.com/articles/an-introduction-to-developing-mobile-applications-with-jquery-mobile</id>
    <content type="html"><![CDATA[<p>Last Tuesday I gave a very quick talk at the <a href="http://www.bostonrb.org">BostonRB</a> Meetup introducing mobile application development. There were some great questions at the end. You can catch the video and the slides below:</p>

<object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/AWjc1Ph7GNE?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AWjc1Ph7GNE?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="390"></embed></object>




<object id="__sse6881224" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquerymobile-110210105403-phpapp01&stripped_title=a-brief-introduction-to-jquery-mobile&userName=enlightsolutions" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse6881224" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquerymobile-110210105403-phpapp01&stripped_title=a-brief-introduction-to-jquery-mobile&userName=enlightsolutions" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>


<p>A big thanks to <a href="http://www.michaeldurrant.com/">Michael Durrant</a> for filming the presentations!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Logging Email Messages with Ruby, Rails and postmaster_general]]></title>
    <link href="http://launchware.com/articles/logging-email-messages-with-ruby-rails-and-postmaster_general/"/>
    <updated>2011-01-25T00:00:00-05:00</updated>
    <id>http://launchware.com/articles/logging-email-messages-with-ruby-rails-and-postmaster_general</id>
    <content type="html"><![CDATA[<p>Rendering emails locally is a pain. Rendering all the emails in your Rails app is even more of a headache.</p>

<p>I frequently get requests from clients to send them a complete set of the emails sent from their applications for copywriting review. I wrote a quick gem for you to incorporate that function into your ActionMailer tests. It will log all of your emails to a central location so that you can zip them up and send them to your clients and/or stakeholders.</p>

<p>I&#8217;ve called it <a href="http://github.com/dpickett/postmaster_general">postmaster_general</a>.</p>

<p>Once installed (add it to your gemfile as specified in the <a href="https://github.com/dpickett/postmaster_general/blob/master/README.rdoc">README</a>, set the log directory like so:</p>

<p><code>
PostmasterGeneral.log_directory = "/some/arbitrary/path"
</code></p>

<p>Then, you might have an ActionMailer spec like this:</p>

<script src="https://gist.github.com/795439.js"> </script>


<p>After you run your suite or this particular spec, you&#8217;ll have a file with a path of /some/arbitrary/path/a_delivery.txt that contains the contents of your message. What&#8217;s neat is it works well with continuous integration - you could set up your CI to automatically prepare an up to date version of all the emails in your system.</p>

<p>I hope you find it helpful, and that it encourages you to write ActionMailer tests!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Start Your Rails Development Day Right: Scripting out TMux for your Rails Project]]></title>
    <link href="http://launchware.com/articles/start-your-rails-development-day-right-scripting-out-tmux-for-your-rails-project/"/>
    <updated>2010-12-01T00:00:00-05:00</updated>
    <id>http://launchware.com/articles/start-your-rails-development-day-right-scripting-out-tmux-for-your-rails-project</id>
    <content type="html"><![CDATA[<p>Every day starts the same. Open up <a href="http://code.google.com/p/iterm2/">iterm2</a>, start up a <a href="http://tmux.sourceforge.net/">tmux</a> session and create 3 windows. One for working (generating models, opening up the Rails console, etc), one for the server, and one for running autotest in the background. Then, I name the Tmux session appropriately along with all the windows. It takes about 5-10 minutes to get this all set up nicely in the morning. I got kind of tired doing it and felt like it was wasted time. After some research and some honing, I&#8217;ve created the following script:</p>

<script src="https://gist.github.com/723637.js?file=tmux_textaurant.sh"></script>


<p>Hope you find it useful! For easy reference and forking I&#8217;ve created a <a href="https://gist.github.com/723637">gist</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Pledge 3 Percent for Rails 3]]></title>
    <link href="http://launchware.com/articles/pledge-3-percent-for-rails-3/"/>
    <updated>2010-04-10T00:00:00-04:00</updated>
    <id>http://launchware.com/articles/pledge-3-percent-for-rails-3</id>
    <content type="html"><![CDATA[<p>Has Ruby on Rails been good to you? Has the framework helped you get a job or start your consulting career? If so, I challenge you to give 3 percent of your time for Rails 3 over the next few months. If you work 40 hours a week, 3 percent amounts to less than 5 hours a month! Could you donate half a Saturday a month to the framework that figuratively puts money in your bank account? I can, and that&#8217;s why I&#8217;m pledging three percent for Rails 3 over the next few months.</p>

<p>The Bugmashes have <a href="http://railsbridge.org/news_items/8">been</a> <a href="http://railsbridge.org/news_items/11">great</a>, but there&#8217;s still more to be done. The core team is dedicated and smart, but they can&#8217;t do it all. As of the time of this post, there are <a href="https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets?q=state:open&amp;filter=">1199 open tickets</a> in Lighthouse, <a href="https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/bins/5837">898 open bugs</a>, and <a href="https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/bins/5805">301 open patches</a>. Oh yeah, and by the way, Rails has been basically overhauled and re-architected in its entirety (You might want to kick the tires a bit).</p>

<p>Stop whining about bundler. Stop complaining about the new routing DSL. Instead of taking the time to talk about everything that&#8217;s going wrong, put in the time to make it right. Here&#8217;s why you should pledge your <a href="http://wiki.github.com/dpickett/3PercentForRails3/">three percent today</a>:</p>

<h2>It Makes a Better Framework</h2>

<p>How confident are you in a framework that has 1199 open issues that aren&#8217;t going away? How much better would the framework be if developers like <a href="http://blog.plataformatec.com.br/">Jose</a>, <a href="http://yehudakatz.com/">Wycats</a>, and <a href="http://www.koziarski.com/">Koz</a> were freed up to focus on the bigger picture? If you use Rails on a daily basis, your unique perspective matters, and you can help with the burden of all of these open issues.</p>

<h2>It Makes a Better Community</h2>

<p>Negativity is contagious. You can sit on the sidelines and complain about what&#8217;s coming, or you can get in the game and help make things happen. What stinks is that if there&#8217;s an obnoxious crowd heckling the players on the field, newcomers will be less inclined to jump in. Positivity can be a virus in the same way. If you truly love what you do and you&#8217;re grateful, exhibiting that makes the community as a whole better and it attracts newcomers to the project.</p>

<h2>It Makes You a Better, More Marketable Developer</h2>

<p>Knowing the internals of the framework you use on a day to day basis definitely makes you a better developer. There is no magic behind Rails, just smart design and Ruby. Consider pair programming with someone more experienced than you and how that impacts your performance. Now, imagine working with the leaders of the community on core functionality and how that can improve your skills.</p>

<p>Consider the benefits from a professional perspective as well. Do you think being a core contributor differentiates you in a hiring decision? If you&#8217;re a freelancer, does that provide you with something marketable over those still on the sidelines?</p>

<p>Get in the game. <a href="http://wiki.github.com/dpickett/3PercentForRails3/">Pledge your 3 percent today</a> and <a href="https://rails.lighthouseapp.com/projects/8994/sending-patches">give back</a>.</p>
]]></content>
  </entry>
  
</feed>
