Rails Conf 2009 First Day of Sessions (Afternoon)

Did you know the Las Vegas Hilton charges you 3 dollars to print out a boarding pass? Jerks.

JavaScript Testing in Rails: Fast, Headless, In-Browser. Pick Any Three. Larry Karnowski

So blue_ridge is a javascript testing tool that mashes up a bunch of other tools to make testing javascript more or less like writing RSpec test. It's pretty cool. It uses Screw.Unit for the RSpec like lingo, Smoke for mocking, and Rhino to run the javascript tests without a browser (so you can integrate it into your Cruise Control build).

http://github.com/relevance/blue-ridge/tree/master

Blue-ridge is JQuery opinionated but can use Prototype without too much trouble.

It has a textmate bundle so you can run your javascript tests with command-r

You can have multiple describe blocks like RSpec.

Definitely worth a look.


Smacking Git Around - Advanced Git Tricks with Scott Chacon (GitHub)

Scott is very smart and really funny but he talked very fast so if you want to see the full slide deck you can go to:

http://www.tinyurl.com/gitrailsconf09
or here for the cheat sheet:
http://www.tinyurl.com/gitrailsconf09-cheat

Here's some selected tips I was able to jot down:

You can use partial sha1's to look up commits.

master^1 is parent of master
master~2 is two commits ago on master

Ranges:
[old]..[new]
ce04.. Means everything since then

git log orgin/master.. What am I going to push?
git log master ^orign/master Same as above


git log master bacon ^origin/master What is in the 'bacon' and 'master' branches that is not in origin master.

git log --graph Produces an ascii graph
gitk Produces visual graphs and takes pretty much the same arguments things as git log

git diff topic Means how do I make topic look like head -- probably not what you want

git diff HEAD...topic What happens if I merge in the topic branch -- useful

No rebasing on any commit you've pushed upstream! It messes everything up.

Subtree merging is an alternate to submodules. Tim Dysinger has a write-up on how to use it. Find it at: http://www.tinyurl.com/braidgit

git blame -C a_file.rb If a line was moved from another file then give me the last time it was changed from another file. Cool. You can even adjust how hard it looks for that line in another file.

git bisect is a binary search where a bug was introduced

git bisect start
git bisect bad The current commit is bad
git bisect good ae03efg... The last time you know it worked

Bisect will now take the range and check out the middle one, you run the code to see if the bug is there. If it still is:
git bisect bad And you get a new commit

if the bug isn't there:
git bisect good And you get a new commit

It keeps doing a binary search of commits (using your feedback) until you narrow it down to exactly the commit that caused the problem. Neat.

Then 'git bisect reset' to get back to normal.

git config --global color.ui auto For Colors

There's a way to set up git to diff word docs. Which is cool. See the link to the slides to see how (it went by rather fast).

Excellent talk.

Comments

Anonymous said…
Thanks for these RailsConf posts!

Popular posts from this blog

What's a Good Flog Score?

Point Inside a Polygon in Ruby

SICP Wasn’t Written for You