You are currently browsing the monthly archive for December, 2008.

2008 was a good year for me professionally. Here’s hoping that 2009 shapes up even better.

  • Ubiquity 0.1.3 - Just out, the new version of the command line for Firefox. Like TextMate, this is one of those applications that I know I’m barely scratching the surface of.
  • What good is a flexible paperclip? - Thoughtbot’s file attachment plugin is getting some overhaul.
  • Espresso Public Beta - MacRabbit’s new web development environment. I need to find time to play with this, too.
  • [ANN] Ruby 1.9.1 RC1 is released‘ - I’m responsible for this, you know: it happened minutes after I managed to get 1.9.1-pre2 installed.
  • Learnivore! - Aggregation portal for Ruby and related screencasts.

I spent a lot of yesterday working on the Rails continuous integration story. Well, you know, it was shiny…

  • acts_without_database: Using ActiveRecord for Non-Database Backed Objects - A sometimes-useful technique.
  • rubigen 1.5.1 - This code generator is coming full-circle, having originally come from Rails and now being included back into Rails.
  • ColumnScope 1.0 - Rails plugin to make it easier to return just column values. Looks interesting.
  • I spent a lot of yesterday deep in the Rails source, trying to figure out why some tests weren’t passing. No final conclusion but I think I’m on the right track.

  • Timecop 0.2.0 - Gem for freezing time to make it easier to write reproducible tests. Here’s the original announcement.
  • Pages Generator - Another helpful little tool from GitHub.
  • Bringing Merb’s provides/display into Rails 3 - DHH gives us a peek at one of the planned bits of merging.
  • Dispatch from the Front Lines - And Yehuda Katz is also writing about the work to come. The more of this sort of thing we see from the merged team, the less FUD there will be to go around.
  • Overview of Jekyll - a static site generator written in Ruby - A look at the tool that’s tied into GitHub’s pages.
  • Kontrol - a micro framework - Yes, it’s another small Ruby web framework.
  • Over the years, ActionController::Base#render has grown quite a few options:

    
    render :action => "edit"
    render :template => "products/show"
    render :file => "/u/apps/other/warning.html"
    render :nothing => true
    render :inline => "<% @product.name %>"
    render :update {|p| p.replace_html "A", "Error!"}
    render :text => "OK"
    render :json => @product
    render :xml => @product
    render :js => "alert('error!');"
    

    Those options will still be in Rails 2.3, but the first three have a simpler alternative now:

    
    render "edit"
    render "products/show"
    render "/u/apps/other/warning.html"
    

    Rails will figure out whether you’re rendering an action, template, or file, and do the right thing. In addition, if you like symbols, you can render an action via a symbol:

    
    render :edit
    

    Last one of these before my tiny Christmas break.

  • Merb gets merged into Rails 3! and Rails and Merb Merge - The big news from yesterday is that Rails and Merb will be as one some time next year. I am guardedly optimistic; though I look forward to seeing what comes of the partnership, as someone who spends much of his time reviewing others’ code I dread all the additional pieces I will need to develop expertise in.
  • iphone-rdoc-template - If you find yourself wanting to read ruby library docs on your iPhone, this would come in handy. Demonstration at PocketRails.
  • irb & script/console tips - Some useful tidbits here.
  • FireUnit - JavaScript unit testing extension for Firefox and FireBug.
  • Super Daring App Template - Peter Cooper contributes a template for the templating feature in edge Rails.
  • Sometimes the fact that I don’t know all the ins and outs of Ruby, coupled with habits carried over from other languages, turns around to bite me. Here’s a console session demonstration of the latest problem I had:

    
    >> a = b = 2
    => 2
    >> a = 3
    => 3
    >> b
    => 2
    >> a = b = []
    => []
    >> a << 2
    => [2]
    >> b
    => [2]
    >> a = []; b = []
    => []
    >> a << 2
    => [2]
    >> b
    => []
    

    So, trying to initialize multiple arrays and multiple integers doesn’t work the same. Live and learn.

    Things may finally be slowing down for Christmas on the net, though not yet in my consulting practice.

  • Twitter Scrape - I have no early use for gigabytes of Twitter social network statistics, but this is fascinating nonetheless.
  • CloudKit - “RESTful JSON storage with Optional OpenID and OAuth support.” Rack middleware too. How many more buzzwords could you want?
  • Things may slow down a bit for the holidays…but for me, they’re still cooking right along.

  • Model Plus - My latest Rails plugin, an enhanced model generator.
  • Agile git and the story branch pattern - Josh Susser discusses how to work with git effectively.
  • Read The Source, Luke: A Reader’s Guide To Browsing Rails Source - Yes, the Rails source is worth digging into to improve your own skills and understanding of Rails.
  • Easy Dependency Management for Git with Braid - Techniques worth knowing about. I’m still waffling about how to handle these things in my own projects.
  • cinabox - Dead-simple setup for a continuous integration server using cc.rb.
  • Canticore - A new look at blogging engines. - Using RubyGems for plugins and themes.
  • Migrating project websites to github pages with sake tasks, new websites with jekyll_generator - More very cool stuff from Dr. Nic.
  • LiteFixtures - Some more syntactic sugar for Rails fixtures.
  • QA and documentation are on my mind this morning. I need to remember the lesson that a PM can’t spend all their time coding.

  • Well Wishes $2 You - This doesn’t really have anything to do with Rails, except that the Rails community is traditionally very giving. But if you can spare two bucks around Christmas time, you can help do some good.
  • Named Scope: To Lambda or Not To Lambda, That Is The Question - Good explanation of what lambdas are doing in named scopes and why you might want one.
  • GitHub Pages - One more spiffy feature from the GitHub folks - free hosting, essentially. It works, too.
  • Ruby 1.9 can check your indentation - Well, at least if you run with warnings, it can.
  • Amazon SimpleDB - Now With Select - A syntax change makes this cloud database more accessible for more developers.
  • Spent part of yesterday learning more than I really want to know about Apache logging. Perhaps I should raise our eldest to be a sysadmin.

  • The Fork Queue - GitHub adds another very cool feature (though with an unfortunate name).
  • dailygoals - A little something I’m trying out on Twitter to help keep myself on track and accountable.
  • Apache Logging via ServerAlias - I needed this yesterday: 10 different URLs aliased to the same Rails site, but needing separate logging & analytics.
  • Introducing Rack Metal - Rails now has a very fast alternative to the full stack when you need to service something at speed, or show off meaningless statistics.
  • Bumped my OS X up to the latest 10.5.6 yesterday…it was *mostly* smooth.

  • find_mass_assignment - A more sophisticated approach to finding unprotected mass assignment vulnerabilities than my little rake task.
  • Rails TakeFive - A Conversation with Gregg Pollack - Gregg is, as always, worth reading.
  • Hoptoad Gets Paid Accounts and SSL - A service I’ve found quite useful is tweaking its long-term sustainability a bit.
  • GPGMail - If you’re using this PGP plugin for Apple’s mail.app, you need to upgrade to the current beta for it to work on the just-released OS X 10.5.6.
  • Off to a new week, packed with promise…and deadlines…

  • Tortoisegit - Porting TortoiseSVN to git for Windows users. Looks like it’s making good progress.
  • ProtoFX a new effect engine for Prototype - A new alternative to script.aculo.us.
  • Tweet Congress - Rails app that helps you find your congresscritters on Twitter, or pressure them to get on if they’re not.
  • Launching Ruby on Rails projects, a checklist - Some good advice from Robby Russell.
  • By now, you all know that you need to use attr_accessible to protect your application from having any old Active Record attribute changed by a malicious user. I find myself, in the course of consulting, looking at a great number of existing applications, and I’ve grown tired of having to open up every model and look. So, let’s be a bit smart: here’s a rake task that you can drop in any existing application to do the audit for you:

    
    namespace :utility do
    
      desc 'Find models that are not using attr_accessible'
      task :audit_attr_accessible => :environment do
    
        all_models = Dir.glob(
          File.join(Rails.root, 'app', 'models', '*.rb')
          ).map{|path| path[/.+\/(.+).rb/,1] }
        ar_models = all_models.select{|m|
           m.classify.constantize < ActiveRecord::Base}
    
        ar_models.each do |model|
          model_class = model.classify.constantize
          if model_class.send("attr_accessible").empty? &&
             model_class.send("attr_protected").empty?
            puts model_class.class_name +
              " allows unprotected mass assignment"
          end
        end
    
      end
    
    end
    

    (Hat tip Matt for the snippet to find all models).

    Round numbers of these things always make me happy.

  • Introducing Cache Money - Gem from the Twitter folks to implement write-through caching with Active Record and Memcached.
  • Fun with Threads - Further discussion of how Rails is tackling threading, from Koz.
  • Future proofing your Ruby code. Ruby 1.9.1 is coming. - Advice from Dr. Nic.
  • A case against Mocking and Stubbing and A case against a case against mocking and stubbing - Back-and-forth with Brian Cardarella and David Chelimsky.
  • I’ve gone back to big pieces of paper (actually giant Post-It Notes) for ERDs. Feels very satisfying in the absence of acres of whiteboards.

  • Why Ruby is Not My Favorite Language - An objection to promiscuous reopening of classes, though I think the counterarguments in the comments are reasonable.
  • FriendDA - An alternative to a serious NDA. I wouldn’t dream of using this in business, but it’s amusing.
  • Rails Worst Practices: 13 Coding Nightmares You Should Avoid - A reasonable list to think about, but I’m wary of “all” or “never” pronouncements.
  • Does anyone actually like end of the year bookkeeping?

  • Rails, Ajax and jQuery - I’m not all that fond of AJAX, but if you are, this is worth a look - it avoids all the Rails helper methods in favor of just writing the JavaScript.
  • Capistrano 2.5.3 - Jamis is no longer going to knock himself out to support Windows. I think that’s just dandy.
  • HTTP Client - Little HTTP debugging tool for OS X. Nothing you couldn’t do with the right Firefox extensions, but it’s purty.
  • Firefox 3.1 Beta 2 - Time to upgrade again if you’re on the cutting edge.
  • It’s another new week, full of hope.

  • simplepay - Rails interface to Amazon Simple Pay payment service.
  • Using Google App Engine as Your Own Content Delivery Networkm - A useful idea if your traffic isn’t too huge.
  • TortoiseGit Challenge - The GitHub folks want to see better Windows client software, and are offering a bounty for it.
  • CSV Mapper - Library to simplify importing CSV to Ruby apps. I may have a use for this soon.
  • Ruby on Rails Hosting Round-up - Always a popular (and mildly controversial) subject.
  • RPX in Action - If I ever have to implement OpenID, this looks like a good way to go about it. I’m hoping I never have to, though.
  • KnockKnock - Google authentication API for Ruby. As far as I’m concerned a better bet than OpenID.
  • Compass - A Sass-Based CSS Meta-Framework. Looks interesting, but I think that might be just a bit too much abstraction layer over something I barely understand anyhow.
  • Or at least, bug trackers I have known lately, because I’ve used too darned many over the years. Someone recently asked me to summarize my experiences, and who can resist that kind of request?

    If I were running a team of 10+ developers and choosing the tools, I’d start with FogBugz, which to my mind still does the best job I’ve seen of tying everything together and giving good predictive information. But I may be prejudiced, since they paid me to write a book
    . I’ve used FogBugz on real-world projects and been quite happy with it, and for a medium-sized dev team I recommend it.

    But these days, that’s not the sort of development team I’m usually a part of. Typically, I’m coming into a situation where a smaller team - 2 or 3 developers, 1 or 2 business folks - have already picked their tools, and I need to adapt. The collaboration software ranges from simple lists to full-blown project management tools. Here are some of the ones I’ve had to deal with in the past 2 years.

    It may be heresy for me to say this, but I’ve never had an especially good experience with Basecamp. It tends to be too much overhead for a small team and to be too opinionated (in my never-humble opinion). Unless you’re making a commitment to it for multiple projects, it’s just too much bother to use, and too hard to customize.

    Redmine is also not one of my favorites. Yes, it’s written in Rails, but other than that, I think it’s just behind the times. Entering a lot of data fields on a pure text interface doesn’t mesh well with the way I do business. If they add a really slick git integration I might take another look, but my overall feeling is that there are just better tools out there.

    The venerable Trac is another one that I can find my way around when I need to, but can’t especially recommend. The integrated wiki is on the clunky side, and the whole system feels slow (that might be a consequence of the installations I’ve had access to, of course). I don’t like Trac’s reporting or workflow either.

    No Kahuna has been excellent for small projects with clients who are less technically savvy. It offers an extremely simple interface, closer to a task manager than a bug tracker, but that’s what some people need. It supports multiple projects and tasks, and ranking things into buckets, and tracking who’s working on them. There are things I don’t like - such as multiple clicks to get back to the full task list after finishing a tasb - but this is one of the tools I end up recommending to people who just want collaborative tracking without a lot of fuss.

    Hiveminder is another collaborative todo list that I’ve used on multiple projects. It’s got more bells and whistles than No Kahuna (and sometimes all the AJAXy stuff seems to slow it down), which makes it harder to learn to use effectively. I also find that its notion that you have a big bucket of “up for grabs” tasks doesn’t always play well with knowing who is responsible for what.

    Lighthouse is another darling of the Rails world that I can take or leave. I like that it is low-ceremony, focusing on what needs to be done rather than on entering a bunch of excess data. I don’t so much like the navigation or searching, which seem confusing at times.

    Pivotal Tracker I’ve just started using on one project, and I like it so far. The drag-and-drop UI makes the client happy because they can prioritize the work, and the simple tracking makes me happy because I can get it done. I don’t like the 0,1,2,3 scale for story points, and so far I don’t know how well its velocity tracking/prediction will work, but my initial impression is that this is one I’m going to hang on to.

    Ever write code like this in Rails?

    
    if File.exists?(File.join(RAILS_ROOT, 'config', 's3.yml'))
      has_attached_file :s3_image,
      :storage => :s3,
      :s3_credentials =>  File.join(RAILS_ROOT, 'config', 's3.yml')
    end
    

    That particular snippet is from an application that optionally uses Amazon S3 to store images, if there is a configuration file for S3 supplied in the deployment. Well, you can clean that up a bit. First, although the RAILS_ROOT constant is still supported, we’ve had the prettier-looking Rails.root for months. Second, as of a recent commit to edge rails, Rails.root returns a Pathname object, so it directly supports the join method. Hence, the code snippet above can now be:

    
    if File.exists?(Rails.root.join('config', 's3.yml'))
      has_attached_file :s3_image,
      :storage => :s3,
      :s3_credentials =>  Rails.root.join('config', 's3.yml')
    end
    

    A tiny improvement, but of such tiny improvements are a pleasant framework made.

    Has anyone seen my missing productivity?

  • Ruby-Locale - Localization library that works with the Rails 2.2 i18n bits.
  • Ruby on Rails Online Class - For real college credit, even. Starting in February, cheap if you’re a California resident.
  • RubyGem is from Mars, AptGet is from Venus - One of the more sensible pieces I’ve seen on gems vs. Debian.
  • PoolParty - Software for configuring and managing computing clouds with a feel similar to Capistrano.
  • jCquard - JavaScript library to manage 80-column punch cards.
  • Doesn’t feel like I have enough projects to justify the amount of busy I am. Not sure what that’s about.

  • jquery_grid_for_rails - Rails wrapper for a fancypants UI grid. I’m not a huge fan of grid UIs in general, but sometimes they’re useful.
  • authlogic-activation-tutorial - A tutorial as a git project. Perhaps not the most effective presentation but easy to edit.
  • db_branch - Rails plugin to manage databases across git branching. I’ve been on projects where this would have been very useful.
  • How I use TextMate - A few tips from Alex Payne.
  • Rails Templates - The first must-have feature of the 2.3 branch. Notes from Pratik Naik.
  • Win some, lose some: good new client onboard yesterday, several older clients delinquent in their payments. The joy of freelancing.

  • simplelog - A new alternative on the Rails blogging engine front.
  • Spree 0.5.1 - This open source commerce platform is now designed to work with any Rails 2.1 version.
  • Zero-Downtime Restarts with HAProxy - In my ideal world, other people take care of this level of server fu for me.
  • Hot in Edge Rails: Generate Rails Apps from Templates - This is indeed hot, and will largely replace the need to keep static template applications hanging around.
  • Ruby Advent 2008 - An article a day for the holiday season.
  • Sometimes distributed team project management is very trying.

  • See Rails request paths in ‘top’ - A nice idea from Dave Thomas. I wonder if this should make its way into core.
  • TextMate Productivity Tips - From 456 Berea St. Tips are always fun.
  • cuc-demo - A demonstration of BDD with cucumber in the form of a tagged git repository.
  • Ruby 1.9.1 Preview 2 - It’s getting closer.
  • Why Git is Better than X - Just in case you want reasons to switch.
  • It’s now been roughly two years since I decided I’d had enough of Microsoft and went in search of greener (or at least less annoying) pastures. It seems a reasonable time to sum up how it’s been going again.

    First off, it’s safe to say that I’m a Rails developer now. I dabbled in a few other things (and I’m always up for learning more), but for me, Rails has offered the right balance between pleasure of development and being able to find interesting work that puts food on the table. My hourly rate for Rails is still not what my hourly rate for .NET was, but I’m OK with that tradeoff.

    With two years of Rails work under my belt, I’ve moved to the point where I’m starting to contribute to the framework. Perhaps not surprisingly to those who know my history, I’ve figured out that the best spot for me to contribute is on the documentation side (although I have had one code change accepted to core). I’m helping out with the docrails project (which is producing, among other things, the Rails Guides) and contributing the weekly “edge Rails” roundups for the Riding Rails weblog. I’ve also started writing for Rails Inside and Ruby Inside.

    I also find myself playing Pied Piper and helping other people make the transition from .NET to Rails - including Dana Jones, who happens to be my wife as well as a designer and developer in her own right (so now we have two Rails developers in the office and yes, we are available for hire). I won’t say this is the career path for everyone, but it’s certainly worked for me.

    All in all, I’m happy with where my career stands right now. Sure, we could be busier, and the hourly rates could be higher, but that’s always the case (and I have some other plans up my sleeve to help move in that direction). Overall, the increased happiness factor has made the transition more than worth it.

    Somehow I survived November. Here’s hoping December will be less stressful.

  • AssetPackager update - This plugin for compressing and minimizing Rails javascript and CSS assets has been updated for 2.2.
  • Breakage and fixage in Rails 2.2 - Another story of upgrading.
  • DearIE6 - Want to say goodbye to IE6 via Twitter? Now you can.
  • This Week in Edge Rails - I’m still doing this section of the main RoR weblog. It was a big week last week.
  • Overloading the parenthesis operator in Ruby - One of those things I hope never to have a need to do.