<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Random thoughts, links, and code by Nathaniel Bibler</description><title>nathaniel bibler</title><generator>Tumblr (3.0; @nbibler)</generator><link>http://blog.nathanielbibler.com/</link><item><title>Photo</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_kx1guseNGU1qz4md4o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.nathanielbibler.com/post/360591126</link><guid>http://blog.nathanielbibler.com/post/360591126</guid><pubDate>Fri, 29 Jan 2010 21:42:03 -0500</pubDate></item><item><title>You have found null^2. Oh yeah!</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kvgtzx1VNJ1qz4md4o1_400.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;You have found null^2. Oh yeah!&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/307920276</link><guid>http://blog.nathanielbibler.com/post/307920276</guid><pubDate>Wed, 30 Dec 2009 07:43:10 -0500</pubDate></item><item><title>Steelhead Brewery Sampler</title><description>&lt;img src="http://30.media.tumblr.com/tumblr_kthq0kIXuI1qz4md4o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Steelhead Brewery Sampler&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/252549874</link><guid>http://blog.nathanielbibler.com/post/252549874</guid><pubDate>Sat, 21 Nov 2009 22:07:35 -0500</pubDate></item><item><title>Photo</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_kt7qhbnYjW1qz4md4o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.nathanielbibler.com/post/246182510</link><guid>http://blog.nathanielbibler.com/post/246182510</guid><pubDate>Mon, 16 Nov 2009 12:41:38 -0500</pubDate></item><item><title>Named Scopes with PostgreSQL</title><description>&lt;p&gt;When using chained named scopes that modify the :select finder option, the PostgreSQL adapter appears to give SELECT query preference to the first scope defined:

&lt;pre&gt;&lt;code&gt;named_scope :foo, {:select =&gt; "foo.*"}
named_scope :bar, {:select =&gt; "bar.*"}

Tester.bar.foo.all #=&gt; SELECT bar.* FROM tester...
&lt;/code&gt;&lt;/pre&gt;

While it seems somewhat straightforward in this example, when chaining multiple scopes, it is somewhat counter-intuitive that the first takes precedence.&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/205074948</link><guid>http://blog.nathanielbibler.com/post/205074948</guid><pubDate>Mon, 05 Oct 2009 10:21:45 -0400</pubDate></item><item><title>Pushing to a different git remote branch</title><description>&lt;p&gt;If you have the need to push a local git branch to a differently named remote branch, try this:

&lt;pre&gt;
git push origin master:refs/heads/experimental 
&lt;/pre&gt;

Where “origin” is the remote name, “master” is your local branch name, and “experimental” is the remote branch to push into.&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/199180016</link><guid>http://blog.nathanielbibler.com/post/199180016</guid><pubDate>Mon, 28 Sep 2009 10:02:14 -0400</pubDate></item><item><title>Ignoring database.yml</title><description>&lt;p&gt;When database.yml is already in the repository, but you must have a modified local copy:

&lt;pre&gt;
git update-index --assume-unchanged config/database.yml
&lt;/pre&gt;&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/165714085</link><guid>http://blog.nathanielbibler.com/post/165714085</guid><pubDate>Tue, 18 Aug 2009 10:37:26 -0400</pubDate></item><item><title>Snow Hill Bridge</title><description>&lt;img src="http://26.media.tumblr.com/E20QE5DvEqbxblmnlAWZQgUYo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Snow Hill Bridge&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/148880461</link><guid>http://blog.nathanielbibler.com/post/148880461</guid><pubDate>Sat, 25 Jul 2009 09:30:42 -0400</pubDate></item><item><title>Google Friend Connect can’t handle my awesome.</title><description>&lt;img src="http://28.media.tumblr.com/E20QE5DvEpf7hv0eaFAUZsjmo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Google Friend Connect can’t handle my awesome.&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/134211513</link><guid>http://blog.nathanielbibler.com/post/134211513</guid><pubDate>Thu, 02 Jul 2009 11:59:01 -0400</pubDate></item><item><title>Mail can’t verify the identity of...</title><description>&lt;img src="http://27.media.tumblr.com/E20QE5DvEpce5vreZcltzjDno1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Mail can’t verify the identity of “imap.gmail.com”.&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/132998795</link><guid>http://blog.nathanielbibler.com/post/132998795</guid><pubDate>Tue, 30 Jun 2009 12:42:21 -0400</pubDate></item><item><title>The view</title><description>&lt;img src="http://26.media.tumblr.com/E20QE5DvEn233bc48lUPsRRTo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The view&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/103156765</link><guid>http://blog.nathanielbibler.com/post/103156765</guid><pubDate>Sun, 03 May 2009 22:15:22 -0400</pubDate></item><item><title>Sunday night Wynn from the monorail</title><description>&lt;img src="http://28.media.tumblr.com/E20QE5DvEn203k0in88dH2Vko1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Sunday night Wynn from the monorail&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/103129631</link><guid>http://blog.nathanielbibler.com/post/103129631</guid><pubDate>Sun, 03 May 2009 20:51:38 -0400</pubDate></item><item><title>Extra virgin, first pressing from Spain</title><description>&lt;img src="http://27.media.tumblr.com/E20QE5DvEm0h9y8tNCTRcuyFo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Extra virgin, first pressing from Spain&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/93887471</link><guid>http://blog.nathanielbibler.com/post/93887471</guid><pubDate>Tue, 07 Apr 2009 14:37:12 -0400</pubDate></item><item><title>Mmm.. Brighthouse with RoadRunner Turbo</title><description>&lt;img src="http://24.media.tumblr.com/E20QE5DvElb9lgc5ijDsJQDSo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Mmm.. Brighthouse with RoadRunner Turbo&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/88374222</link><guid>http://blog.nathanielbibler.com/post/88374222</guid><pubDate>Fri, 20 Mar 2009 23:07:54 -0400</pubDate></item><item><title>Ruby Gems with Autotest Discovery Break Rails</title><description>&lt;p&gt;We’ll start off by clarifying which versions of which software I’m currently running:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.rubyonrails.org"&gt;rails&lt;/a&gt; 2.2.2&lt;/li&gt;
  &lt;li&gt;
&lt;a href="http://www.zenspider.com/ZSS/Products/ZenTest/"&gt;ZenTest&lt;/a&gt; 3.11.1&lt;/li&gt;
  &lt;li&gt;
&lt;a href="http://www.github.com/mbleign/seed-fu/"&gt;mbleigh-seed-fu&lt;/a&gt; 0.0.3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’m developing a basic Ruby on Rails application.  Using Test::Unit and &lt;a href="http://thoughtbot.com/projects/shoulda/"&gt;Shoulda&lt;/a&gt; for the test suite. The issue that I kept running into (sadly, for nearly a couple of hours) was this:&lt;/p&gt;

&lt;pre&gt;loading autotest/rails_rspec
Autotest style autotest/rails_rspec doesn't seem to exist. Aborting.&lt;/pre&gt;

&lt;p&gt;My application does not use Rspec, nor do any of the frozen gems or installed plugins.  Here’s the kicker:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Simply installing a gem which has a custom autotest/discovery.rb will break you.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this case, seed-fu, a gem which I was toying around with, contains such a file.  Seed-fu was developed testing with Rspec (props for testing!).  Simply installing that gem, not even requiring it or referencing it in any manor in my application, had ZenTest’s autotest pick up the rspec requirement and try to run with it.  BAD AUTOTEST.  NO.  How did I fix it?&lt;/p&gt;

&lt;pre&gt;$ sudo gem uninstall mbleigh-seed-fu&lt;/pre&gt;</description><link>http://blog.nathanielbibler.com/post/79992771</link><guid>http://blog.nathanielbibler.com/post/79992771</guid><pubDate>Fri, 20 Feb 2009 11:42:13 -0500</pubDate></item><item><title>Functional test for 404s in Rails 2.x</title><description>&lt;p&gt;The Ruby on Rails version 2.x &lt;code class="ruby"&gt;ActionController::TestCase&lt;/code&gt; thankfully abstracts a lot of the setup of your functional tests.  There is a hidden issue, however, a problem that lingers for fully testing your controllers.  How do you test for those automatically generated FAIL pages (i.e. 404, 500, 403, etc.)?&lt;/p&gt;

&lt;p&gt;Hidden in the &lt;code&gt;TestCase&lt;/code&gt; code, there is an answer.  By default, all &lt;code class="ruby"&gt;@request&lt;/code&gt; calls are made using a localhost-like IP, namely 0.0.0.0.  TestCase overrides the rescue_action_without_handler and checks for that specific IP.  If 0.0.0.0 is found, it will just forward the raised error to you, bypassing those pretty error pages.  So, here’s the secret:  Change your &lt;code class="ruby"&gt;@request.remote_addr&lt;/code&gt; to anything other than ‘0.0.0.0’.

&lt;/p&gt;
&lt;pre&gt;&lt;code class="ruby"&gt;class MyController &lt; ApplicationController
  def show
    raise ActiveRecord::RecordNotFound
  end
end


class MyControllerTest &lt; ActionController::TestCase
  def test_show_rescues_with_404
    @request.remote_addr = '1.2.3.4'
    get :show, :id =&gt; 1
    assert_response :not_found # PASS!
  end
end
&lt;/code&gt;&lt;/pre&gt;


Also, be sure you remove any lines in your functional test that look similar to:

&lt;pre&gt;&lt;code class="ruby"&gt;class MyController; def rescue_action(e) raise e end; end&lt;/code&gt;&lt;/pre&gt;</description><link>http://blog.nathanielbibler.com/post/79832476</link><guid>http://blog.nathanielbibler.com/post/79832476</guid><pubDate>Thu, 19 Feb 2009 21:23:00 -0500</pubDate></item><item><title>"Linux is the expert mode of operating systems."</title><description>“Linux is the expert mode of operating systems.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Nathaniel Bibler&lt;/em&gt;</description><link>http://blog.nathanielbibler.com/post/79460529</link><guid>http://blog.nathanielbibler.com/post/79460529</guid><pubDate>Wed, 18 Feb 2009 16:27:26 -0500</pubDate></item><item><title>Automated Phusion Passenger installation prior to 2.1.0 </title><description>&lt;p&gt;The following snippet will run the Phusion Passenger installation script (passenger-install-apache2-module) in an automated fashion.  This would allow you to install the software via a boot script:

&lt;pre&gt;&lt;code&gt;echo -en "\n\n\n\n" | passenger-install-apache2-module&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/79230132</link><guid>http://blog.nathanielbibler.com/post/79230132</guid><pubDate>Tue, 17 Feb 2009 21:14:00 -0500</pubDate><category>passenger</category></item><item><title>"Application Error

Hoptoad has hopped the toad.
The application has notified itself about this..."</title><description>“&lt;p&gt;Application Error&lt;/p&gt;

&lt;p&gt;Hoptoad has hopped the toad.&lt;br/&gt;
The application has notified itself about this situation, and we’ll look into it soon.&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.hoptoadapp.com"&gt;Hoptoadapp&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.nathanielbibler.com/post/78840031</link><guid>http://blog.nathanielbibler.com/post/78840031</guid><pubDate>Mon, 16 Feb 2009 13:42:32 -0500</pubDate></item><item><title>Heh.  The application reporting program had a problem.  Time to...</title><description>&lt;img src="http://25.media.tumblr.com/E20QE5DvEk11c05uWG4Iiduno1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Heh.  The application reporting program had a problem.  Time to report it to… myself!&lt;/p&gt;</description><link>http://blog.nathanielbibler.com/post/78839364</link><guid>http://blog.nathanielbibler.com/post/78839364</guid><pubDate>Mon, 16 Feb 2009 13:39:12 -0500</pubDate></item></channel></rss>
