<commit_before>JBCoreDataAgent
===============

JBCoreDataAgent is meant to be an abstract class used to create subclasses to interface with a specific datamodel. JBCoreDataAgent can technically be used generically, but I do not think this would be the best use of it.

For an example: https://github.com/jbueler/CoreDataAgentExample

#### Need to add
* More helpers for adding, editing and deleting entities.
* Configure batch size in the fetchedResultsController.


#### Implementation
========
include JBCoreDataAgent in the project. In the app delegate or view controller `#import "JBCoreData.h"` make sure you have a `DataModel.xcdatamodeld` file. 
	
	- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
	{
		// Allocate and initialize the CoreDataObject 
		_coreDataAgent = [[JBCoreDataAgent alloc] initWithStoreName:@"DataModel"];
		
		// create a fetchedResultsController for an entity and a sortBy Key
		[_coreDataAgent fetchedResultsControllerWithEntityName:@"Person" sortByKey:@"lastname"];
		
		// Here you can assign create a reference to your root view controller
		MainViewController *vc = (MainViewController *) self.window.rootViewController;
		
		// Set the root views coreDataAgent to to the one created here in the appDelegate 
		[vc setCoreDataAgent: _coreDataAgent];		
		return YES;
	}


### Credit to:
<NAME> for kicking ass and coming up with this idea. https://github.com/drukepple

<commit_msg>Updated Readme.md to include cocoapod installation and updated example implementation<commit_after>JBCoreDataAgent
===============
CoreDataAgent - Helps wrangle all core data methods into one tidy little package. Makes adding core data to an existing project very simple. Creates NSFetchRequests and NSFetchedResultsControllers, quickly and easily

##### To install
**Cocoapods** [Visit cocoapods.org for installation instructions](http://cocoapods.org)

Add this to your Podfile.

    pod 'JBCoreDataAgent', git: "https://github.com/jbueler/JBCoreDataAgent", tag: '0.0.3'

**Without cocoapods**
Download the .h & .m files. Add them to your project. Make sure you add the CoreData framework if you don't already have it in the project. You will also need a datamodel file, where your entities are setup.


#### To Do:

* Add NSFetchRequest & NSFetchedResultsController management (create the ability to store multiple FRCs & FRs) within the CoreDataAgent.


#### Implementation
========
Once JBCoreDataAgent is included into the project and you have a `DataModel.xcdatamodeld` file with your entities described in it. You can import `JBCoreDataAgent.h`

  
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      // Allocate and initialize the CoreDataObject 
      JBCoreDataAgent *coreDataAgent = [[JBCoreDataAgent alloc] initWithStoreName:@"<#DataModel#>" andDelegate: <#NSFetchedResultsControllerDelegate#>];
      
      //Create a NSFetchRequest
      NSFetchRequest *fetchRequest = [coreDataAgent fetchRequest:@"<#EntityName#>" andSort:@"<#entity_attribute_to_sort_by#>" ascending:<#true#>];
      
      // Once you have the fetchRequest you can either perform the fetch with it, or create a NSFetchedResultsController and perform the fetch that way.
      //Perform fetch with fetchRequest
      // NSArray *resultsArray = [coreDataAgent performFetchWithFetchRequest: fetchRequest];
      
      // OR       
      // Perform fetch with NSFetchedResultsController (Good when dealing with UITableViews)
      NSFetchedResultsController *frc = [coreDataAgent fetchedResultsControllerWithFetchRequest: fetchRequest];
      [coreDataAgent performFetchWithFetchResultsController: frc];

      // DO WHATEVER YOU WANT ... 

      return YES;
    }


### Credit to:
<NAME> for kicking ass and coming up with this idea. https://github.com/drukepple


{'fraction_non_alphanumeric': 0.08750320759558634, 'fraction_numerical': 0.0007698229407236335, 'mean_word_length': 4.57653791130186, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '36245', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1023, 'n_words': 388}