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

  <title>Mentalbrew</title>
  <link href="http://www.mentalbrew.com/atom.xml" rel="self"/>
  <link href="http://www.mentalbrew.com/"/>
  <updated>2012-04-01T00:25:45+00:00</updated>
  <id>http://www.mentalbrew.com/</id>
  <author>
    <name>Mitch Guthrie</name>
    
  </author>

  
  <entry>
    <title>Nickle and Diming Myself</title>
    <link href="http://www.mentalbrew.com/blog/2012/03/31/nickle-and-diming-myself/"/>
    <updated>2012-03-31T17:11:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2012/03/31/nickle-and-diming-myself</id>
    <content type="html">&lt;p&gt;It wasn&amp;#8217;t that long ago that spending money on something tech was often a big ticket item. While today there are still many expensive things to purchase (tablets, smartphones, etc) I&amp;#8217;m finding that a decent chunk of my outgoing money is tied up in a bunch of little one-off purchases and subscriptions.&lt;/p&gt;

&lt;p&gt;While I have found value in those things I have decided this month to cancel them all and find out which ones actually are necessary and which aren&amp;#8217;t. I&amp;#8217;m also scaling back on the one-off purchases for a month like ebooks (which I buy often) and such.&lt;/p&gt;

&lt;h2&gt;Why?&lt;/h2&gt;

&lt;p&gt;The biggest reason why is that I want to focus on my spending habits that are impulse buys and which add up over the course of a month. Many of these things are completely worth the price paid for them but I end up not utilizing the item or reading the ebook until a much later date if at all. I simply get it because it&amp;#8217;s something I&amp;#8217;m interested in and it&amp;#8217;s cheap. What&amp;#8217;s $5 dollars here or there right?&lt;/p&gt;

&lt;p&gt;Another reason for the change in habits is simply this: without constant new items to keep my attention or distract me, I&amp;#8217;m hoping to see a more focused approach to that which I am working on now. Many times I feel I&amp;#8217;m running a mile-wide and and inch deep. Gaining perspective on what I should be doing and giving time to work on the things I want to do is a goal hindered by lack of focus.&lt;/p&gt;

&lt;h2&gt;From Here To There&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;m going to trial run this month and see how things go. See what&amp;#8217;s improved and test the idea that I&amp;#8217;m somehow missing out on something if I don&amp;#8217;t have these subscriptions or items. Hopefully, reducing peripheral clutter will illuminate those things around me that are really important.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>The Inflammatory Need Not Apply</title>
    <link href="http://www.mentalbrew.com/blog/2012/03/27/the-inflammatory-need-not-apply/"/>
    <updated>2012-03-27T21:01:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2012/03/27/the-inflammatory-need-not-apply</id>
    <content type="html">&lt;p&gt;Yesterday I posted an article on something that I think could be improved and/or make a good addition to the Linux distribution world. I however, went about it the wrong way and worded it in a manner that was nothing more than inflammatory.&lt;/p&gt;

&lt;p&gt;This, as you would expect, wasn&amp;#8217;t well received by some and rightly so. Sometimes it is easy to forget that real people work on open source projects and they have feelings. It&amp;#8217;s also easy to forget that open discussion on any topic should be voiced in a manner that invites discussion rather than shutting it down.&lt;/p&gt;

&lt;p&gt;Years ago I decided on some simple principles for how I would conduct myself online and I thought I would share them here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Don&amp;#8217;t be anonymous&lt;/strong&gt; - While I can respect a person&amp;#8217;s right to be anonymous I personally feel that having my real identity associated with my words and actions is necessary toward my improvement as a person and openness with others. It&amp;#8217;s easy to attack or deride others behind a veil of anonymity but becomes much harder when I can be just as easily scrutinized.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Don&amp;#8217;t Delete&lt;/strong&gt; - I&amp;#8217;ve made it a point to never delete or edit a post I&amp;#8217;ve made publicly. If I ever decide to edit something it would be for an addendum to my post and never to remove or conceal something I said. The few times I have removed something it was at the request of another person involved which to my remembrance has only happened twice and wasn&amp;#8217;t regarding a personal opinion of mine nor denigrating anyone. What this means is basically there will be stupid things I have said that I regret or would word differently but I&amp;#8217;m treating them as though they are spoken words which cannot be uncalled.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I have a new one after yesterday:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Be nice&lt;/strong&gt; - Basically, treat others how I would want to be treated and encourage rather than discourage.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hopefully, more thought will go into my future discussions and comments and more importantly, transparency as always.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Where Linux Needs to Change</title>
    <link href="http://www.mentalbrew.com/blog/2012/03/26/where-linux-needs-to-change/"/>
    <updated>2012-03-26T12:38:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2012/03/26/where-linux-needs-to-change</id>
    <content type="html">&lt;p&gt;I got started with Linux around 1996/1997-ish. At the time I was completely fascinated by the fact that there was something out there that wasn&amp;#8217;t Microsoft or Apple. I had been a Windows user my entire life and the idea that people would come together and provide a free operating system and related software greatly interested me.&lt;/p&gt;

&lt;p&gt;So, over the years I investigated Linux and not that long after switched to dual-booting Linux and Windows. I&amp;#8217;m still amazed that I was ever able to get things accomplished using Linux compared to where it was and what it provided when I started.&lt;/p&gt;

&lt;p&gt;It wasn&amp;#8217;t uncommon for me to switch distributions weekly to try out all there was in Linux. RedHat, SuSE, Slackware, Mandrake (Mandriva), and on and on. I became a master at backing up my home directory and re-installing an entire system within an hour.&lt;/p&gt;

&lt;p&gt;I remember distinctly doing web development freelance work on Slackware, using Gimp for my graphics needs on the newly minted Gnome 2.0 desktop environment that I compiled from source by hand.&lt;/p&gt;

&lt;p&gt;Eventually, I moved away from dual booting anything and simply used Linux as my one and only operating system.&lt;/p&gt;

&lt;p&gt;So what I&amp;#8217;m about to say is not coming from somebody who briefly used Linux and decided it&amp;#8217;s not ready for the desktop. I believe experience-wise, Linux distributions can provide a great user experience for the newcomer and superuser alike. My relationship with Linux goes back over 15 years. I have used some distribution of Linux for my main and only desktop for over 12 years and every server under my personal management is running Linux. I really like Linux.&lt;/p&gt;

&lt;h2&gt;Where Things Broke Down&lt;/h2&gt;

&lt;p&gt;Having discussed my history with Linux some may be surprised that my most recent purchase for a new laptop was nothing other than a MacBook Pro. Why? Whhhhhhyyyyyy?! (think of George from Seinfeld shaking his fists in the air).&lt;/p&gt;

&lt;p&gt;There are two primary reasons I switched to Mac for my development needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It was Linux/Unix -like. I can get most of the benefits of being on Linux and/or Unix that I&amp;#8217;ve come to love. Having a solid command line option with all of the Unix tools I&amp;#8217;m used to is a huge win for me.&lt;/li&gt;
&lt;li&gt;I can manage my development requirements to my liking. It is not dictated that my entire OS version decides what specific version of something I need to run.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Of these two points, I would like to address the second one and how I believe Linux would be better off if things changed.&lt;/p&gt;

&lt;h2&gt;Choices Are Essential&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;m a polyglot developer. I work in PHP, Ruby, and some Java. I also work with software that is considered legacy and therefore need to manage my requirements with that. So I will often run multiple versions of PHP and Ruby.&lt;/p&gt;

&lt;p&gt;Ruby has largely solved this issue with tools like RVM and RBENV. But the PHP issue remains and I don&amp;#8217;t understand how it&amp;#8217;s going to get any better.&lt;/p&gt;

&lt;p&gt;Basically, my &lt;strong&gt;whole point&lt;/strong&gt; here is that &lt;strong&gt;a version of a distribution, say Ubuntu 12.04, dictates a version freeze on every piece of software that is included in that distribution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This applies to everything, not just PHP, which I am using in this specific instance. Because of how EVERY major distribution is designed, they all share one common flaw: Whatever version of software I receive by using that distribution will stay the same FOR THE LIFE of that distribution and trying to get newer versions of that software will only create headache and heart pain for the user.&lt;/p&gt;

&lt;p&gt;You would literally need to wait for a newer version of YOUR ENTIRE OS, to be able to get an updated version of just one piece of software that is running on it.&lt;/p&gt;

&lt;p&gt;This is stupid. Just plain dumb. The work that distributions go through to backport bug fixes and security updates for every piece of software on their release is a waste of resources.&lt;/p&gt;

&lt;p&gt;There is no good reason why the OS needs to dictate what version of git, f-spot, LibreOffice, Tuxracer, or whatever I would like to run.&lt;/p&gt;

&lt;h2&gt;The Solution&lt;/h2&gt;

&lt;p&gt;I would love to see a distribution that did three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a stable platform w/ bug fixes and security updates for the critical pieces of the operating system.&lt;/li&gt;
&lt;li&gt;Provide a consistent framework for integration with third party apps and let the App owners take care of the rest.&lt;/li&gt;
&lt;li&gt;Universal binaries that work across all multiple versions of the OS within reason. The &lt;a href=&quot;http://icculus.org/fatelf/&quot;&gt;FatElf&lt;/a&gt; project looks like a great step in this direction but GPL issues may interfere with that.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It is ironic that the Unix mantra of &amp;#8220;Do one thing and do it well&amp;#8221; is completely ignored and the standard practice for current distributions is to provide the entire kitchen sink, take-it-or-leave-it approach for the entire OS stack. This is asinine and unecessary.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Project Launch and Lessons Learned</title>
    <link href="http://www.mentalbrew.com/blog/2012/02/13/project-launch-and-lessons-learned/"/>
    <updated>2012-02-13T09:04:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2012/02/13/project-launch-and-lessons-learned</id>
    <content type="html">&lt;p&gt;A little while ago I finished up a project developing a calling card website and store for my friend Evan Calkins at &lt;a href=&quot;http://hobancards.com&quot;&gt;Hoban Cards&lt;/a&gt;. The business creates hand-made calling cards on one of several vintage presses he has in his shop.&lt;/p&gt;

&lt;p&gt;This project turned out to be a great learning experience in several ways and the fact that I didn&amp;#8217;t have to design the site, but only work on development as Evan is a designer himself was really nice.&lt;/p&gt;

&lt;h2&gt;Deploy, Deploy, Deploy&lt;/h2&gt;

&lt;p&gt;The first thing I tackled when working on the application was to get it deployable right off the bat. Even if it was nothing but a  shell.&lt;/p&gt;

&lt;p&gt;We were going to be hosting this on a Rackspace virtual server which I manage myself. Getting everything set up in a quick and easily deployable form took more time upfront but payed off quite a bit in the long run.&lt;/p&gt;

&lt;p&gt;I was surprised at the benefits gained by simply having things easy to push out and be live. The largest noticible difference was that Evan and I could literally work side by side and quickly have our changes live as we iterated over the site. No messing with copying files, making sure permissions worked, database migrations, etc. Either of us could deploy at any given moment and rollback if things messed up. That opened things up for us to work on what was important at the time and not having to wait on each other to finish.&lt;/p&gt;

&lt;p&gt;We found quite a few bugs earlier that only would have cropped up in production. Building our deployment meant we found these issues right away and could deal with them in the context of the release rather than as one big ball of ugly to fight with at the end of the project when things are really tight.&lt;/p&gt;

&lt;h2&gt;Use Pre-Existing Tools, Replace Later&lt;/h2&gt;

&lt;p&gt;One item I found to be very helpful was to utilize Twitter Bootstrap for both the frontend and backend UI. This allowed me to focus on the code and how things worked rather than dwell on where to put things and why they didn&amp;#8217;t do what I want.&lt;/p&gt;

&lt;p&gt;Once we were far enough along Evan was able to slice up his design and completely replace the frontend easily. Since bootstrap worked so well, and there was no driving reason to replace it we decided to leave it for the backend.&lt;/p&gt;

&lt;h2&gt;Git And Friends&lt;/h2&gt;

&lt;p&gt;The project would have definitely died without Git &lt;a href=&quot;http://git-scm.com/&quot;&gt;http://git-scm.com/&lt;/a&gt;. It allowed us to work separately on the application without stepping on each others toes. Should something come up that we both had worked on, merging took care of the differences and life was good.&lt;/p&gt;

&lt;p&gt;Since this was a non-opensource project we hosted it privately using Gitolite &lt;a href=&quot;https://github.com/sitaramc/gitolite&quot;&gt;https://github.com/sitaramc/gitolite&lt;/a&gt;. If you don&amp;#8217;t have the desire to store all your private code in Github, hosting your own is relatively easy and the fined grain permissions make Gitolite a great asset in your toolbox.&lt;/p&gt;

&lt;h2&gt;Stripe and Paypal&lt;/h2&gt;

&lt;p&gt;The previous incarnation of Hoban Cards was a simple site with Paypal. While Paypal has served Evan well he despised the backend and having many international customers there was some concern about his options if Paypal decided to contest something.&lt;/p&gt;

&lt;p&gt;So we decided to integrate both Stripe payment processing and Paypal, giving the customers the choice.&lt;/p&gt;

&lt;p&gt;Since launching we&amp;#8217;ve been pleasantly surprised that most customers chose the custom card processing and those that chose Paypal replied they only did it because it was easier than getting their credit card out. Most expressed that they did not care one way or the other.&lt;/p&gt;

&lt;p&gt;Moving forward, Evan may choose to remove the Paypal option altogether.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This was not a big site or application by any means, which actually turned out great for developing a process of constant iteration. At the end of the day, the project was fun for both of us to work on, customers got a great purchasing experience, and Evan got a backend to manage orders and keep things organized.&lt;/p&gt;

&lt;h3&gt;Tools&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rails 3.2&lt;/li&gt;
&lt;li&gt;Postgresql&lt;/li&gt;
&lt;li&gt;Twitter Bootstrap&lt;/li&gt;
&lt;li&gt;Stripe&lt;/li&gt;
&lt;li&gt;Paypal&lt;/li&gt;
&lt;li&gt;RapidSSL&lt;/li&gt;
&lt;li&gt;Ubuntu&lt;/li&gt;
&lt;li&gt;Rackspace Cloud Server&lt;/li&gt;
&lt;li&gt;Capistrano&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  
  <entry>
    <title>Web Development Is Not for Beginners</title>
    <link href="http://www.mentalbrew.com/blog/2011/12/14/web-development-is-not-for-beginners/"/>
    <updated>2011-12-14T22:09:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/12/14/web-development-is-not-for-beginners</id>
    <content type="html">&lt;p&gt;This article will mainly be in response to another blog post I came across awhile ago here: &lt;a href=&quot;http://www.horsesaysinternet.com/code/rails-is-not-for-beginners/&quot;&gt;Rails is not for Beginners&lt;/a&gt;; but is related to a larger topic I&amp;#8217;ve wanted to write about.&lt;/p&gt;

&lt;p&gt;The crux of the blog post was mainly that the overhead and complexities of Rails is so great that it&amp;#8217;s making it harder for beginners to get started in web development.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m not going to disagree about it being hard for a beginner to learn rails but I think the underlying issue is not the framework but the entire industry.&lt;/p&gt;

&lt;p&gt;When I started as a web developer (called webmaster at the time) things were pretty simple. If you had HTML3.2, a basic understanding of images and linking, and could figure out how to upload your files you were doing pretty well.&lt;/p&gt;

&lt;p&gt;Over the years the entire industry has matured and started building more and more on those technologies to deliver more complex sites. My main point is that we are not developing the same websites we did 10 years ago and therefore what we now call web development is not for beginners.&lt;/p&gt;

&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;p&gt;When I look at the staggering amount of technologies a person needs to know just to start out in web development it&amp;#8217;s incredibly tiring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML5&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;Javascript or at least jQuery&lt;/li&gt;
&lt;li&gt;HTTP Protocol (get, post, redirects, status codes, etc)&lt;/li&gt;
&lt;li&gt;Web servers (apache, nginx, or whatever for development)&lt;/li&gt;
&lt;li&gt;Git/Mercurial (if you&amp;#8217;re doing it right)&lt;/li&gt;
&lt;li&gt;Browser quirks&lt;/li&gt;
&lt;li&gt;Code editor (can&amp;#8217;t get much done without one)&lt;/li&gt;
&lt;li&gt;SSH/FTP&lt;/li&gt;
&lt;li&gt;Server side language (php, perl, ruby, python, java, etc)&lt;/li&gt;
&lt;li&gt;Frameworks (rails, zend, codeigniter, catalyst, etc)&lt;/li&gt;
&lt;li&gt;CMS/Blogging (drupal, wordpress, refinery, typo3, etc)&lt;/li&gt;
&lt;li&gt;Databases (MySQL, Postgres, sqlite, etc)&lt;/li&gt;
&lt;li&gt;DB Theory (normalization, queries, etc)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is just to get started if you want to be able to provide services to clients. Once you&amp;#8217;ve picked your stack then you get the joy of maintaining knowledge of a moving target.&lt;/p&gt;

&lt;p&gt;I haven&amp;#8217;t even touched on what the ever growing mobile market is doing to web design/development and things that need to be considered for being accessible to everyone.&lt;/p&gt;

&lt;h2&gt;Tools&lt;/h2&gt;

&lt;p&gt;The article mentioned also touched on the size difference in the codebases regarding Rails vs Sinatra. Ignoring the apples vs oranges issue, the main thing that jumped out at me was the fact that while Sinatra might be a lighter, easier framework to learn, when you need it to do something beyond simple functions you&amp;#8217;re going to need to write it yourself. That&amp;#8217;s not so much a problem unless of course you&amp;#8217;re a beginner and wouldn&amp;#8217;t know where to start.&lt;/p&gt;

&lt;p&gt;At least with Rails there&amp;#8217;s a very good chance a solution exists out there that you can use without really have to get your hands dirty.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m not attempting to put down Sinatra as I think it is a great framework and has a strong place in a web developer&amp;#8217;s arsenal, but things need to be weighed with what a person can develop with it if they have a beginner&amp;#8217;s understanding of things.&lt;/p&gt;

&lt;p&gt;At the end of the day, all of these things are tools and skill can only really be forged from experience and practice.&lt;/p&gt;

&lt;h2&gt;Keep on&lt;/h2&gt;

&lt;p&gt;Learning things is hard. I&amp;#8217;m not writing this to discourage a person from being a web developer. But like developing any skill, you start small and build from there. Where I disagree with the author is that the point of difficulty for web development doesn&amp;#8217;t fall in the design of a specific framework but even lower in the technologies that framework is built upon.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Fear of Failure</title>
    <link href="http://www.mentalbrew.com/blog/2011/10/31/fear-of-failure/"/>
    <updated>2011-10-31T21:04:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/10/31/fear-of-failure</id>
    <content type="html">&lt;p&gt;As any good developer I&amp;#8217;m constantly working on my craft to become better and more efficient. I study what others are doing, I subscribe to newsletters, screencasts, and any other information on web development that will inspire me to up my skills and stay motivated.&lt;/p&gt;

&lt;p&gt;As such, I&amp;#8217;ve found that even code I wrote just a few short months ago now seems stupid and embarassing to me. This wouldn&amp;#8217;t be such a big deal if this same issue didn&amp;#8217;t effect another aspect of my development: code sharing and publishing.&lt;/p&gt;

&lt;p&gt;Basically, since I know that I&amp;#8217;m probably not doing something the best way it can be done or in a manner that is deemed &amp;#8220;proper&amp;#8221; I fear putting my code out there for all to see. Risking that somebody who knows far more than me will call me on my amatuerish attempt at programming. In short I fear looking stupid.&lt;/p&gt;

&lt;p&gt;This thinking serves no good purpose since the times that I have grown the most in any practice of discipline in my life was when I had the ability to learn from others and accept critique on my most recent work. Sharing my work and learning from others is a very critical step in the development of any skill.&lt;/p&gt;

&lt;h2&gt;What Can Be Done?&lt;/h2&gt;

&lt;p&gt;I was inspired to write this by a recent article I read from a developer who is well respected in the Ruby community. Basically he stated how his development process goes including the mistakes he makes and the bad decisions he made in the past. He even detailed how he didn&amp;#8217;t follow exact procedures that the are considered &amp;#8220;blessed&amp;#8221; by the established leaders.&lt;/p&gt;

&lt;p&gt;Fear is a powerful force. The worst type of fear is not that which is external but that which is internal. Your own fear is hard to defeat and can leave you paralyzed. Here are a few of the fears I face specifically in development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unknown - Sometimes I procrastinate on doing something because I&amp;#8217;ve never done it before. It&amp;#8217;s something totally new to me and perhaps I don&amp;#8217;t even know where to start. There times when I can have several solutions to a single problem and fear selecting the wrong one even after a great deal of thought.&lt;/li&gt;
&lt;li&gt;Monumental - There have been times I&amp;#8217;ve literally been frozen in front of my screen trying to get started but I have no idea where to start due to the complexity and scope of the project. Breaking tasks down into small pieces and timeboxing myself usually gets me going in the right direction.&lt;/li&gt;
&lt;li&gt;Criticism - I fear posting something I&amp;#8217;ve worked on due to the possibility that I may be denigrated for doing it wrong or poorly. I will never know however how well I&amp;#8217;m doing until others can oversee and give me feedback.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;These are just a few of the things that hold me back. I&amp;#8217;m sure you have plenty of your own.&lt;/p&gt;

&lt;h2&gt;The Solution&lt;/h2&gt;

&lt;p&gt;There are several keys I&amp;#8217;ve found to overcoming these obsticles and getting over yourself to get things done.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Surround yourself with good people. A good person wants to see you succeed and will do what they can to encourage you. Be that person for somebody else as well. The learning goes both ways.&lt;/li&gt;
&lt;li&gt;Surround yourself with difficult people. Putting yourself in a situation where you need to keep your game up is also very motivating if you have the right attitude for it.&lt;/li&gt;
&lt;li&gt;Metrics, metrics, metrics. Set goals for yourself that you can measure and constantly check to make sure you&amp;#8217;re meeting those goals. Keep records so you can be reminded of how far you have come. Re-visit old code and see what mistakes you made then that are obvious to you now.&lt;/li&gt;
&lt;li&gt;Observe others. See how they work. What tools do they use? What philisophy do they follow?&lt;/li&gt;
&lt;li&gt;Get it out the door. If you have a project that you are waiting on to be &amp;#8220;just right&amp;#8221; before releasing it to the world, stop, and push it out the door. Chances are nobody is going to care about your project at all let alone run through it with a fine toothed comb.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Fear of failure or rejection needs to be conquered. It&amp;#8217;s dead weight that will hold you back from pursuing your dreams. Anything that gets in the way of progress needs to be dealt with. I&amp;#8217;m actively working on dealing with those fears. If you recognize any of these traits in you then I would encourage you to sit down and make a plan to overcome them. Find what motivates you and move forward.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Using Rbenv to Manage Your Ruby Installs</title>
    <link href="http://www.mentalbrew.com/blog/2011/10/24/using-rbenv-to-manage-your-ruby-installs/"/>
    <updated>2011-10-24T20:26:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/10/24/using-rbenv-to-manage-your-ruby-installs</id>
    <content type="html">&lt;p&gt;I&amp;#8217;ve used RVM for quite awhile to manage my Ruby installations both on my development machines and my servers. Early on using RVM for production machines was pretty difficult, but support for everything I needed soon followed and life was good.&lt;/p&gt;

&lt;p&gt;Recently, RVM has been challenged by a newcomer in the Ruby community called &lt;a href=&quot;https://github.com/sstephenson/rbenv&quot;&gt;rbenv&lt;/a&gt; created by 37signals&amp;#8217; Sam Stephenson.&lt;/p&gt;

&lt;h2&gt;The Conflict&lt;/h2&gt;

&lt;p&gt;The introduction to rbenv was not without some controversy as the new project appeared to be derogative toward the work that Wayne Seguin had put into RVM. This naturally rubbed people the wrong way and led to some spirited debate regarding which product was better.&lt;/p&gt;

&lt;p&gt;I really didn&amp;#8217;t care at the time which was technically better as RVM simply worked for me. I never ran into the issues opponents of RVM stated regarding the overwriting of &lt;code&gt;cd&lt;/code&gt; or the &lt;code&gt;gem&lt;/code&gt; commands and such. My work never introduced me to any of these issues and the main feeling I get was that very few people did have actual issues, but those who simply did not like RVM were quick to use these things as another excuse to bash RVM.&lt;/p&gt;

&lt;p&gt;One thing has led me to try rbenv over RVM and that was overhead. RVM introduces more complexity throughout your environment that has to be planned and accounted for when using the solution on your development machine as well as for production use. rbenv is simply a little closer to the metal and provides a similar workflow as RVM.&lt;/p&gt;

&lt;p&gt;I would encourage a person to try both and see which they like most and why. Following is my installation and workflow that I use with my new rbenv install.&lt;/p&gt;

&lt;h2&gt;The Players&lt;/h2&gt;

&lt;p&gt;In typical Unix/Linux tradition rbenv is a single function utility that is best used when combined with other utilities. In my setup I will use the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sstephenson/rbenv&quot;&gt;rbenv&lt;/a&gt; - This provides the ability to switch between installed ruby versions by using &amp;#8220;shims&amp;#8221; in your environment path.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sstephenson/ruby-build&quot;&gt;ruby-build&lt;/a&gt; - This utility actually downloads and installs the different ruby platforms as &amp;#8220;definitions&amp;#8221;. You can download and compile the ruby installs by hand that rbenv can then use but this simply makes it easier.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Setup&lt;/h2&gt;

&lt;p&gt;The first step is to clone the rbenv project into your home directory under &lt;code&gt;~/.rbenv&lt;/code&gt; like so:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git clone https://github.com/sstephenson/rbenv ~/.rbenv
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;All of your ruby installs will then be stored in &lt;code&gt;~/.rbenv/versions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next step is to add the rbenv path to your shell environment. In bash this would be either &lt;code&gt;.bashrc&lt;/code&gt;, &lt;code&gt;.bash_profile&lt;/code&gt;, or even &lt;code&gt;.profile&lt;/code&gt;. If you are using Zsh you can place it in &lt;code&gt;.zshrc&lt;/code&gt; or &lt;code&gt;.zshenv&lt;/code&gt;.&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;$HOME/.rbenv/bin:$PATH&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;nb&quot;&gt;eval&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;$(rbenv init -)&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;You can now start a new shell or run &lt;code&gt;exec $SHELL&lt;/code&gt; to use the new configuration.&lt;/p&gt;

&lt;p&gt;This alone will give you the ability to switch between multiple ruby installs but &lt;code&gt;ruby-build&lt;/code&gt; provides a nice, easy way to install these so you don&amp;#8217;t have to do it by hand. To install ruby-build you first need to clone the git repo:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;https://github.com/sstephenson/ruby-build
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now change into the &lt;code&gt;ruby-build&lt;/code&gt; directory and run:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ruby-build/
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;./install.sh
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;If &lt;code&gt;./install.sh&lt;/code&gt; doesn&amp;#8217;t work you may need to run it with super user priviledges like so: &lt;code&gt;sudo ./install.sh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now you should have everything you need to manage multiple ruby installations.&lt;/p&gt;

&lt;h2&gt;Workflow&lt;/h2&gt;

&lt;p&gt;The first step is to install a ruby version of your choice. This is very easy with ruby-build:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;ruby-build 1.9.2-p290 ~/.rbenv/versions/1.9.2-p290
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;That is kind of more work that I like to do and ruby-build makes it easier by adding to rbenv for easy local installation:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rbenv install 1.9.2-p290
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;The previous command takes care of where to install your ruby versions which is one less thing you need to remember.&lt;/p&gt;

&lt;p&gt;Once I have a ruby version install I like to set one to be my global ruby interpreter for my shell sessions like so:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rbenv global 1.9.2-p290
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now you can test to make sure you have the correct ruby version by typing:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;ruby -v
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;h2&gt;The Rehash Annoyance&lt;/h2&gt;

&lt;p&gt;One very annoying issue with rbenv is the fact that it needs to be told to rehash its shims after you install a new ruby version or any gem install that provides a binary. There is a solution in the works but until that is ready if you find yourself wondering why a command isn&amp;#8217;t working when you just &amp;#8220;gem installed&amp;#8221; it, try running:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rbenv rehash
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;h2&gt;Per Project Ruby&lt;/h2&gt;

&lt;p&gt;If you have a project that needs to be configured to use a specific ruby version you can change to the project directory and type:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rbenv &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;1.9.2-p290
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;This will drop a &lt;code&gt;.rbenv-version&lt;/code&gt; file in that folder specifying the ruby you want. Anytime rbenv comes across a .rbenv-version file it will default to using that specified ruby version.&lt;/p&gt;

&lt;h2&gt;System Ruby&lt;/h2&gt;

&lt;p&gt;If you need to have access to the default system ruby for example to compile the Command-T extension for Vim you can simply type:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rbenv shell system
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;This command will tell your current shell that you want the system ruby version available. This will not effect other shells you have open or any new shells you create.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;rbenv has a very low overhead for everyday use and follows the Unix/Linux tradition of doing one thing and doing it well. I purposefully didn&amp;#8217;t touch on having gemsets as I&amp;#8217;ve found with most of my projects using bundler I had no issues. If you need to have something comparable to RVM gemsets you can use the rbenv plugin created by Jamis Buck called &lt;a href=&quot;https://github.com/jamis/rbenv-gemset&quot;&gt;rbenv-gemsets&lt;/a&gt;. It currently has issues on Zsh though to be aware if you&amp;#8217;re using that for your shell.&lt;/p&gt;

&lt;p&gt;All-in-all rbenv is a solid replacement for RVM. Aside from having to rehash the shims which should hopefully be resolved soon I currently find using rbenv a good experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; - I forgot to mention and was reminded in the comments that RVM and rbenv are NOT compatible and you will need to uninstall RVM before moving forward. It&amp;#8217;s a really easy process. Simply type:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rvm implode
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;This will remove RVM from your system. You will still need to go through your .bashrc/.bash_profile configs and remove any RVM information there.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>A Simple Git Workflow</title>
    <link href="http://www.mentalbrew.com/blog/2011/10/11/a-simple-git-workflow/"/>
    <updated>2011-10-11T10:00:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/10/11/a-simple-git-workflow</id>
    <content type="html">&lt;p&gt;In my &lt;a href=&quot;http://www.mentalbrew.com/blog/2011/10/04/hosting-your-own-git-repositories/&quot;&gt;previous post&lt;/a&gt; on git I covered the basics of how to host your own repositories for items you wish to not have on Github or that you simply do not want to have to pay for private repositories.&lt;/p&gt;

&lt;p&gt;Today I will go over a very basic and simple Git workflow that easily works for small teams and is simple to keep track of in your head.&lt;/p&gt;

&lt;h2&gt;Basics&lt;/h2&gt;

&lt;p&gt;I like to keep my &lt;code&gt;master&lt;/code&gt; branch production ready at any given moment. There are several reasons for this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Many third party tools don&amp;#8217;t need to be configured to work with the master branch as it&amp;#8217;s almost always the default.&lt;/li&gt;
&lt;li&gt;When somebody clones your repo the master branch is usually the default that they start with. Having &lt;code&gt;master&lt;/code&gt; be the stable production branch is easier on them.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So, once we decide we want our &lt;code&gt;master&lt;/code&gt; branch to be the production ready branch we then must move onto how we will develop our workflow.&lt;/p&gt;

&lt;h2&gt;Development&lt;/h2&gt;

&lt;p&gt;I normally start with a &lt;code&gt;development&lt;/code&gt; branch when starting out and I don&amp;#8217;t have anybody else working on the project for the moment.&lt;/p&gt;

&lt;p&gt;When working in &lt;code&gt;development&lt;/code&gt; I don&amp;#8217;t concern myself with whether or not things are in a working state. The goal is to make sure any changes we are making live on the server and we don&amp;#8217;t have a long time passing where changes are just sitting on the local development machine.&lt;/p&gt;

&lt;p&gt;Since I am assuming the product is very young and nobody is currently working on it I initially use &lt;code&gt;development&lt;/code&gt; to flesh out the workings of the application. Once things are good I then will get things passing and merge into &lt;code&gt;master&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Getting The Ball Rolling&lt;/h2&gt;

&lt;p&gt;Now that we have a stable &lt;code&gt;master&lt;/code&gt; branch and a &lt;code&gt;development&lt;/code&gt; branch for ourselves this is where you can start implementing a team approach to working on the app.&lt;/p&gt;

&lt;p&gt;Team members are encouraged to use a topic branch both locally on their machine and tracking on the server to make sure work is being backed up regularly. When their topic branch is done then they should merge into &lt;code&gt;development&lt;/code&gt;. If everything in &lt;code&gt;development&lt;/code&gt; looks good you can then merge into &lt;code&gt;master&lt;/code&gt; and deploy immediately.&lt;/p&gt;

&lt;p&gt;Deploying immediately is very important as you don&amp;#8217;t want code sitting in &lt;code&gt;master&lt;/code&gt; that isn&amp;#8217;t being exercised in production. Only running in production will you know that the code works.&lt;/p&gt;

&lt;h2&gt;Assumptions&lt;/h2&gt;

&lt;p&gt;You may wonder why you don&amp;#8217;t just make sure your topic branch is good and merge directly into &lt;code&gt;master&lt;/code&gt;. This is totally fine if that&amp;#8217;s how you want to manage things. With Git there is no &amp;#8216;one way&amp;#8217; to do things.&lt;/p&gt;

&lt;p&gt;I like having a &lt;code&gt;development&lt;/code&gt; branch so things can be reviewed before being deployed. If you have people on your team who are not comfortable with deployment it&amp;#8217;s good to have a process where you can oversee what&amp;#8217;s going on in the system.&lt;/p&gt;

&lt;h2&gt;Walkthrough&lt;/h2&gt;

&lt;p&gt;So, assuming we have a local repo that is tracking a server repo with just a &lt;code&gt;master&lt;/code&gt; branch we can create our &lt;code&gt;development&lt;/code&gt; branch like so:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git checkout -b development
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Then push that branch to the server and track it:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git push -u origin development
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;You can also create your topic branches the same way:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git push -u origin topic_branch
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Eventually you&amp;#8217;ll be all done with your topic branches you can simply remove them by typing:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git push origin :topic_branch
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This isn&amp;#8217;t the only right way to manage your development workflow. This isn&amp;#8217;t a wrong way either. Pick and choose what will work best for your team and discuss it with them. You may find some things work great for your team and others fail miserably. The beauty of Git is it lets you choose. It also gives you enough rope to hang yourself.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Using the Pomodoro Technique for Development</title>
    <link href="http://www.mentalbrew.com/blog/2011/10/07/using-the-pomodoro-technique-for-development/"/>
    <updated>2011-10-07T10:10:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/10/07/using-the-pomodoro-technique-for-development</id>
    <content type="html">&lt;p&gt;The deadline is looming, the project you&amp;#8217;re working on is very complex, things are broken, and you have more features to implement. If you&amp;#8217;re like me this kind of stress paralyzes your brain. You just stare at your screen willing some magical force to push your programming into action but the more you try to focus the more scattered things become.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s like trying to go to sleep because it&amp;#8217;s late and you have to get up in the morning but you spend your time counting how many hours of sleep you&amp;#8217;ll get if you could just fall asleep &amp;#8220;right now&amp;#8221;.&lt;/p&gt;

&lt;p&gt;If this scenario or something like it has played out for you before I would like to introduce you to a system that has helped me get things back under control and structured.&lt;/p&gt;

&lt;h2&gt;The Pomodoro Technique&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://www.pomodorotechnique.com/&quot;&gt;The Pomodoro Technique&lt;/a&gt; is a timeboxing practice where you list out all of the things you need to get done and priortize them not quite unlike the &amp;#8220;Getting Things Done&amp;#8221; system. The main difference here is that once you&amp;#8217;re done making a list of items to be addressed you pick out all of the ones you think you can accomplish just for today.&lt;/p&gt;

&lt;p&gt;Once you have your &amp;#8220;Today&amp;#8221; list done you then choose the most important of those items and prepare for a pomodoro.&lt;/p&gt;

&lt;p&gt;A pomodoro is a unit of time which is usually 25 minutes for which you focus completely and solely on the task at hand. No interruptions, no email, phone, or even co-workers bothering you.&lt;/p&gt;

&lt;p&gt;The goal is to get through the entire 25 minutes focused completely at what you need to do.&lt;/p&gt;

&lt;p&gt;When the pomodoro is up you take a 5 minute break and spend time doing something unrelated to your main task. Get some water, go to bathroom, or whatever. Once your 5 minutes is up you start the timer again for another 25 minute time block.&lt;/p&gt;

&lt;h2&gt;How Does This Help?&lt;/h2&gt;

&lt;p&gt;Time is the thing in this life we cannot control. Everybody is alotted the same amount. By timeboxing your current activity your mind is allowed to train itself for sustained focus on a particular task.&lt;/p&gt;

&lt;p&gt;Once you&amp;#8217;ve started doing a few pomodori (plural) you&amp;#8217;ll see the difference in how quickly your mind can get back on task.&lt;/p&gt;

&lt;p&gt;Knowing that you only have to concern yourself with the next 25 minutes also relieves the subconscience of those nagging tasks that would normally occupy your mind and keep you distracted.&lt;/p&gt;

&lt;h2&gt;How To Get Started&lt;/h2&gt;

&lt;p&gt;All you really need to have to get started is simply paper for making a list and a timer of some sort. Kitchen timers work well but there are also timers you can get for Windows, Mac, and Linux which can help you keep track of finished Pomodori as well as set your chat applications to &amp;#8220;Away&amp;#8221;.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Do I use the pomodoro technique everyday? Nope. Although I really like it and find it very valuable I only turn to it when I&amp;#8217;m having a hard time focusing or are very stressed about the mountain of work ahead of me and need to get things back on track.&lt;/p&gt;

&lt;p&gt;At the end of the day it&amp;#8217;s a tool to help you do better.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Hosting Your Own Git Repositories</title>
    <link href="http://www.mentalbrew.com/blog/2011/10/04/hosting-your-own-git-repositories/"/>
    <updated>2011-10-04T00:00:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/10/04/hosting-your-own-git-repositories</id>
    <content type="html">&lt;p&gt;Coming from a background as a Linux administrator I manage my own development server. It&amp;#8217;s a VPS that I pretty much store my development life on. Getting started setting up a remote git repository over ssh is not as straight forward as it is in mercurial or even svn. This is my technique for managing my own private repositories.&lt;/p&gt;

&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Linux/Unix - Whatever flavor you choose.&lt;/li&gt;
&lt;li&gt;Git - Installed on both the server and locally&lt;/li&gt;
&lt;li&gt;SSH - You will need to have this installed and configured&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;On The Server&lt;/h2&gt;

&lt;p&gt;It&amp;#8217;s best to decide where you want to store your git repos. I like using /srv/git for everything I do but you can pretty much place it anywhere you want. Even your home directory if you only need it just for yourself.&lt;/p&gt;

&lt;p&gt;In this directory you&amp;#8217;ll want to create a bare git repo with this command:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;mkdir reponame.git
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;reponame.git
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;git init &#8211;bare
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;That&amp;#8217;s pretty much all there is to it on the server end of things. Using git over ssh is super simple.&lt;/p&gt;

&lt;h2&gt;On Your Local Machine&lt;/h2&gt;

&lt;p&gt;On your local machine you will need to create a git repo &lt;strong&gt;and have at least one commit into it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you wondering why you couldn&amp;#8217;t just clone your git repo from the server and start there, git won&amp;#8217;t allow it as technically there is nothing in your server git folder yet.&lt;/p&gt;

&lt;p&gt;If you have a repo on your local machine that has at least one changeset then you can add your server as the remote origin like so:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git remote add origin user@yourserver.com:/srv/git/reponame.git
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Once that is done you can then push your local master to the server and you&amp;#8217;re good to go:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;git push -u origin master
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;The &lt;code&gt;-u&lt;/code&gt; turns on tracking for that branch so git will notify you if you need to push back to the server after changes.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It&amp;#8217;s pretty simple once you know that steps but if you&amp;#8217;ve come from an Subversion or Mercurial background it doesn&amp;#8217;t make much sense at first.&lt;/p&gt;

&lt;p&gt;If you are running &lt;a href=&quot;http://www.redmine.org&quot;&gt;Redmine&lt;/a&gt; on the same local machine you can easily add your server git path to a project and browse your changesets through Redmine.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Rails 3.1, RSpec, And Cucumber Setup</title>
    <link href="http://www.mentalbrew.com/blog/2011/10/02/rails31-rspec-cucumber-setup/"/>
    <updated>2011-10-02T22:07:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/10/02/rails31-rspec-cucumber-setup</id>
    <content type="html">&lt;p&gt;Getting a Rails project setup and running can sometimes be a tedious chore as well as different for almost every developer out there. This article will detail my most current setup of Rails for new projects. I, like many developers out there, try different things from time to time, so how I&amp;#8217;m configuring Rails now will most likely be different not long down the road.&lt;/p&gt;

&lt;h2&gt;Tools&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://beginrescueend.com&quot;&gt;RVM&lt;/a&gt; - I use RVM for development. You can use whatever you like for managing your ruby installs but I&amp;#8217;ve never had a great deal of trouble with RVM and I&amp;#8217;m not remarkably impressed with the new kid on the block &lt;a href=&quot;https://github.com/sstephenson/rbenv&quot;&gt;rbenv&lt;/a&gt; and &lt;a href=&quot;https://github.com/sstephenson/ruby-build&quot;&gt;ruby-build&lt;/a&gt;. Perhaps someday I will change.&lt;/li&gt;
&lt;li&gt;Ruby 1.9.2 - Every new project I do is on Ruby 1.9.2.&lt;/li&gt;
&lt;li&gt;Linux/Unix - I use Linux at home and Mac OS X at the office. Either of these will do fine. You can probably do this for Windows but I haven&amp;#8217;t tried.&lt;/li&gt;
&lt;li&gt;Rails 3.1 - I&amp;#8217;m starting with the latest and greatest at the time of this writing.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Getting Started&lt;/h2&gt;

&lt;p&gt;Using rvm, create a gemset for your new awesome project:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rvm use 1.9.2@awesomeproj &#8211;create
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Then, while in your newly created gemset:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;gem install rails &#8211;no-ri &#8211;no-rdoc
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;The &lt;code&gt;&#8211;no-ri&lt;/code&gt; and &lt;code&gt;&#8211;no-rdoc&lt;/code&gt; prevents installation of documentation which can take a long time.&lt;/p&gt;

&lt;p&gt;Once Rails is installed successfully you can then create your new project:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;rails new awesomeproj &#8211;skip-test-unit &#8211;skip-bundle
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;I skip the test-unit stuff because I immediately install rspec and cucumber. Skipping bundler will make things faster since I&amp;#8217;m going to be changing my Gemfile anyways.&lt;/p&gt;

&lt;h2&gt;Configuration&lt;/h2&gt;

&lt;p&gt;My next step is to create a &lt;code&gt;.rvmrc&lt;/code&gt; file so RVM will know when we jump into the project directory what gemset and ruby version we would like to use. In the project directory run:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rvm use 1.9.2@awesomeproj&amp;#39;&lt;/span&gt; &amp;gt;&amp;gt; .rvmrc
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Then &lt;code&gt;cd ..&lt;/code&gt; and go back into the project and RVM will ask if you want to accept this .rvmrc file. Say yes and your good to go. On some systems this may be accepted by default.&lt;/p&gt;

&lt;h2&gt;Gemfile&lt;/h2&gt;

&lt;p&gt;Open your Gemfile and add this:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;Gemfile&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;3&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;4&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;5&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;6&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;7&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;ruby&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;therubyracer&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;n&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:test&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:development&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rspec-rails&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cucumber-rails&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;spork&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;~&amp;gt; 0.9.0.rc&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;database_cleaner&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;What did this do? Your Gemfile is where you specify what external gems you would like to use in your Rails app. I&amp;#8217;ve add the gem &lt;code&gt;therubyracer&lt;/code&gt; so the coffeescript processor will work. There are several options available but this works on Linux and Mac. With the &lt;code&gt;group&lt;/code&gt; block I&amp;#8217;m saying that I want these particular gems to be available both when in &lt;code&gt;test&lt;/code&gt; and &lt;code&gt;development&lt;/code&gt; modes. Why not just &lt;code&gt;test&lt;/code&gt;? Well, we need these gems to be available for &lt;code&gt;:development&lt;/code&gt; so we can use their generators and other behaviors.&lt;/p&gt;

&lt;p&gt;Once these are installed go ahead and run&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle install
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Once that&amp;#8217;s completed we can then move on to configure RSpec and Cucumber.&lt;/p&gt;

&lt;h2&gt;RSpec&lt;/h2&gt;

&lt;p&gt;To install RSpec run:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;rails g rspec:install
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;From here on out every project command we need to run other than bundler itself needs to be run through the &lt;code&gt;bundle exec&lt;/code&gt; command. This will insure our project only loads the gems we&amp;#8217;ve specified in the &lt;code&gt;Gemfile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What the &lt;code&gt;rspec:install&lt;/code&gt; command basically does is generate everything needed to start using RSpec for your testing. If you now run:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;rspec spec/
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;You should see the following letting you know that RSpec is at least configured correctly:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;3&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;4&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;No examples found.
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;Finished in 0.00004 seconds
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;0 examples, 0 failures
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;h2&gt;RSpec and Spork&lt;/h2&gt;

&lt;p&gt;As you start the BDD/TDD process one of the things you&amp;#8217;ll notice right away is the amount of time it takes to run your tests after each change. Since you should be alternating very often between tests and code it can be very draining and counterproductive to have the test load time take several seconds per run. Almost all of the overhead lies with loading Rails. Using &lt;code&gt;spork&lt;/code&gt; you can load Rails once and keep it running, then only run your tests when needed which is a lot faster. To configure RSpec to use spork you&amp;#8217;ll need to run the following:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;spork &#8211;bootstrap
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now, open your &lt;code&gt;spec/spec_helper.rb&lt;/code&gt; file and remove the &lt;code&gt;require &#8216;rubygems&#8217;&lt;/code&gt; line since we are using bundler.&lt;/p&gt;

&lt;p&gt;The next thing you&amp;#8217;ll want to do is find the following block and copy everything &lt;strong&gt;after&lt;/strong&gt; it.&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;spec_helper.rb&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;ruby&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;no&quot;&gt;Spork&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each_run&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;c1&quot;&gt;#&#8230;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Then paste the contents of that into the Spork block at the top of the file:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;spec_helper.rb&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;ruby&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;no&quot;&gt;Spork&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;prefork&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;c1&quot;&gt;#&#8230;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;My &lt;code&gt;spec_helper.rb&lt;/code&gt; looks like this (with many comments removed):&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;spec_helper.rb&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;2&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;3&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;4&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;5&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;6&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;7&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;8&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;9&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;10&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;11&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;12&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;13&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;14&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;15&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;16&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;17&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;18&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;19&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;20&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;21&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;22&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;23&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;24&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;25&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;26&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;27&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;28&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;29&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;30&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;31&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;32&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;33&lt;/span&gt;
&lt;span class=&#8217;line-number&#8217;&gt;34&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;ruby&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;spork&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;no&quot;&gt;Spork&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;prefork&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;c1&quot;&gt;# This file is copied to spec/ when you run &amp;#39;rails generate rspec:install&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;RAILS_ENV&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;test&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;../../config/environment&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rspec/rails&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;c1&quot;&gt;# Requires supporting ruby files with custom matchers and macros, etc,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;c1&quot;&gt;# in spec/support/ and its subdirectories.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;no&quot;&gt;Dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;spec/support/**/*.rb&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;no&quot;&gt;RSpec&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;configure&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# == Mock Framework&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# config.mock_with :mocha&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# config.mock_with :flexmock&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# config.mock_with :rr&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mock_with&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:rspec&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# Remove this line if you&amp;#39;re not using ActiveRecord or ActiveRecord fixtures&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fixture_path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/spec/fixtures&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# If you&amp;#39;re not using ActiveRecord, or you&amp;#39;d prefer not to run each of your&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# examples within a transaction, remove the following line or assign false&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;c1&quot;&gt;# instead of true.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;    &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;use_transactional_fixtures&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;no&quot;&gt;Spork&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each_run&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Once that is done the only thing left is to tell RSpec to use spork in the &lt;code&gt;.rspec&lt;/code&gt; file add the following:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;spec_helper.rb&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;ruby&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;&lt;span class=&quot;o&quot;&gt;&#8211;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colour&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&#8211;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;drb&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now run spork by simply doing:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;spork
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Once spork is running your RSpec tests should be a lot faster.&lt;/p&gt;

&lt;h2&gt;Cucumber&lt;/h2&gt;

&lt;p&gt;Cucumber is far easier to setup with spork. To get started simply run:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;rails g cucumber:install &#8211;spork
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Then start spork for cucumber:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;spork cucumber
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;The to run your cucumber steps:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;cucumber
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Or just your @wip tagged scenarios:&lt;/p&gt;

&lt;figure class=&#8217;code&#8217;&gt;&lt;figcaption&gt;&lt;span&gt;bash console&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&#8217;line-number&#8217;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&#8217;code&#8217;&gt;&lt;pre&gt;&lt;code class=&#8217;bash&#8217;&gt;&lt;span class=&#8217;line&#8217;&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;cucumber &#8211;profile wip
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This is a barebones setup for Rails using RSpec, Cucumber, and Spork. I haven&amp;#8217;t touched on adding factories like &lt;code&gt;factory_girl&lt;/code&gt; or &lt;code&gt;fabrication&lt;/code&gt; as this post is already a little long. Also, I&amp;#8217;ve heard that spork may cause some headaches at times. If this is the case for you kill the spork process and run the tests without to see if the problem persists. This will let you know if it&amp;#8217;s actually related to spork or something else that you&amp;#8217;re missing.&lt;/p&gt;

&lt;p&gt;I know that there are now application templates that you can provide to rails which will pretty much do all of the above automatically for you. I however like to configure things by hand. One reason is just part of the ritual of starting a green field app which can be an important part of the mindset. Another reason is simply that I like to know what is going on under the hood of my application. Should it break, I&amp;#8217;m the one who needs to fix it after all.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Is RSpec, Cucumber, et al Making Testing Too Risky?</title>
    <link href="http://www.mentalbrew.com/blog/2011/09/28/is-rspec-cucumber-making-testing-risky/"/>
    <updated>2011-09-28T00:00:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/09/28/is-rspec-cucumber-making-testing-risky</id>
    <content type="html">&lt;h2&gt;Intentions&lt;/h2&gt;

&lt;p&gt;Let me first start this article with the premise that I am not trolling the Ruby on Rails community or trying to stir up a controversy. This is an actual legitimate discussion I&amp;#8217;ve had with a co-worker recently as we determine what testing methods to use and why and was brought up again thanks to &lt;a href=&quot;http://www.jackkinsella.ie/2011/09/26/why-bother-with-cucumber-testing.html&quot;&gt;this article&lt;/a&gt;. Thoughtful discussion is encouraged.&lt;/p&gt;

&lt;h2&gt;Plethora of Testing Tools&lt;/h2&gt;

&lt;p&gt;One of the great things about the Ruby and RoR communities is their quick moving pace and the speed at which new and cool ideas get implemented. It could be argued that this is also a shortcoming of the Ruby community as many projects flare up in a bright light of activity only to burn out shortly after or abandoned if a newer shiny project comes along. Leaving adopters to fend for themselves at the next upgrade of their projects.&lt;/p&gt;

&lt;p&gt;Testing has been the core of the Ruby on Rails community specifically and the community has some of the most cutting edge frameworks available due mainly to the awesome syntactic constructs Ruby allows.&lt;/p&gt;

&lt;p&gt;With all of this has come a lot of projects aimed at making your testing and application behavior more efficient, concise, effective, or what have you. TDD, BDD, ATDD, and on and on the list grows of not only the styles (or pedantic approaches) of testing but the frameworks that go along with it.&lt;/p&gt;

&lt;p&gt;While this no doubt leads the community into an almost craft-like mentality regarding code and how we develop elegant, beautiful systems I have to ask if this comes at a cost that can be sustained over time.&lt;/p&gt;

&lt;h2&gt;Does Complexity Introduce More Risk?&lt;/h2&gt;

&lt;p&gt;Minitest or Test::Unit come to mind when I think of simple testing libraries and in fact these ship in the Ruby standard library. &lt;a href=&quot;http://www.rubyinside.com/a-minitestspec-tutorial-elegant-spec-style-testing-that-comes-with-ruby-5354.html&quot;&gt;I&amp;#8217;ve read&lt;/a&gt; that the entire codebase to MiniTest is somewhere around 300 LOC.&lt;/p&gt;

&lt;p&gt;Compare the relative simplicity of that codebase to one of the most popular testing frameworks out there, &lt;a href=&quot;https://github.com/rspec/rspec&quot;&gt;RSpec&lt;/a&gt;, which is very large and encompasses several smaller modules (Core, Mock, Expectations, etc).&lt;/p&gt;

&lt;p&gt;While it has been shown that lines of code and project size don&amp;#8217;t correlate with how well a framework is written it does increase the potential of errors and issues creeping into the framework as well as complicating the frameworks interactions in the project community around it (think mocking frameworks, capybara, etc).&lt;/p&gt;

&lt;p&gt;Are these interactions getting so complex that it is harder to maintain a testing methodology due to the increasing complexity of both the system under test and the framework testing that system? This thought was particularily brought home by &lt;a href=&quot;http://blog.vivekhaldar.com/post/10669678292/size-is-the-best-predictor-of-code-quality&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have you ever spent more time figuring out a testing issue that had nothing to do with your code and more likely related to the complex interactions of your testing framework? I know I have. Chalk this up to inexperience most likely in my case but at the end of the day I didn&amp;#8217;t exactly walk away with warm fuzzy feelings about my test suite.&lt;/p&gt;

&lt;h2&gt;Long Term Outlook&lt;/h2&gt;

&lt;p&gt;With testing frameworks getting larger and far more comprehensive, do we run the risk of building a large test suite for our application only to find that it is no longer supported just a few short years down the road. Does having to refactor your entire test suite still leave you with a good feeling about the solidity of your testing? Is there enough community support to carry a project on for the foreseeable future if the originators move on?&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Change is a good thing. It often brings innovation and a new way of doing things. What attracted me most to the Ruby on Rails community is the constant drive of new and interesting projects. What worries me as a developer of long term projects is hitching my most crucial code (the test suite) to a project that may or may not be around for the long haul.&lt;/p&gt;

&lt;h2&gt;End Note&lt;/h2&gt;

&lt;p&gt;I should say finally that I use RSpec and Cucumber daily in my work and I really enjoy what RSpec has to offer over other testing frameworks. This isn&amp;#8217;t a rant against any technology but simply a concern over what the future brings as our testing frameworks get more and more complex.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Finding More Time in Your Day</title>
    <link href="http://www.mentalbrew.com/blog/2011/09/27/finding-more-time-in-your-day/"/>
    <updated>2011-09-27T00:00:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/09/27/finding-more-time-in-your-day</id>
    <content type="html">&lt;p&gt;It seems as life gets more automated, finding the time to do the things
we really enjoy is getting difficult. Advancements in technology have
more likely than not added more to our plate than existed before. Not to
mention have limited our attention span and ability to focus on
something intently.&lt;/p&gt;

&lt;p&gt;The purpose of this article will be how, as a developer or small
business, you can find more time to get things done that are important
to you without sacrificing your family time.&lt;/p&gt;

&lt;p&gt;I will also note that these are items I am working on right now and have
seen success with. I can say however, that any failure I&amp;#8217;ve had hasn&amp;#8217;t
been with these simple ideas as much as my inability to be consistent and
disciplined with them. But each new day I start over and keep pressing
on toward the goal.&lt;/p&gt;

&lt;h2&gt;Wake Up Early&lt;/h2&gt;

&lt;p&gt;Waking up early is probably the last thing most people want to hear but
the benefits show themselves everytime. I am naturally a night owl and I
am more likely to stay up late in a burst of activity than I have been
to rise early and get some things done before work.&lt;/p&gt;

&lt;p&gt;Why did I make the change? There are several reason why waking up early in
the morning is preferred over bingeing in a late night programming
spree:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Less Distractions&lt;/strong&gt; - There are far fewer distraction early in the
morning. I&amp;#8217;m married with three young children. The morning guarantees
some quiet time. While it is harder to get up at 5am the benefits are a
more focused time to work on my projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeboxed&lt;/strong&gt; - If you have a day job and need to be at work by 8 or 9
then you know that your time in the morning is valuable. You have a
set period of time and you can focus your mind during this quiet hour to
really focus on what you need to do.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Prepare The Night Before&lt;/h2&gt;

&lt;p&gt;Now, if you are like me you also probably recognize that getting up
early in the morning can be eaten up by the most basic of tasks: getting
ready for the day, eating a breakfast, etc. Here are a few things I do
to minimize my early morning cost.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pack my lunch the evening before&lt;/strong&gt; - This will save you a lot of
time if you simply prepare your next days meal the night before. Often
I will do it immediately after dinner and just use leftovers from that
or quickly make a sandwhich while I&amp;#8217;m cleaning up from dinner.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get your clothes ready the evening before&lt;/strong&gt; - This may sound stupid
or perhaps make you feel like a child but by preparing you clothes in
the morning that is simply one mental process you don&amp;#8217;t need to make in
that early morning time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pack Your Stuff&lt;/strong&gt; - Prepare what you need for work in the evening
and stick it in your car (if you drive to work that is). Like I&amp;#8217;ve
stated before, do whatever you can to minimize your upfront.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;There is a lot more that can be said on this subject but the basics are
there. Take a step back from your day to day routine and see what can be
optimized to improve the quality of your time. Analyze the things in
your life that waste time or can be delegated out somehow. Make moves to
do only the things that add value to your day and bring you closer to
your goals.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Rebooting This Blog</title>
    <link href="http://www.mentalbrew.com/blog/2011/09/24/rebooting-this-blog/"/>
    <updated>2011-09-24T14:56:00+00:00</updated>
    <id>http://www.mentalbrew.com/blog/2011/09/24/rebooting-this-blog</id>
    <content type="html">&lt;p&gt;I am, once again, for like the eleventy-hundreth time, restarting my
blog. I&amp;#8217;ve realized over time that mixing my personal blogging with my
development blogging doesn&amp;#8217;t really serve either audience very well and
leads to some confusing conversations.&lt;/p&gt;

&lt;p&gt;Since all of my freelance and sidework projects go under the mentalbrew
moniker, I&amp;#8217;m going to reboot this blog for my technical, web
development-esque content.&lt;/p&gt;

&lt;p&gt;I plan on starting a new personal blog once I get the time.&lt;/p&gt;

&lt;p&gt;My plan is to write about the things that interest me in web development
and its surrounding industry. I also plan to write tutorials and series
on specific technologies.&lt;/p&gt;
</content>
  </entry>
  
</feed>
