I like frameworks, but sometimes debugging them is more entertaining. I don’t know why I didn’t think of this method before, but mischa on github has a great little repo showing how you can do it. The README Usage: Add: require ‘ruby-debug’ require ‘cucumber_rails_debug/steps’ To features/support/env.rb Then use: Then debug # opens the debugger or Then what #prints out params, url and html Check it out here
Verbose Logging
software development with some really amazing hairRiding rails with selenium
Selenium is a suite of tools to automate web app testing across many platforms. Cucumber is a BDD framework that allows you to write things in English (or whatever language you want, really), and have that execute as code. Put those together with webrat and rspec and you have a pretty mean stack to test your ruby on rails web application with. Sort of. I’ve been having some problems with it, getting it set up, but it’s coming along. This isn’t...
Read the full article
Ruby regex for fun and profit
Regex are always fun, and since regex expressions are first class citizens in ruby, it makes it so much easier. I found this Code Golf question on Stackoverflow and threw together a quick method to do it. I can’t take all the credit, since I needed to search a bit to figure out if I could do matching parenthesis in ruby, and found that I could, but only in ruby 1.9, which ruby forum topic showed me. Then a commenter on SO pointed out another o...
Read the full article
Gtk and ruby threading issues
In one of my classes, we used Ruby and Gtk, but some issues popped up. The most obvious is using a block to do GUI update stuff and the like, from another thread. Things die. Puppies are killed. I found this post on Ruby Forum which fixed the problem. Relevant code. Basically, you call the Gtk.init_thread_protect method first when you start things up, then, whenever you need to do GUI update stuff, just wrap it in a Gtk.thread_protect {} block...
Read the full article
Using ruby's eval to make cucumber bigger and greener
In case you just crawled out from under your rock just to read my blog, and haven’t the foggiest, cucumber is a ruby acceptance testing framework, and works great with rails. I was writing features for admin users in this application, and needed a step like this: Then I should be editing "test@example.com" Where the quoted email is the login. Later on (in fact right after…I was testing edit functionality, and after safe you end up on the view ...
Read the full article
Twitter tools with surl
I should probably actually announce surl… Anyway. I did some reading and hacked up a little plugin to make Twitter Tools use my URL shortener, surl Hopefully it works. It’s kind of unfortunate, since I have to post to test, and I really don’t want all my test posts going out to Twitter, and yet they have to… EDIT: Yay it works. Win! And here’s the code:
Read the full article
ruby-openid IOError with Passenger
The ruby-openid gem was giving me problems with Passenger, causing IOError problems. I found the fix here The gist of it? Add OpenID::Util.logger = RAILS_DEFAULT_LOGGER To environment.rb, and you’re good!
Read the full article
RSS fun with feedzirra
Sometimes, checking RSS feeds is boring. Sometimes you just want to grab a picture or whatever from each item. For that, there’s ruby. Oh and feedzirra. There is an RSS feed I read, except it’s more of a picture feed and I just want to grab the pictures from it, and doing this through Google Reader is no fun. That’s where ruby and feedzirra come in. feedzirra is a ruby gem for dealing with RSS feeds. It’s got a great interface and just works. ...
Read the full article
Compiling ruby-gnome from scratch
If you go download the ruby-gnome stuff, and GTK fails to compile, it’s easy to fix. It whines about some defines, and you can just comment out the block that’s causing the problem.
Read the full article
Git things I always forget
Create a branch locally, and push it to origin: git checkout -b branchnamegit push origin branchname Get at that branch from elsewhere: git checkout -t -b branchname origin/branchname
Read the full article