February 2010
1 post
XRefresh on OSX Snow Leopard (using RVM)
Installing XRefresh (http://xrefresh.binaryage.com/#osx) was not too too straightforward with RVM… here is how I did it.
Before we get started…
You have RVM don’t you? `sudo gem install rvm`
I like to use RVM’s readline and iconv: `rvm install readline; rvm install iconv`
At the time of this writing, rvm seems to set ARCHFLAGS during the readline or iconv install, which...
November 2009
1 post
rvm / ree / nokogiri / gem bundler
(OSX 10.5… rvm installs REE with x86_64 architecture)
Recent steps I took to switch to rvm on my dev machine:
Install rvm (http://rvm.beginrescueend.com/install/).
Set up architecture flags (maybe optional — it seems like it installed x86_64 without this step) (http://rvm.beginrescueend.com/mysql/) (http://sick.snusnu.info/2009/11/04/installing-nokogiri-with-rvm-on-snow-leopard/).
...
August 2009
2 posts
stream itunes => songbird with SSH tunnel
Ok, so this might not work with the latest version of iTunes since we all know how much Apple likes to screw with iTunes… This works for me because I have a ReadyNAS NV+ at home that offers its own iTunes-like DAAP server which is apparently compatible with the Songbird DAAP plugin.
The SSH tunnel:
ssh -p <ssh_gateway_port> -L...
rails 2.2.2 => 2.3.3.1: two small discoveries
In my long overdue upgrade from 2.2.2 to 2.3.x I found a couple interesting, yet undocumented/unpublicized tidbits:
config.gem ‘BlueCloth’, :lib => ‘bluecloth’ should be config.gem ‘bluecloth’ (since gem install BlueCloth installs the old 1.x version while gem install bluecloth gives us the new and improved 2.x version). I was getting “uninitialized...
May 2009
2 posts
Rails HTML list helper
I posted a HTML list view helper here: http://gist.github.com/110754
h4x0r?
This is so I can do:
<% ul_nav do |ul| %>
<%= ul.link_to "hello", '#' %>
<%= ul.link_to "middle", '#' %>
<%= ul.link_to "goodbye", '#' %>
<% end %>
<ul class="nav">
<li class="first"><a href="#">hello</a></li>
<li><a...
factory_girl callbacks
Eh, I don’t know if this is necessary, but I added callbacks to factory girl (http://github.com/agibralter/factory_girl/tree/master).
Factory.define :user_with_verified_email do |f|
f.email { Factory.next(:email) }
f.login { Factory.next(:name) }
f.terms_and_conditions 1
f.password 'password'
f.add_callback(:after_save) do...
April 2009
3 posts
cucumber negative expectations
*update* I forgot to include matcher block arguments… code is fixed below
A ton of my Then step definitions have this pattern:
Then %r{should( not)? be happy$} do |should_not|
# ...
end
Dealing with the conditional should or should not got annoying, and I thought about some hardcore solutions (seen in this LH ticket)… but I ended up with a simpler solution with Andrew Vit’s...
1 tag
rspec example organization
If I find myself writing it blocks that contain the word “if” I like to refactor into sub-describe blocks:
describe User do
it "should be cool if wearing pants" do
# ...
end
end
# VS...
describe User do
describe "wearing pants" do
before(:each) do
# wearing pants setup
end
it "should be cool" do
# ...
end
end
describe "not...
1 tag
rails cookie session store
At first, I really loved the rails CookieStore for sessions… it seemed so elegant and carefree to let the client take care of its own data. Actually, I still like the idea a lot and it works well in most cases.
One problem: if you want to iframe/widgetize your site on another, you’ll have trouble. The security “features” of many browsers (such as Safari) will ignore...