Exceptional / Airbrake?
Exceptional purchased Airbrake
APIs are different, is there a clear winner?
No clear winner — errbit is an open source solution that uses the airbrake gem.
Turns out… heroku restart
The only logical explanation we have for the bug with update_attributes failing silently is that we migrated without restarting. We speculate that some dynos had cached the old schema and never got the update (before restarting).
If you use the CSS
text-transform: uppercase property on some content that you wish to test with
- it will actually match on the original case of your text
- in case of failure, it will display the UPPERCASED expected text, so you’ll get interesting messages such as:
expected there to be content "NOV" in "NOV 8, 2012 — DEC 8, 2012"
SPF/DKIM for validating received email From: field?
We’re working on a feature where a user can reply to emails. We want to trust the “From:” field to identify the user, but aren’t sure how to set everything up properly.
We’re using SendGrid’s “Parse API” to receive the emails, and it tells us that we get an spf ‘permerror’ when sending from pivotallabs.com, but not from regular gmail.com or hotmail.com. What gives?
SPF only authenticates the envelope domain, so headers can’t be trusted. DKIM has the option to auth specific headers, so you may be able to trust DKIM.
Capybara 2.0 released
- Error on ambiguous match
- Drop Ruby 1.8 support
- External gems like capybara-webkit may not be compatible yet
- Not backwards compatible with 1.x
AR/PG silently not saving commits under heavy load
- People wondered if the transaction was getting rolled back, etc, everything seemed normal, but about 1 in 5 times the record wouldn’t write after an update_attributes.
Slanger for Pusher testing?
New with Rspec 2.12, rspec mocks now have the ability to call through to the original implementation.
asserts that banana.split was called, and also executes banana.split
Don’t commit Gemfile.lock in your gems
ACCORDING TO YEHUDA … if you are maintaining a GEM
git rm –cached Gemfile.lock
echo “Gemfile.lock” >> .gitignore
git add .gitignore
git ci -m “Remove Gemfile.lock — cf. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gem”
(this advice may be controversial)
AWS ELB overwrites X-Forwarded-Proto and X-Forwarded-Port
Adding an “external” dependency
The heroku_san gem used to depend on the Heroku CLI gem, ‘heroku’ which has been sunsetted in favor of the Heroku Toolbelt. What’s a reliable way of including this dependency in the gem library?
Smallest Federated Wiki
Ward Cunningham, inventor of the Wiki, has been working on a sequel called “Smallest Federated Wiki”. It’s packed with novel ideas about collaboration, markup, mobile emphasis, etc.
Best resources so far:
Presentation at RealTimeConf
New Rails and Ruby patches
patch 327 is avail. for Ruby: http://www.ruby-lang.org/en/news/2012/11/09/ruby19-hashdos-cve-2012-5371/
rails 3.2.9 is out this morning: https://github.com/rails/rails/tree/3-2-stable
Q: How can I plot thousands of points on a Google Map without said map being undraggable?
A: It may make sense to use Google’s HeatMap API after the number of plotted points exceeds 500. Other strategies are discussed here: Handling Large Amounts of Markers in Google Maps
Using ReCSS with Sass.
If you happen to be using SASS you can still make use of awesome ReCSS bookmarklets (including one by Pivotal’s own Erik Hanson) by using the compass command line tool and watching your project for changes. Totally rad!
Ruby Enterprise Edition
Is awesome, if you use the garbage collection tweaks. One team installed it and saw a 50% savings in their test suite running times — over 15 minutes! Combined with parallel spec it can be a real winner. If you’re on Leopard, you may need to install the version from Oct 2009, as the latest fails with a Marshall.load error on install. 2 legit!
All your RubyMine problems can be fixed!
By reverting to RubyMine 1.1.1. At least if your problems are: inconsistent functionality with the merge tool, and RubyMine occasionally refusing to recognize spec files correctly. That’s def!
Spring Forward this Sunday to save the daylight, and terrorize the programmers. Thanks a lot, farmers-slash-botanists. WORD Y’ALL. I’M OUT.
- Fast/Simple share widget plugins?
A project was in need of a turn-key plugin to provide Digg/Twitter/Facebook links. The two suggestions were the ever-popular “roll-your-own”, and pivotal’s own bookmark_fu. The latter of which, if you glance downwards and towards the right, you’ll see in use on this very blog! (Unless, of course, you’re using Google Reader and robbing us of our ad revenue riches).
- SpecRails Superclass Shenanigans
A Pivot found that when spec_rails is loaded, the superclass of spec suites changes to ActiveSupport::TestCase, instead of ExampleGroup (which, in this case, had a number of useful and necessary methods added to it). 
This carefully named plugin provides really nice sql-console-style formatting for ActiveRecord queries made from the irb console. I’m going to install it right away so I can pretend I still remember how to write MySQL queries by hand!
 I was working on a brilliant analogy that referenced Dick Dastardly and Muttley here, but I totally failed. Still, Wacky Races was totally rad, right? Radder than sneakily replacing superclasses, anyhow.
Fixjour blows up on validations for associated models
Two Pivots experienced this problem on separate projects. The general consensus was that generating objects with correct associations can be difficult. FactoryGirl was recommended as a fixture plugin that handles this problem particularly well. It was also suggested that rolling your own object mothers was trivial (fisticuffs ensued).
Timeout.rb raises an exception to kill child threads; it so happens that this exception can be caught, and possibly swallowed. This is truly a Noid to be avoided at all costs.
When Paperclip cannot find
identify in the path, it will raise an error that suggests it has been called with incorrect arguments. This is a bold-faced lie.
One Pivot remarked that these tests should really be mocking Paperclip in the first place, which seems an appropriate response to dishonesty.
Date.parse('Sep 9 2009 11:00:00 PST');
Date.parse('Sep 9 2009 11:00:00 PDT');
new fleegix.date.Date('9/9/2009 11:00:00', 'America/Los_Angeles');
This is arguably more useful than Daylight Savings Time itself.
Two Pivots experienced an issue where RightScale was caching their connection to Amazon upon creation. This led to the connection start time parameter getting further and further out of date until Amazon failed to accept the upload with a ‘Request Time Too Skewed’ error. No workaround was discussed, but it was roundly decided that any error with the word “Skewed” in it is pretty awesome. 
 Well, according to Wikipedia, so it might as well have been Ron Paul for all we know.
 aaaaaand rimshot.
 Not really.
- Pivotal Core Bundle – Deprecations deprecated!
Two Pivots heroically removed some deprecated extensions and rake tasks from the Pivotal Core Bundle. Do not be surprised if your favorite code jams (like cancel_default_validates_associated class method) disappear next time you pull.
- Move files fast!
Some lucky pivot discovered that
mv file.tgz * will move all files in the current path into the last file or directory it can find.
If for some reason you do not want this to happen, it is recommended that you always specify a destination when moving files.
To help you remember this protip, here’s a totally worthless analogy that involves automobiles: would you get into a cab without telling the driver where you wanted to go?
No, you would not, because he would take you to IHOP, and you hate pancakes. You wanted to go to Waffle House, which is unfortunate, because the nearest Waffle House is in Nevada.
Harlan Wood, one of our client developers, has founded a monthly hackfest project that may be of interest to the Rails community. From Harlan:
“I am putting together a monthly Hackfest for the Light, kicking off in late January. The idea is to put some of the great skills in our community to use on socially responsible software projects of any sort, with a preference toward open source, ruby/rails, and great testing, but open to just about anything. Participants will introduce projects of interest, or just bring their coding/UI skills, and developers and designers will work together on whichever projects inspire them.
An example project I’m working on is a creative collaboration remixing engine — like a github for creative commons licenced creative works. More on that here: http://enlightenedstructure.info/pub/WikiDragon.
I’ve created a meetup group ( http://www.meetup.com/Hackfest-for-the-Light/ ) — this is the best way to stay in touch if you’re interested.
H@rlan Knight Wood”