<commit_before>GBFeatureManager
============

Simple iOS and Mac OS X feature manager for unlocking functionality (e.g. for IAP purchases).

Usage
------------

Unlock a feature (all features are locked by default):

```objective-c
[GBFeatureManager unlockFeature:@"speedBoost"];
```

Lock a feature:

```objective-c
[GBFeatureManager lockFeature:@"speedBoost"];
```

Check to see if a feature is unlocked:

```objective-c
[GBFeatureManager isFeatureUnlocked:@"speedBoost"];		//Returns: YES or NO
```

If you want to unlock all features + any future features, think of it as an "all features unlocked override" (N.B. this will supersede any individual setting):

```objective-c
[GBFeatureManager enableWildcardFeatureOverride];
```

To turn off the "all features unlocked override":

```objective-c
[GBFeatureManager disableWildcardFeatureOverride];
```

To enabled features by default (e.g. Pro version), you can unlock some features directly in the Info.plist by adding it as a key to the Plist, prefixed by `GBFeatureManager:` and setting the value to a Boolean.

```xml
<key>GBFeatureManager:com.goonbee.proVersion</key>
<true/>
```

...normally you would do this in Xcode's Plist editor by simply adding a new row with the key `GBFeatureManager:com.goonbee.proVersion`, setting the type to `Boolean` and the value to either `YES` or `NO`.

Don't forget to import header, for iOS:

```objective-c
#import "GBFeatureManager.h"
```

... or on OSX:

```objective-c
#import <GBFeatureManager/GBFeatureManager.h>
```

Storage mechanics
------------

Features are each stored to disk in simple serialized NSNumber object to NSDocumentsDirectory on iOS, or NSApplicationSupportDirectory OS X.

When checking whether a feature is available, the disk is only accessed the first time, and the result is cached in memory, subsequent checks never hit the disk.

Dependencies
------------

* [GBToolbox](https://github.com/lmirosevic/GBToolbox)
* [GBStorageController](https://github.com/lmirosevic/GBStorageController)

iOS: Add to your project's workspace, add dependency for GBToolbox-iOS and GBStorageController-iOS, link with your binary, add -ObjC linker flag, add header search path.

OS X: Add to your project's workspace, add dependency for GBToolbox-OSX and GBStorageController-OSX, link with your binary, add "copy file" step to copy framework into bundle.

Copyright & License
------------

Copyright 2013 <NAME>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0
<commit_msg>grammar<commit_after>GBFeatureManager
============

Simple iOS and Mac OS X feature manager for unlocking functionality (e.g. for IAP purchases).

Usage
------------

Unlock a feature (all features are locked by default):

```objective-c
[GBFeatureManager unlockFeature:@"speedBoost"];
```

Lock a feature:

```objective-c
[GBFeatureManager lockFeature:@"speedBoost"];
```

Check to see if a feature is unlocked:

```objective-c
[GBFeatureManager isFeatureUnlocked:@"speedBoost"];		//Returns: YES or NO
```

If you want to unlock all features + any future features, think of it as an "all features unlocked override" (N.B. this will supersede any individual setting):

```objective-c
[GBFeatureManager enableWildcardFeatureOverride];
```

To turn off the "all features unlocked override":

```objective-c
[GBFeatureManager disableWildcardFeatureOverride];
```

To enabled features by default (e.g. Pro version), you can unlock some features directly in the Info.plist by adding it as a key to the Plist, prefixed by `GBFeatureManager:` and setting the value to a Boolean.

```xml
<key>GBFeatureManager:com.goonbee.proVersion</key>
<true/>
```

...normally you would do this in Xcode's Plist editor by simply adding a new row with the key `GBFeatureManager:com.goonbee.proVersion`, setting the type to `Boolean` and the value to either `YES` or `NO`.

Don't forget to import header, for iOS:

```objective-c
#import "GBFeatureManager.h"
```

... or on OSX:

```objective-c
#import <GBFeatureManager/GBFeatureManager.h>
```

Storage mechanics
------------

Features are each stored to disk in simple serialized NSNumber objects to the NSDocumentsDirectory on iOS, or NSApplicationSupportDirectory OS X.

When checking whether a feature is available, the disk is only accessed the first time, and the result is cached in memory, subsequent checks never hit the disk.

Dependencies
------------

* [GBToolbox](https://github.com/lmirosevic/GBToolbox)
* [GBStorageController](https://github.com/lmirosevic/GBStorageController)

iOS: Add to your project's workspace, add dependency for GBToolbox-iOS and GBStorageController-iOS, link with your binary, add -ObjC linker flag, add header search path.

OS X: Add to your project's workspace, add dependency for GBToolbox-OSX and GBStorageController-OSX, link with your binary, add "copy file" step to copy framework into bundle.

Copyright & License
------------

Copyright 2013 <NAME>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

{'fraction_non_alphanumeric': 0.11063191449465591, 'fraction_numerical': 0.0030001875117194824, 'mean_word_length': 4.544698544698544, 'pattern_counts': {'":': 2, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3883267', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1458, 'n_words': 641}