This weekend I went mushroom hunting and found about 6 Chanterelle mushrooms, and they were delicious! I made cream of mushroom soup with Chanterelles for the main course, and a Tres Leches cake for desert. I still have about three pound left. I think I’ll go hunting them again next weekend. I can’t wait! I’m thinking about giving a few to zenspider a few since I know how much he loves them.
Recently, I’ve been refactoring Mechanize and I’ve added support for a few new things. First, mechanize now (and when I say “now”, I mean whats checked in) supports “file://” urls. For example:
agent = WWW::Mechanize.new page = agent.get("file:///Users/aaron/some_file.html")
Directories work too. Mechanize will turn directories in to a list of links for your navigation convenience. I’ve also added criteria based searching to links and frames. For example:
agent = WWW::Mechanize.new agent.get('http://google.com/') do |page| page = page.form_with(:name => 'f') do |form| form.q = 'Aaron Patterson' end.submit page.links_with(:text => /tender/i).each do |link| puts link.text end end
There is a singular and plural form. So you can locate many or one form, link, iframes, etc.
These changes will go in to an 0.8.0 release. However, I’m planning larger changes for a 1.0.0 release. I want to get rid of the WWW namespace, and stick with just Mechanize. I think that would probably be the largest change between 0.8.0 and 1.0.0 that I can think of. If you’d like to try out the new changes, just grab the gem from github: “gem install tenderlove-mechanize -s http://gems.github.com”.
Finally, I will be teaching the Ruby Certificate course at the UW. There are 3 courses, beginning Ruby, Ruby with Rails, and Advanced Topics in Ruby. Ryan will be teaching the beginning course, I’ll be teaching the Rails course, and I will be co-instructing the advanced course with Ryan. I am considering using The Rails Way or Agile Web Development with Rails (3rd ed). I’m leaning towards the Agile book, but we’ll see! Anyway, you should sign up!