ActiveRecord Dumper, , , , , , , " />

Delectable plugin treats for the ruby shovers

August 25, 2009
Candy raver plugin funtime!

Delicatable treats for the rubies.

Been a long time. shouldn’t of left ya without a dope plugin to step to. meh. But for reals, I’ve been working way too much. Here’s a tasty sampler of some new and revived github projects:

ActiveRecord Dumper

script/plugin install http://github.com/blythedunham/ar_dumper

Dumper. I barely know her! I wrote this ages ago back in the Rails 1 dot 0h(mg) daze, but still works like a charm.

Easily export records to csv, yaml, or xml using the :find options, or (new) specify an array of activerecords with the :records option. AR Dumper dumps to strings or files with a paginated option, and it supports full customization of displayed headers and content with options such as  :o nly, :export, :procs, :methods

Book.dumper :yml, :find => {:conditions => ['author_name like ?', 'snowgiraffe'] }

Book.dumper :csv,  :o nly => [:author_name, :title], :records => @my_books


Asset Tag Extensions

script/plugin install git://github.com/blythedunham/javascript_tag_extensions

nuts_samplerYour high performance web site client loading slowly? In addition to combining asset files, one of the best ways to improve client load speed is to move the javascript files and inline script tags to the bottom of the page. Even better, execute inline javascript after the document loads.  To load files at the bottom of the page use the

include_javascript_tag 'myjsfile', :defer => true

Similarly, replacing calls to javascript_tag with Asset Tag Extension’s inline_javascript renders the script at the bottom of the page. Use the :o n_load => true functionality use JQuery OnLoad functionality.

  <%  inline_javascript  :o n_load => true do %>
    alert("I love grapes");
  <% end %>

Ruby Prof Request Filters

script/plugin install http://github.com/blythedunham/ruby_prof_request_filters

Need to instantly profile a page? Output ruby prof results to your browser by adding the following params to the url: ruby_prof=true Flat graphs, html graph, whatever you need, this little tool comes in handy when your solving big problems.

Google Base: Base4r

I did some work on Dan Dukeson’s Google Base API For Ruby. Add, modify and delete items from Google Base (formerly Froogle) with Ruby.

Leave a Reply