ANN: Spraypaint - yet another tagging library for rails

I've just open-sourced and released spraypaint, a tagging plugin I've
developed. I can't claim it's better than all other tagging plugins
out there (and there are certainly quite a few) but I think it's
different enough that other people might find it useful. Here are
some of those differences:

a) Most tagging queries wrap around the standard finder methods. So
the following are all valid:

# Finds with added conditions, limit and offsets
Pub.find :all, :tagged_with_all => ['cosy', 'wood fire', 'real
ale'], :conditions => {:city_id => 'london'}, :limit => 20, :offset =>

# Calculations based on tags
Pub.sum :turnover, :tagged_with_any => 'football'

# Finds through associations
City.find_by_name('London').pubs.find(:all, :tagged_with_any =>

b) While there is a proper tagging model hidden away, all manipulation
is done through strings:

p = Pub.create :tags => ['dark', 'old men', 'fights']
p.tags << 'wetherspoons'

p.tag_string = "dark, old men, fights"

c) There's some rudimentary support for machine tagging:

Film.create :tags => ['film:director:coens']
Film.find :all, :tagged_with_any => {:namespace => :film}
Film.find :all, :tagged_with_any => {:namespace => :film, :predicate
=> :director}

If any of this sounds interesting, take a look at:

I'd be interested in all comments and feedback


Following some advice, I've moved the code to so it works nicely
with script/plugin install.

I've also backported the code to 1.2.6 as apparently not everyone
develops their apps on the bleeding edge :wink:

I'd still really appreciate any more comments, criticism or even abuse
you'd all care to send my way.