Google Groups Home
Help | Sign in
Message from discussion acts_as_cached 2.0 needs your help!
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Chris Wanstrath  
View profile
 More options Jan 28 2007, 9:48 pm
From: "Chris Wanstrath" <ch...@ozmm.org>
Date: Sun, 28 Jan 2007 18:48:57 -0800
Local: Sun, Jan 28 2007 9:48 pm
Subject: acts_as_cached 2.0 needs your help!
Hey cachers,

I spent my Saturday re-writing the internals of acts_as_cached.  The
first version, the one we're all using in production, uses $globals
for config state, has some questionable tests, has a big-ass untested
init.rb file, and is hard as hell to read.  I don't really even
understand it anymore -- there is a lot of metaprogramming going on.

The new version, the one I'm writing to you about, is much better.
The API stays the same, but the insides are more efficient, better
written, easier to understand, and easier to extend.  It should be a
drop-in replacement aside from the fact that it requires (as far as I
know) 1.2+.

The new version is fully spec'd using test/spec and mocha, written
using BDD.  Hopefully this means you all will be able to play around
with the internals and submit cool functionality (along with nice,
Englishy tests/specs).  Good examples are the Disabled and
Benchmarking modules -- they leave the core of the plugin mostly alone
while adding in new functionality, Rails-style.

Okay, so I need your help.  When you've time, please try out the new
version and let me know how it fares.  Run the tests, run your app,
etc.  It works in my apps but I'm not you.

You can get it here:
  svn://errtheblog.com/svn/plugins/cache_fu

Yeah, that's a temporary name until it's ready.  I'm ripping off
technoweenie here.

You can run the tests with `rake test` from the plugin's directory.
You can run tests against a localhost:11211 memcache daemon with `rake
test_with_memcache` if you'd like.  I had to isolate the tests because
some actions, like enabling Benchmarking, can't be reversed.  You
understand.

There are no comments, no README file, and no documentation yet.
Sorry about that.  On the plus side, I'm in the process of building a
mini-site (cached.errtheblog.com) which will basically be everything I
know about memcache, all the ways I use acts_as_cached, and all the
ways you can use it.  Extensive API docs + tips'n'tricks beyond my
PDF.

Oh, one last thing: skip_cache_gets can only be accessed from
ActsAsCached now.  So, in your before filter:

before_filter :skip_gets

def skip_gets
  returning true do
    ActsAsCached.skip_cache_gets = !!params[:skip_gets]
  end
end

Previously you could call this method from any Ruby object, but that
makes no sense.  Think about it.

Cool, thanks.  Let me know what happens.  If all goes well this will
replace acts_as_cached within a few weeks.

--
Chris Wanstrath
http://errtheblog.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google