Rails: CSS Graph and “wrong number of arguments”

There's a great plugin for Rails called CSS Graphs Helper that does, well, just that: graphs things. However the instructions on that page say to implement a graph like so:
PLAIN TEXT
RUBY:

<%= bar_graph  ['Gouda', 24], ['Havarti', 9], ['Provolone', 81], ['GjeitÃst', 57], ['Stilton', 42] %>

This threw a "wrong number of arguments (5 for 1)" error when [...]

Ruby: No Such File to Load: net/https

.../custom_require.rb:27:in `gem_original_require': no such file to load -- net/https (MissingSourceFile)

If you get this error when getting your Rails app up and running under Ubuntu (Dapper in my case) it means you still need to install the libopenssl-ruby library:

apt-get install libopenssl-ruby

I recommend installling that before you install Rails.

Micro-targetted Spam

This just landed in my Spambox with the first email subject line that's gotten me to open spam in a long time:

Subject: I had never imagined my book being that successful. We finally agreed that O'Reilly would produce an enhanced

The words that got me: book, O'Reilly. If you're a geek, that combination probably resonates with [...]

Rails: Extending Classes, Creating Mixins

I tend towards disliking the use of inheritance with my own objects. It's great for components in frameworks where I only have to worry about the end product but in my own code I default towards thinking of inheritance as a flaw and only concede when no other alternative is as elegant.
Which is why I'm [...]

Rails: A Question About Constants

This is one of those questions for which the elegant answer feels like it ought to be simple. In my app I have a module called Constants which contains application-specific constants (such as a copyright notice, for instance).
Putting the constants.rb file into app/helpers and then referencing the constant ala <%= Constants::COPYRIGHT_MESSAGE %> works well [...]

Adium 1.0 Released Today

After years of using point releases and betas of Adium I'd almost forgotten that it still hadn't hit that magic number of "done, more or less" but today it did: Adium 1.0 is available and as always, it's free and open-source.
Excellent work! Congrats to the Adium team who've put four years into this (hey, they're [...]

A Quicksilver Panic Moment

I tend to use Quicksilver for launching pretty much any app I use during the day (amongst many other things). So much so that the Finder is now the only permanent resident in my Dock, the rest come and go as launched.
Today Quicksilver crashed. Hard, silent, deadly, with nary a whisper. Disappeared from the menu [...]

Ruby: Comparing an Object’s Class in a Case Statement

Here's a little tidbit that I had to dig long and hard on Google to find. If you want to use a case statement in Ruby to act on the class of an object, the following - my initial attempt that I thought ought to work - won't work:
PLAIN TEXT
RUBY:

def get_value( pResult )

    case [...]

« go back