kindkid/lrucache — pull request #5 by jamiecobbett (2013-07-05 12:20:28+00:00)
Title: Gracefully handle a max_size of 0

If you tried to create an LRUCache with a max_size of 0, it actually effectively creates a cache with a max_size of 1.

```ruby
cache = LRUCache.new(max_size: 0)
=> #, @data={}, @counter=0>
cache.store("a", 1)
=> 1
cache.keys
=> ["a"]
cache.store("b", 2)
=> 2
cache.keys
=> ["b"]
```

Whilst I appreciate that it might be an odd thing to do, it's something we did to (try to) disable the cache. I think there are two options: change the code to actually enforce a size of 0 or to raise an error if passed a size of 0. I went for the latter for simplicity.