<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pivotal Labs &#187; Hunter Gillane</title>
	<atom:link href="http://pivotallabs.com/author/hunter/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Wed, 19 Jun 2013 22:16:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Simple Test Parallelization</title>
		<link>http://pivotallabs.com/simple-test-parallelization/</link>
		<comments>http://pivotallabs.com/simple-test-parallelization/#comments</comments>
		<pubDate>Tue, 21 May 2013 02:39:57 +0000</pubDate>
		<dc:creator>Hunter Gillane</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[engines]]></category>
		<category><![CDATA[parallelism]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=19391</guid>
		<description><![CDATA[<p>Let&#8217;s look at a simple approach to parallelizing a test suite for a Ruby app. Parallelizing your specs can be a good strategy to get a speedup on an existing slow suite. It can also be employed early on a greenfield project as part of a commitment to fast tests. The same caveats that Andrew mentions in that article post here as well, namely that parallelization might mask more important design changes you need to make in you suite. While you could use a gem like parallel_tests, let&#8217;s look at what it would take to achieve this without needing to pull in another dependency. The only requirement to employ this approach is that the parts of your build that you want to parallelize do not share a database, or if they do, that it will not cause test pollution if your specs run at the same time. These parallelizable portions&#8230;</p><p>The post <a href="http://pivotallabs.com/simple-test-parallelization/">Simple Test Parallelization</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Let&#8217;s look at a simple approach to parallelizing a test suite for a Ruby app. Parallelizing your specs can be a good strategy to get a speedup on an existing slow suite. It can also be employed early on a greenfield project as part of a <a href="http://pivotallabs.com/designing-an-api-in-hell/">commitment to fast tests</a>. The same caveats that Andrew mentions in that article post here as well, namely that parallelization might mask more important design changes you need to make in you suite.</p>
<p>While you could use a gem like <a href="https://github.com/grosser/parallel_tests">parallel_tests</a>, let&#8217;s look at what it would take to achieve this without needing to pull in another dependency.</p>
<p>The only requirement to employ this approach is that the parts of your build that you want to parallelize do not share a database, or if they do, that it will not cause test pollution if your specs run at the same time. These parallelizable portions of your build could be Rails engines, a library in lib, <a href="http://pivotallabs.com/unbuilt-rails-dependencies-how-to-design-for-loosely-coupled-highly-cohesive-components-within-a-rails-application/">an unbuilt gem</a>, or any other isolated piece of your app. If your app doesn&#8217;t meet that requirement, something like parallel_tests will likely be more useful.</p>
<p>Let&#8217;s assume that you are <a href="http://pivotallabs.com/migrating-from-a-single-rails-app-to-a-suite-of-rails-engines/">using engines to organize functionality</a> in your app. In this case you likely are already using a separate database for each engine&#8217;s test suite, so let&#8217;s use that as a basis for our example. Assuming that you have two engines (engine1 and engine2) and they are both in the engines directory, you could write a rake task that parallelizes your build that looks something like this:</p>
<pre><code>
task :build do
  build_pids = []

  %w{engine1 engine2}.each do |engine_name|
    build_pids &lt;&lt; fork { exec "cd engines/#{engine_name} &amp;&amp; rspec spec" }
  end

  trap(:INT) do
    build_pids.each do |pid|
      begin
        Process.kill(:INT, pid)
      rescue Errno::ESRCH
      end
    end
  end

  Process.waitall.each do |pid, status|
    unless status.success?
      puts "Build failed"
      exit 1
    end
  end

  puts "Build successful"
  exit 0
end

</code></pre>
<p>This rake task does three things:</p>
<ul>
<li>Uses fork+exec to kick off child processes to run each engine&#8217;s build</li>
<li>Collects the child processes after they have completed and exits non-zero if any of the child build processes were unsuccessful</li>
<li>Captures INT so that all child build processes will be killed when you Ctrl-C in the terminal</li>
</ul>
<p>The output can be ugly but may be worth the time savings, especially if you only are going to be running this task as a last check before CI.</p>
<p>The post <a href="http://pivotallabs.com/simple-test-parallelization/">Simple Test Parallelization</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/simple-test-parallelization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boulder Standup &#8211; Feb 24, 2012</title>
		<link>http://pivotallabs.com/boulder-standup-feb-24-2012/</link>
		<comments>http://pivotallabs.com/boulder-standup-feb-24-2012/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 15:25:00 +0000</pubDate>
		<dc:creator>Hunter Gillane</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/boulder-standup-feb-24-2012/</guid>
		<description><![CDATA[<p><h2>Helps</h2>

<ul>
<li>RubyMine 4 is scrolling to the bottom of the window when displaying test results.</li>
</ul>

<p>Click the gear in the test runner window and click "Select First Failed Test When Finished"</p>

<h2>Interestings</h2>

<ul>
<li><a href="https://github.com/ubermajestix/grep_routes">grep_routes</a>
Tyler from Boulder office mate <a href="http://www.everlater.com/">Everlater</a> wrote a gem called grep_routes. It lets you search your routes without loading all of Rails. Only works with Rails 3.1 and 3.2.</li>
</ul> <a href="http://pivotallabs.com/boulder-standup-feb-24-2012/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/boulder-standup-feb-24-2012/">Boulder Standup &#8211; Feb 24, 2012</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Helps</h2>
<ul>
<li>RubyMine 4 is scrolling to the bottom of the window when displaying test results.</li>
</ul>
<p>Click the gear in the test runner window and click &#8220;Select First Failed Test When Finished&#8221;</p>
<h2>Interestings</h2>
<ul>
<li><a href="https://github.com/ubermajestix/grep_routes">grep_routes</a><br />
Tyler from Boulder office mate <a href="http://www.everlater.com/">Everlater</a> wrote a gem called grep_routes. It lets you search your routes without loading all of Rails. Only works with Rails 3.1 and 3.2.</li>
</ul>
<p>The post <a href="http://pivotallabs.com/boulder-standup-feb-24-2012/">Boulder Standup &#8211; Feb 24, 2012</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/boulder-standup-feb-24-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal: Beyond Ctrl + A and Ctrl + E</title>
		<link>http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/</link>
		<comments>http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 22:53:00 +0000</pubDate>
		<dc:creator>Hunter Gillane</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/</guid>
		<description><![CDATA[<p><p>Update: I had some of the Ctrl and Option commands switched. Fixed now.</p>

<p>As Rails developers, we spend most of our day in two places: an IDE/text editor and the command line. While we spend much time learning shortcuts that help us write and refactor our source code more quickly, many of us are perfectly okay just learning Ctrl + A and Ctrl + E and holding down the arrow keys to place the cursor where we want to get to on the command line.</p>

<p>Don't do that. With only a handful of additional commands, your day to day interaction with the terminal can be much more pleasant. Here are a few ways to do that using terminal and the bash shell.</p>

<h2>A Command Line Editing Starter Pack</h2>

<p>Here's a quick list of commands that you'll get a lot of day to day usage from, if you aren't already:</p>

<ul>
<li>Ctrl + A: Move cursor to the beginning of the line</li>
<li>Ctrl + E: Move cursor to the end of the line</li>
<li>Ctrl + K: Delete from cursor to the end of the line</li>
<li>Option + F: Move cursor one word forward</li>
<li>Option + B: Move cursor one word backward</li>
<li>Option + D: Delete next word</li>
<li>Option + Delete: Delete previous word</li>
</ul>

<p><em>Note</em>: You'll need to set your meta key to Option before the commands that use Option will work &#40;see below&#41;.</p>

<p>These seven simple commands will help you move more nimbly when editing text on the commands line. There is certainly plenty more you can do, which you can find <a href="http://www.gnu.org/software/bash/manual/bashref.html#Command-Line-Editing">in the bash manual</a>.</p>

<h2>A Word on Modes</h2>

<p>By default, the bash shell run in emacs mode. This means that emacs shortcuts are enabled by default.</p>

<p>Emacs mode uses a Meta key for some commands, and the Option key is a good choice. In Terminal on OS X, you'll need to enable this by going to Preferences > Settings > Keyboard and checking "Use option as meta key." </p>

<p>You can also tell bash you want to use vi mode for command line editing with <code>set -o vi</code>, if for some reason you want to type <code>i</code> before every <code>cd</code> or <code>ls</code> you write. </p>

<h2>End</h2>

<p>Nothing new or overwhelmingly exciting here, and there is certainly much more to dive into if you are so inclined. However, this small set of commands will have you covered for the majority of your day to day command line editing needs and is what I would consider constitutes a minimum level of proficiency.</p>

<p>Give your arrow keys a break!</p> <a href="http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/">Terminal: Beyond Ctrl + A and Ctrl + E</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Update: I had some of the Ctrl and Option commands switched. Fixed now.</p>
<p>As Rails developers, we spend most of our day in two places: an IDE/text editor and the command line. While we spend much time learning shortcuts that help us write and refactor our source code more quickly, many of us are perfectly okay just learning Ctrl + A and Ctrl + E and holding down the arrow keys to place the cursor where we want to get to on the command line.</p>
<p>Don&#8217;t do that. With only a handful of additional commands, your day to day interaction with the terminal can be much more pleasant. Here are a few ways to do that using terminal and the bash shell.</p>
<h2>A Command Line Editing Starter Pack</h2>
<p>Here&#8217;s a quick list of commands that you&#8217;ll get a lot of day to day usage from, if you aren&#8217;t already:</p>
<ul>
<li>Ctrl + A: Move cursor to the beginning of the line</li>
<li>Ctrl + E: Move cursor to the end of the line</li>
<li>Ctrl + K: Delete from cursor to the end of the line</li>
<li>Option + F: Move cursor one word forward</li>
<li>Option + B: Move cursor one word backward</li>
<li>Option + D: Delete next word</li>
<li>Option + Delete: Delete previous word</li>
</ul>
<p><em>Note</em>: You&#8217;ll need to set your meta key to Option before the commands that use Option will work &#40;see below&#41;.</p>
<p>These seven simple commands will help you move more nimbly when editing text on the commands line. There is certainly plenty more you can do, which you can find <a href="http://www.gnu.org/software/bash/manual/bashref.html#Command-Line-Editing">in the bash manual</a>.</p>
<h2>A Word on Modes</h2>
<p>By default, the bash shell run in emacs mode. This means that emacs shortcuts are enabled by default.</p>
<p>Emacs mode uses a Meta key for some commands, and the Option key is a good choice. In Terminal on OS X, you&#8217;ll need to enable this by going to Preferences > Settings > Keyboard and checking &#8220;Use option as meta key.&#8221; </p>
<p>You can also tell bash you want to use vi mode for command line editing with <code>set -o vi</code>, if for some reason you want to type <code>i</code> before every <code>cd</code> or <code>ls</code> you write. </p>
<h2>End</h2>
<p>Nothing new or overwhelmingly exciting here, and there is certainly much more to dive into if you are so inclined. However, this small set of commands will have you covered for the majority of your day to day command line editing needs and is what I would consider constitutes a minimum level of proficiency.</p>
<p>Give your arrow keys a break!</p>
<p>The post <a href="http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/">Terminal: Beyond Ctrl + A and Ctrl + E</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/terminal-beyond-ctrl-e-and-ctrl-a/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using apc
Database Caching using apc
Object Caching 557/594 objects using apc

 Served from: pivotallabs.com @ 2013-06-19 23:26:15 by W3 Total Cache -->