RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

adamsalter — 5 posts

http://codebright.net

Cache expiry can be a bit complicated to setup with memcache, but I've released a _very_ small plugin that adds simple cache expiry to the rails filestore cache, no extra processes required - perfect for shared hosting (or lazy coders). E.g. cache({:controller => 'mycontroller', etc.}, {:expires_in => 1.day}). So easy it's (not) a crime.
Get it here: http://github.com/adamsalter/filestore_expires_in-plugin
Sometimes it can be really hard to track down what files might not be encoded correctly on Ruby 1.9... This gem makes life simpler by allowing searches from the command-line like 'find_bad_encodings .'.
http://github.com/adamsalter/bad_encodings-ruby19/tree/master
There are quite a few geoip gems out there that use the free Maxmind db, but most of the seem to require you to compile another application (available from Maxmind) to use it... It's too difficult and not even necessary. The Maxmind db is in a binary format, but it is very easy to read... Check out geoip gem on Github for a ruby gem that reads the Maxmind ip database and doesn't even require compilation! http://github.com/cjheath/geoip/tree/master
Ken is an intuitive Ruby API for accessing Freebase. It wraps the Metaweb Architecture to smart Ruby Objects. Check it out here: http://github.com/michael/ken/tree/master
SitemapGenerator enables Google Sitemaps to be easily generated for a Rails site as a rake task, using a simple 'Rails Routes'-like DSL. Sounds pretty familiar right? (well except for the Routes-like DSL) But it's not... it actually works the way you would expect. Plus it allows you to take care of familiar issues like: gzip of Sitemap files, variable priority of links, paging/sorting links (e.g. my_list?page=3), SSL host links (e.g. https:), Rails apps which are installed on a sub-path (e.g. example.com/blog_app/) and hidden ajax routes. As stated in the docs, it does have one shortcoming though - it only supports a maximum of 2.5 billion urls, after which you're on your own.