<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MadCode</title>
	<atom:link href="http://www.madcowley.com/madcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.madcowley.com/madcode</link>
	<description>The gate is wide open, the madmen escape</description>
	<lastBuildDate>Sat, 24 Sep 2011 20:22:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Diving into Compass and SASS</title>
		<link>http://www.madcowley.com/madcode/2011/09/diving-into-compass-and-sass/</link>
		<comments>http://www.madcowley.com/madcode/2011/09/diving-into-compass-and-sass/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 20:22:28 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barcamptampabay]]></category>
		<category><![CDATA[compass]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=63</guid>
		<description><![CDATA[Thanks for everyone who came out to my talk at Barcamp Tampa Bay today, and many thanks to all the organizers, volunteers, and sponsors. Here are the slides to my talk &#8211; Diving into Compass and SASS. &#160;]]></description>
			<content:encoded><![CDATA[<p>Thanks for everyone who came out to my talk at Barcamp Tampa Bay today, and many thanks to all the organizers, volunteers, and sponsors.</p>

<p>Here are the slides to my talk &#8211; <a href="http://madcowley.com/madcode/files/sasstalk_barcamptampa2011.pdf" onclick="pageTracker._trackPageview('/outgoing/madcowley.com/madcode/files/sasstalk_barcamptampa2011.pdf?referer=');">Diving into Compass and SASS</a>.</p>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2011/09/diving-into-compass-and-sass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pow! Dead-easy rails development servers</title>
		<link>http://www.madcowley.com/madcode/2011/06/pow-dead-easy-rails-development-servers/</link>
		<comments>http://www.madcowley.com/madcode/2011/06/pow-dead-easy-rails-development-servers/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 00:18:56 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=56</guid>
		<description><![CDATA[The Problem: you&#8217;ve got multiple rails projects in development; possibly one or more use subdomains, and you can&#8217;t be bothered messing with vhosts and /etc/hosts and &#60;insert extra hassle steps here&#62; just to look at your app in the browser. The Solution: Pow, a zero-configuration Rack server for OSX, by Sam Stephenson over at 37 [...]]]></description>
			<content:encoded><![CDATA[<p>The Problem: you&#8217;ve got multiple rails projects in development; possibly one or more use subdomains, and you can&#8217;t be bothered messing with vhosts and /etc/hosts and &lt;insert extra hassle steps here&gt; just to look at your app in the browser.</p>

<p>The Solution: <a href="http://pow.cx/" onclick="pageTracker._trackPageview('/outgoing/pow.cx/?referer=');">Pow</a>, a zero-configuration Rack server for OSX, by Sam Stephenson over at <a href="http://37signals.com/" onclick="pageTracker._trackPageview('/outgoing/37signals.com/?referer=');">37 Signals</a>.  (Oh, yeah, this is an OSX solution, so other platforms go pout.)</p>

<p>I&#8217;ve been working with it for a few days now, and quite like it so far.</p>

<p>It runs on <a href="http://nodejs.org/" onclick="pageTracker._trackPageview('/outgoing/nodejs.org/?referer=');">node.js</a>, so if you don&#8217;t have that installed, go get a nice tall bottle of whiskey and commence to installin&#8217;. I&#8217;ll wait.</p>

<p>Back? Ok. Let&#8217;s get Pow installed and running in 90 secs or so:</p>

<p>Oh, wait. Back up. Installing and using Pow involves <em>unix commands </em>and <em>symbolic links</em> and sure there&#8217;s only a couple of things to type but that&#8217;s <em>soooo hard</em>&#8230;.luckily, <a href="https://github.com/Rodreegez/powder" onclick="pageTracker._trackPageview('/outgoing/github.com/Rodreegez/powder?referer=');">there&#8217;s a gem for that</a>.
<code>sudo gem install powder</code></p>

<p>And then, to install Pow:
<code>powder install</code></p>

<p>No sudo, but it&#8217;ll ask you for your password.</p>

<p>Then, go to the root of your rails (or any rack) app:</p>

<p><code>powder up</code></p>

<p>That&#8217;ll start the pow server. You only have to do that once, no matter how many apps you&#8217;re serving.</p>

<p><code>powder link</code></p>

<p>to link up your app to a pow server. By default, it takes the name of the dir you&#8217;re in, so if your app is in ~/code/myapp, it&#8217;ll use myapp.dev. If you&#8217;d like to use a different url, just do:</p>

<p><code>powder link myfancyappname</code></p>

<p>Now, you can go to myapp.dev in your browser (or myfancyappname.dev), and you&#8217;re all set.</p>

<p>Here&#8217;s the extra handy bit: if you use subdomains in your app, just do:</p>

<p><code>powder link subdomain.myapp</code></p>

<p>Now subdomain.myapp.dev is available.</p>

<p>That&#8217;s it.</p>

<p><code>powder down</code>
will turn off the server should you want to,</p>

<p><code>powder restart</code></p>

<p>will restart your app, and</p>

<p><code>powder remove</code></p>

<p>will remove the pow server link.</p>

<p>Oh, to get the app&#8217;s logs, just run
<code>powder applog</code>
from the app root; it&#8217;s like tail -f development.log</p>

<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2011/06/pow-dead-easy-rails-development-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Filtering spam with akismet and rails</title>
		<link>http://www.madcowley.com/madcode/2011/06/filtering-spam-with-akismet-and-rails/</link>
		<comments>http://www.madcowley.com/madcode/2011/06/filtering-spam-with-akismet-and-rails/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 02:00:39 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=52</guid>
		<description><![CDATA[I&#8217;ve got a rails site with an active comments section. For a couple of years I&#8217;ve been using the recaptcha gem by fellow tampa.rb member Jason Perry, and that&#8217;s mostly worked well. Recently we&#8217;ve been getting hit by spam from Russia which has been getting past the recaptcha filters. The spammer in question may or [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a rails site with an active comments section. For a couple of years I&#8217;ve been using the <a href="https://github.com/ambethia/recaptcha" onclick="pageTracker._trackPageview('/outgoing/github.com/ambethia/recaptcha?referer=');">recaptcha</a> gem by fellow <a href="http://www.meetup.com/tampa-rb/" onclick="pageTracker._trackPageview('/outgoing/www.meetup.com/tampa-rb/?referer=');">tampa.rb</a> member <a href="http://ambethia.com/" onclick="pageTracker._trackPageview('/outgoing/ambethia.com/?referer=');">Jason Perry</a>, and that&#8217;s mostly worked well.</p>

<p>Recently we&#8217;ve been getting hit by spam from Russia which has been getting past the recaptcha filters. The spammer in question may or may not be Leo Tolstoy (pictured).</p>

<p>Has recaptcha been cracked? You can read</p>

<div class="zemanta-img zemanta-action-dragged" style="margin: 1em; display: block;">

<div class="wp-caption alignright" style="width: 310px"><a href="http://commons.wikipedia.org/wiki/File:L.N.Tolstoy_Prokudin-Gorsky.jpg" onclick="pageTracker._trackPageview('/outgoing/commons.wikipedia.org/wiki/File_L.N.Tolstoy_Prokudin-Gorsky.jpg?referer=');"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/L.N.Tolstoy_Prokudin-Gorsky.jpg/300px-L.N.Tolstoy_Prokudin-Gorsky.jpg" alt="" width="300" height="425" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>

</div>

<p>opinions about that <a href="http://stackoverflow.com/questions/448963/has-recaptcha-been-cracked-hacked-ocrd-defeated-broken" onclick="pageTracker._trackPageview('/outgoing/stackoverflow.com/questions/448963/has-recaptcha-been-cracked-hacked-ocrd-defeated-broken?referer=');">elsewhere</a>.</p>

<p>In the meantime, I needed to add more protection to keep the discussions hammy. So, I turned to the akismet service from the WordPress folk, and the <a href="https://github.com/joshfrench/rakismet" onclick="pageTracker._trackPageview('/outgoing/github.com/joshfrench/rakismet?referer=');">rakismet</a> gem.</p>

<p>To get it set up was fairly simple, with one gotcha.</p>

<p>First, install the rakismet gem. In your Gemfile:</p>

<p><code>gem 'rakismet', '0.4.2' </code></p>

<p>Note that I&#8217;m specifying the 0.4.2 version &#8211; this app is on rails 2.3.x, and the 1.0.x version of rakismet is rails 3 only.</p>

<p>Next, sign up for an akismet api key over at <a href="http://akismet.com/" onclick="pageTracker._trackPageview('/outgoing/akismet.com/?referer=');">akismet.com/</a>. This service will run you $5/mo.</p>

<p>Then add your key and site url to config/initializers/rakismet.rb:
<code>Rakismet::KEY  = '8167608161e2'
Rakismet::URL  = 'http://www.wmnf.org'</code></p>

<p>Now the gotcha: the docs for rakismet hint that a third setting, Rakismet::HOST, is optional, and only useful if you&#8217;re using typepad or another akismet endpoint.  It fails if that&#8217;s not configured, though, and there&#8217;s no default in the gem. So, add a third line:</p>

<p><code>Rakismet::HOST = 'rest.akismet.com'</code></p>

<p>In your comment model, add:</p>

<p><code>include Rakismet::Model</code></p>

<p>You may have to map some fields from your model to the ones rakismet expects; details are in the <a href="https://github.com/joshfrench/rakismet" onclick="pageTracker._trackPageview('/outgoing/github.com/joshfrench/rakismet?referer=');">readme</a>.</p>

<p>Now, before you save a comment, just check</p>

<p><code>comment.spam? </code></p>

<p>and you&#8217;re all set.</p>

<p>You may want to save the comments anyway and set a state flag to &#8216;spam&#8217; or the like, so you can make sure valid comments aren&#8217;t getting unfairly flagged.</p>

<p>Hope that helps.</p>

<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/" onclick="pageTracker._trackPageview('/outgoing/www.zemanta.com/?referer=');"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=567a215e-f6cb-4a07-9a5f-9fa7c7fcc8c2" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2011/06/filtering-spam-with-akismet-and-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running migrations in Sinatra</title>
		<link>http://www.madcowley.com/madcode/2010/12/running-migrations-in-sinatra/</link>
		<comments>http://www.madcowley.com/madcode/2010/12/running-migrations-in-sinatra/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 16:25:40 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=48</guid>
		<description><![CDATA[Using Active Record in Sinatra and miss your rails db migration tasks? Create a /lib/tasks directory from your project root, and copy this file into it: https://github.com/rails/rails/blob/2-3-stable/railties/lib/tasks/databases.rake In your Rakefile, add this line (thanks to this post): Dir.glob('lib/tasks/*.rake').each { &#124;r&#124; import r } And, to let the migrations dump your schema.rb file: RAILS_ROOT = File.dirname(FILE) [...]]]></description>
			<content:encoded><![CDATA[<p>Using Active Record in Sinatra and miss your rails db migration tasks?</p>

<p>Create a /lib/tasks directory from your project root, and copy this file into it: <a href="https://github.com/rails/rails/blob/2-3-stable/railties/lib/tasks/databases.rake" onclick="pageTracker._trackPageview('/outgoing/github.com/rails/rails/blob/2-3-stable/railties/lib/tasks/databases.rake?referer=');">https://github.com/rails/rails/blob/2-3-stable/railties/lib/tasks/databases.rake</a></p>

<p>In your Rakefile, add this line (thanks to <a href="http://blog.smartlogicsolutions.com/2009/05/26/including-external-rake-files-in-your-projects-rakefile-keep-your-rake-tasks-organized/" onclick="pageTracker._trackPageview('/outgoing/blog.smartlogicsolutions.com/2009/05/26/including-external-rake-files-in-your-projects-rakefile-keep-your-rake-tasks-organized/?referer=');">this post</a>):</p>

<p><code>Dir.glob('lib/tasks/*.rake').each { |r| import r }</code></p>

<p>And, to let the migrations dump your schema.rb file:</p>

<p><code>RAILS_ROOT = File.dirname(<strong>FILE</strong>)</code></p>

<p>And you&#8217;re all set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/12/running-migrations-in-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textmate trick for failing cucumber stories</title>
		<link>http://www.madcowley.com/madcode/2010/12/textmate-trick-for-failing-cucumber-stories/</link>
		<comments>http://www.madcowley.com/madcode/2010/12/textmate-trick-for-failing-cucumber-stories/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 15:38:52 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=44</guid>
		<description><![CDATA[Quick tip: if you&#8217;re trying to clean up some failing cucumber features, and you get output like so: cucumber features/my_feature.feature:24 # Scenario: My user does stuff cucumber features/my_feature.feature:38 # Scenario: My user does more stuff And you&#8217;d rather it look like this: bundle exec cucumber features/my_feature.feature:24 -f pretty bundle exec cucumber features/my_feature.feature:38 -f pretty So [...]]]></description>
			<content:encoded><![CDATA[<p>Quick tip: if you&#8217;re trying to clean up some failing cucumber features, and you get output like so:
<code>cucumber features/my_feature.feature:24 # Scenario: My user does stuff
cucumber features/my_feature.feature:38 # Scenario: My user does more stuff</code></p>

<p>And you&#8217;d rather it look like this:</p>

<p><code>bundle exec cucumber features/my_feature.feature:24 -f pretty
bundle exec cucumber features/my_feature.feature:38 -f pretty</code></p>

<p>So you can copy/paste back into terminal to run the features under bundler with pleasant output, here&#8217;s how:</p>

<ul>
<li>Copy paste the failing scenario lines to a new textmate window;</li>
<li>Do cmd-f for find/replace &#8211; put 
<code>cucumber (.<em>) #.</em></code>
in the &#8216;find&#8217; and 
<code>bundle exec cucumber $1 -f pretty</code>
in the &#8216;replace&#8217;, and check &#8216;regular expression&#8217;, then &#8216;replace all&#8217;. </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/12/textmate-trick-for-failing-cucumber-stories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post-deploy notifications on EngineYard Cloud</title>
		<link>http://www.madcowley.com/madcode/2010/11/post-deploy-notifications-on-engineyard-cloud/</link>
		<comments>http://www.madcowley.com/madcode/2010/11/post-deploy-notifications-on-engineyard-cloud/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 19:11:54 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[engine_yard]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=41</guid>
		<description><![CDATA[Post-deploy notifications on Engine Yard cloud I&#8217;ve got a project hosted on EngineYard&#8216;s cloud servers, with geographically-dispersed team. The developers are often working on separate feature sets, often deployed independently. As a quality-control and awareness measure we wanted to be notified when a deploy was done. This was pretty easy to set up, and would [...]]]></description>
			<content:encoded><![CDATA[<h1>Post-deploy notifications on Engine Yard cloud</h1>

<p>I&#8217;ve got a project hosted on <a href="http://engineyard.com" onclick="pageTracker._trackPageview('/outgoing/engineyard.com?referer=');">EngineYard</a>&#8216;s cloud servers, with geographically-dispersed team. The developers are often working on separate feature sets, often deployed independently. As a quality-control and awareness measure we wanted to be notified when a deploy was done.</p>

<p>This was pretty easy to set up, and would work with capistrano deployments also.</p>

<p>First we set up a mailer action; I used an existing mailer class for this but you might want to create a separate class just for process-type notifications:</p>

<pre><code>  def deploy_notification(attribs)
    subject       "A build of my_project was deployed to #{attribs[:env_name]}"
    from          "MyProject CodeMonkey HQ"
    @from =       "notify@example.com"
    recipients    "bullwinkle@example.com"
    sent_on       Time.now
    body          :revision =&gt; attribs[:revision], :env_name =&gt; attribs[:env_name]
  end
</code></pre>

<p>and the corresponding deploy_notification.text.plain.erb:</p>

<pre><code>  Heads up code monkeys! New code has been deployed to &lt;%= @env_name %&gt;

  Details:

  Environment: &lt;%= @env_name %&gt;
  Revision: &lt;%= @revision %&gt;
</code></pre>

<p>I&#8217;ll probably make that a little fancier with a direct link to the commit on the githubs, and possibly pull in the commit message etc.</p>

<p>Next, we add a rake task to call the mailer; I put this in /lib/tasks/deploy.rake:</p>

<pre><code>  namespace :deploy do
    desc "notify developers of deployment"
    task :notify =&gt; :environment do
      attribs = {}
      ARGV.each do |arg|
        if arg.match(/TO=(.*)/)
          attribs[:env_name] = $1
        elsif arg.match(/REVISION=(.*)/)
          attribs[:revision] = $1
        end
      end
      SupportMailer.deliver_deploy_notification(attribs)
    end
  end
</code></pre>

<p>Finally, for engineyard integration, in deploy/after_restart.rb:</p>

<pre><code>  # notify dev team of deploy
  run "cd #{release_path} &amp;&amp; rake deploy:notify TO=#{@configuration[:environment]} REVISION=#{@configuration[:revision]}"
</code></pre>

<p>That gets called by the engineyard chef scripts after the deploy finishes.  For capistrano deployments, you could do the same in an &#8220;after deploy:restart&#8221; call.</p>

<p>That&#8217;s it. Hope it&#8217;s helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/11/post-deploy-notifications-on-engineyard-cloud/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why use automated deployment?</title>
		<link>http://www.madcowley.com/madcode/2010/08/why-use-automated-deployment/</link>
		<comments>http://www.madcowley.com/madcode/2010/08/why-use-automated-deployment/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 15:18:39 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[capistrano]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=36</guid>
		<description><![CDATA[I was talking with a developer about their first rails project, the deadline of which was looming. After a quick walk-through of the code I started asking about process stuff &#8212; what are you using for tests? Are you using capistrano for deployment? The answers were &#8220;I&#8217;d like to use tests at some point in [...]]]></description>
			<content:encoded><![CDATA[<p>I was talking with a developer about their first rails project, the deadline of which was looming. After a quick walk-through of the code I started asking about process stuff &#8212; what are you using for tests? Are you using capistrano for deployment?</p>

<p>The answers were &#8220;I&#8217;d like to use tests at some point in the future&#8221; &#8212; danger! &#8212; and that no, he was deploying things manually up to a vps instance.</p>

<p>I said that whatever server admin task like deployment that I can automate and do from my own machine, I will. He asked, &#8220;why, are you not a server guy?&#8221;</p>

<p>So, I thought I&#8217;d jot down a snapshot of why I use capistrano (or chef recipes, with engine yard-ish clouds) for deployment, in case someone else is wondering.</p>

<p>Three main reasons: flow, safety, and process.</p>

<h3>Flow</h3>

<p>This one&#8217;s pretty simple. During the course of a development day, my screen-estate is taken up by an editor window, a browser, and the console. My console (iTerm) usually has several tabs open, typically three per project: a server, a prompt at the app&#8217;s root for doing git operations and kicking off tests, and one tab that&#8217;s tailing the cucumber or rspec logs.</p>

<p>If I want to deploy, I just drop into the console that&#8217;s already open, and run a simple command (&#8220;cap <instance> deploy&#8221;) and I&#8217;m done. It&#8217;s just part of the flow, and flow is everything.</p>

<p>If I have to deploy something manually, that involves:
  * opening a new tab
  * logging into the server
  * moving to to the app root
  * running commands like git pull, etc
  * possibly restarting mongrels
  * logging out and closing the tab</p>

<p>None of which is in the flow of <em>developing</em>.  In other words, I have to switch modes from <em>developer</em> to <em>sysadmin</em>, and switching modes kills the flow.</p>

<h3>Safety</h3>

<p>This one&#8217;s simple also. Capistrano has a lovely command: &#8220;cap <instance> deploy:rollback&#8221;. If I deploy something that&#8217;s not ready for primetime, and satellites begin falling from their orbits or nuclear attack turtles start becoming sentient before they&#8217;re meant to, I can just kick off a rollback and I&#8217;m back to safety and fluffy bunnies. That&#8217;s because capistrano keeps several releases stored on the server, and switching to a previous codebase is as easy (mostly) as switching some symlinks.</p>

<p>In the manual world, it&#8217;s <em>messier</em>. I don&#8217;t like messy. Not with prematurely-sentient nuclear turtles out there.</p>

<h3>Process</h3>

<p>Anything I have to do manually is something I&#8217;m likely to either screw up or forget. That&#8217;s because I&#8217;m a forgetful screw-up, but it&#8217;s important to build self-protection into your process flow.</p>

<p>Aside from updating the codebase, deployments can typically involve migrating the db, updating symlinks, restarting search servers, notifying services such as hoptoad and newrelic, etc.  Anything that has to be done each time you deploy can be built into a capistrano script, so you <em>don&#8217;t have to think about it</em>. What you don&#8217;t have to think about, you won&#8217;t <em>forget</em> to think about, and you won&#8217;t <em>screw-up</em>.</p>

<p>If the updated codebase depends on a migrated db, and you forget to run the migrations after deploying manually, well here come the sentient nuclear turtles. And they&#8217;re <em>mad</em>.</p>

<p>So, keep the world safe: automate your deployment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/08/why-use-automated-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>quick tip: bunder, rails 2.3.8, and rspec</title>
		<link>http://www.madcowley.com/madcode/2010/07/quick-tip-bunder-rails-2-3-8-and-rspec/</link>
		<comments>http://www.madcowley.com/madcode/2010/07/quick-tip-bunder-rails-2-3-8-and-rspec/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 22:56:08 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=31</guid>
		<description><![CDATA[I set up an app on 2.3.8 with bundler, and when trying to run the rspec tests got .../config/Gemfile not found (Bundler::GemfileNotFound) which is odd. I&#8217;d grabbed the code for config/intializers/preinitializer.rb from gembundler.com; to solve the issue I changed line 15 from ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", _ FILE _) to ENV["BUNDLE_GEMFILE"] = File.expand_path(File.join(Rails.root,"Gemfile"), _ FILE _) [...]]]></description>
			<content:encoded><![CDATA[<p>I set up an app on 2.3.8 with bundler, and when trying to run the rspec tests got 
<code>.../config/Gemfile not found (Bundler::GemfileNotFound) </code></p>

<p>which is odd.</p>

<p>I&#8217;d grabbed the code for config/intializers/preinitializer.rb from <a href="http://gembundler.com" onclick="pageTracker._trackPageview('/outgoing/gembundler.com?referer=');">gembundler.com</a>; to solve the issue I changed line 15 from</p>

<p><code>ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", _ <em>FILE</em> _) </code></p>

<p>to</p>

<p><code>ENV["BUNDLE_GEMFILE"] = File.expand_path(File.join(Rails.root,"Gemfile"), _ <em>FILE</em> _)</code></p>

<p>Hope that helps&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/07/quick-tip-bunder-rails-2-3-8-and-rspec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>quick tip: zsh and bundler</title>
		<link>http://www.madcowley.com/madcode/2010/07/quick-tip-zsh-and-bundler/</link>
		<comments>http://www.madcowley.com/madcode/2010/07/quick-tip-zsh-and-bundler/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 16:15:26 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=27</guid>
		<description><![CDATA[I&#8217;m just starting to look at bundler &#8212; way ahead of the curve as usual. I&#8217;m using zsh, and every time I ran a bundle command I&#8217;d get: correct 'bundle' to .. [nyae]? To turn off the autocorrect message, just add this to your .zshrc: alias bundle='nocorrect bundle']]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just starting to look at bundler &#8212; way ahead of the curve as usual.</p>

<p>I&#8217;m using zsh, and every time I ran a bundle command I&#8217;d get:</p>

<p><code>correct 'bundle' to .. [nyae]?</code></p>

<p>To turn off the autocorrect message, just add this to your .zshrc:</p>

<p><code>alias bundle='nocorrect bundle'</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/07/quick-tip-zsh-and-bundler/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>upgrading hoptoad: uninitialized constant HoptoadNotifier::Catcher</title>
		<link>http://www.madcowley.com/madcode/2010/02/upgrading-hoptoad-uninitialized-constant-hoptoadnotifiercatcher/</link>
		<comments>http://www.madcowley.com/madcode/2010/02/upgrading-hoptoad-uninitialized-constant-hoptoadnotifiercatcher/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 22:26:10 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rails hoptoad]]></category>

		<guid isPermaLink="false">http://www.madcowley.com/madcode/?p=22</guid>
		<description><![CDATA[Dept. of Quick Tips Dept.: If you&#8217;re upgrading from an older plugin version of the hoptoad notifier to the 2.2 gem, and you see uninitialized constant HoptoadNotifier::Catcher when you try to script/generate hoptoad, go to application_controller and remove the line: include HoptoadNotifier::Catcher Then run script/generate hoptoad again and all should be well. Oh, and if [...]]]></description>
			<content:encoded><![CDATA[<p>Dept. of Quick Tips Dept.: If you&#8217;re upgrading from an older plugin version of the hoptoad notifier to the 2.2 gem, and you see uninitialized constant HoptoadNotifier::Catcher when you try to script/generate hoptoad, go to application_controller and remove the line:</p>

<p><code>  include HoptoadNotifier::Catcher</code></p>

<p>Then run script/generate hoptoad again and all should be well.</p>

<p>Oh, and if you can&#8217;t unpack the gem, try removing  lib/tasks/hoptoad_notifier_tasks.rake (via <a href="http://help.hoptoadapp.com/discussions/problems/543-cant-unpack-version-220-of-gem" onclick="pageTracker._trackPageview('/outgoing/help.hoptoadapp.com/discussions/problems/543-cant-unpack-version-220-of-gem?referer=');">here</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madcowley.com/madcode/2010/02/upgrading-hoptoad-uninitialized-constant-hoptoadnotifiercatcher/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

