Posts from July 2009

authlogic_oauth gotcha

I don’t want to imply by the title this is anyone’s fault but my own.  But since it took me two days to figure out, I thought I’d share.
I’m using the excellent authentication package, authlogic, for my current project.  I want to allow normal registrations through my site and also registrations using Twitter credentials.  In [...]


Rails 2.3.1+, Passenger, and Rack 1.0

Just an FYI for those of you running the latest stable Rails.
Rails 2.3.1+ depends on Rack 1.0.  In 2.3.1, it only uses the vendor’d version of Rack 1.0 (which is located under action_controller/vendor).  In 2.3.2, it can use a vendor’d version of Rack 1.0 if the gem isn’t installed in your system.  Rails 2.3.3 depends [...]


Rails running in script/console?

If you ever wanted to know if your application is running normally or in console mode, here’s the trick:
def in_console?
Object.const_defined?(:IRB)
end
This would break if you require’d IRB in your Rails application normally, though I can’t possibly imagine why you would.


deploy:web:disable and Dreamhost

Following on the heels of Twitter on your maintenance page, the other piece of custom setup I needed for this solution to work was making the site swallow all incoming requests while disabled in order to show the maintenance page.  In the past on sites using Nginx+thin/mongrel the setup has been in the nginx configuration [...]


Twitter on your maintenance page

I recently started a new project.  Because the domain was purchased, one of the first acts of business was a, “Coming Soon,” page.  I decided the maintenance/deploy:web:disable page was the perfect solution.  I could put it up in production and leave it off in staging without special code shenanigans.  It would be re-usable for the [...]