jodosha/redis-store — pull request #167 by jasdeepsingh (2013-01-28 01:18:06+00:00)
Title: Support Cache Deletion with Pattern Match Strings

This pull request fixes: #134

As such, it was evident that it's not possible to delete cache objects using `expire_fragment` with first argument as a `Regex` object since we don't support `Regex` arguments for expire_fragment and instead rely on Redis' wildcard pattern match.

```ruby
instrument_fragment_cache :expire_fragment, key do
if key.is_a?(Regexp)
cache_store.delete_matched(key, options)
else
cache_store.delete(key, options)
end
end
```

Due to the above behaviour, **delete_matched** was never being invoked and pattern match deletes were not supported.

Since, consumers of redis-store will mostly resort to using wildcard pattern matches and pass in arguments as plain strings, It made sense to have **delete** support both exact match cache deletes and pattern match cache deletes.

This pull request, aliases **delete** to **delete_matched** and supports both pattern match deletes and exact match deletes.

**Note:** I think we should make this clear in the documentation. I'm open to submit any revisions to this pull request as deemed fit by the core contributors.

Another thing that I wanted to point out wa