lib/libcache/file_cache.rb in libcache-0.4 vs lib/libcache/file_cache.rb in libcache-0.4.1

- old
+ new

@@ -19,11 +19,11 @@ # Places an object inside the cache, and by extension, into the filesystem. Handles max size eviction. Raises an InvalidKey exception if the key is not formatted properly. # @param [String] key The key value used to identify an object in the cache # @param [Object] value The object to be placed in the cache def put(key, value) - raise InvalidKey unless key.is_a? String - raise InvalidKey unless key =~ /\A[a-zA-Z0-9_-]+\z/ + raise ArgumentError unless key.is_a? String + raise ArgumentError unless key =~ /\A[a-zA-Z0-9_-]+\z/ @keys[key] = @keys.size.to_s File.open(File.join(store, @keys[key]), 'w') do |f| f.write(Marshal.dump(value)) end @cache[key] = value \ No newline at end of file