<commit_before># TMPettyCache #

## Hybrid in-memory/on-disk cache for iOS and OS X. ##

`TMPettyCache` is an asynchronous wrapper for [NSCache](https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/NSCache_Class/Reference/Reference.html) with simultaneous persistence to disk. The in-memory and on-disk caches are configurable separately. Cached items are removed when the application receives a memory warning, goes into the background, or various optional limits are met. See the docs for more details.

## Installation  ##

### Manually ####

[Download the latest tag](https://github.com/tumblr/TMPettyCache/tags) and drag the `TMPettyCache` folder into your Xcode project.

Install the docs by double clicking the `.docset` file.

### Git Submodule ###

    git submodule add https://github.com/tumblr/TMPettyCache.git
    git submodule update --init

### CocoaPods ###

Add [TMPettyCache](http://cocoapods.org/?q=name%3ATMPettyCache) to your `Podfile` and run `pod install`.

## Example ##

Also see the [example](example/) included in the project.

    [[TMPettyCache sharedCache] setData:[@"value" dataUsingEncoding:NSUTF8StringEncoding]
                                 forKey:@"key"
                                  block:^(TMPettyCache *cache, NSString *key, NSData *data, NSURL *fileURL)
    {
        NSLog(@"data %p written to file at %@", data, fileURL);
    }];

    [[TMPettyCache sharedCache] dataForKey:@"key"
                                     block:^(TMPettyCache *cache, NSString *key, NSData *data, NSURL *fileURL)
    {
        NSLog(@"should be value: %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
    }];

    [[TMPettyCache sharedCache] clearAllCachesSynchronously];

## Requirements ##

`TMPettyCache` requires iOS 5.0 or OS X 10.7 and greater.

## License ##

[Apache 2.0](LICENSE.TXT)

## Contact ##

[<NAME>](mailto:<EMAIL>)

## Copyright ##

2013 Tumblr, Inc.<commit_msg>&copy<commit_after># TMPettyCache #

## Hybrid in-memory/on-disk cache for iOS and OS X. ##

`TMPettyCache` is an asynchronous wrapper for [NSCache](https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/NSCache_Class/Reference/Reference.html) with simultaneous persistence to disk. The in-memory and on-disk caches are configurable separately. Cached items are removed when the application receives a memory warning, goes into the background, or various optional limits are met. See the docs for more details.

## Installation  ##

### Manually ####

[Download the latest tag](https://github.com/tumblr/TMPettyCache/tags) and drag the `TMPettyCache` folder into your Xcode project.

Install the docs by double clicking the `.docset` file.

### Git Submodule ###

    git submodule add https://github.com/tumblr/TMPettyCache.git
    git submodule update --init

### CocoaPods ###

Add [TMPettyCache](http://cocoapods.org/?q=name%3ATMPettyCache) to your `Podfile` and run `pod install`.

## Example ##

Also see the [example](example/) included in the project.

    [[TMPettyCache sharedCache] setData:[@"value" dataUsingEncoding:NSUTF8StringEncoding]
                                 forKey:@"key"
                                  block:^(TMPettyCache *cache, NSString *key, NSData *data, NSURL *fileURL)
    {
        NSLog(@"data %p written to file at %@", data, fileURL);
    }];

    [[TMPettyCache sharedCache] dataForKey:@"key"
                                     block:^(TMPettyCache *cache, NSString *key, NSData *data, NSURL *fileURL)
    {
        NSLog(@"should be value: %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
    }];

    [[TMPettyCache sharedCache] clearAllCachesSynchronously];

## Requirements ##

`TMPettyCache` requires iOS 5.0 or OS X 10.7 and greater.

## License ##

[Apache 2.0](LICENSE.TXT)

## Contact ##

[<NAME>](mailto:<EMAIL>)

## Copyright ##

&copy;2013 Tumblr, Inc.
{'fraction_non_alphanumeric': 0.12384615384615384, 'fraction_numerical': 0.0071794871794871795, 'mean_word_length': 3.5202780996523755, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '35244', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1184, 'n_words': 343}