mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-06-19 01:56:29 +08:00
Merge branch 'unit-testing' into xml-parser
Conflicts: RestKit.xcodeproj/project.pbxproj
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -14,7 +14,6 @@ DerivedData
|
||||
*.mode2v3
|
||||
*.pbxuser
|
||||
*.perspectivev3
|
||||
*.xcworkspace
|
||||
xcuserdata
|
||||
*.xcuserdatad
|
||||
|
||||
Examples/RKDiscussionBoardExample/discussion_board_backend/public/system/attachments/*
|
||||
|
||||
20
CREDITS.md
20
CREDITS.md
@@ -11,21 +11,23 @@ the terms of the Apache License (see LICENSE for details).
|
||||
|
||||
Original Author
|
||||
---------------
|
||||
* Blake Watters github.com/blakewatters @blakewatters
|
||||
* Blake Watters (blakewatters) @blakewatters
|
||||
|
||||
Core Team
|
||||
---------
|
||||
* Jeremy Ellison
|
||||
* Daniel Hammond
|
||||
* Jeff Arena
|
||||
* Jeremy Ellison (jeremyellison)
|
||||
* Daniel Hammond (danielrhammond)
|
||||
* Jeff Arena (jeffarena)
|
||||
|
||||
Web Designer
|
||||
------------
|
||||
* Adit Shukla
|
||||
* Adit Shukla (aditshukla)
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Marc Weil
|
||||
* Pat Shields
|
||||
* Tim Kerchmar
|
||||
* Rachit Shukla
|
||||
* Marc Weil (aspir)
|
||||
* Pat Shields (pashields)
|
||||
* Tim Kerchmar (timkerchmar)
|
||||
* Rachit Shukla (rachitshukla)
|
||||
* Adam Hinz (ahinz)
|
||||
* Stefan Eletzhofer (seletz)
|
||||
@@ -10,5 +10,5 @@
|
||||
#import "../ObjectMapping/ObjectMapping.h"
|
||||
#import "RKManagedObject.h"
|
||||
#import "RKManagedObjectStore.h"
|
||||
#import "RKObjectSeeder.h"
|
||||
#import "RKManagedObjectSeeder.h"
|
||||
#import "RKManagedObjectCache.h"
|
||||
68
Code/CoreData/RKManagedObjectSeeder.h
Normal file
68
Code/CoreData/RKManagedObjectSeeder.h
Normal file
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// RKManagedObjectSeeder.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "../ObjectMapping/ObjectMapping.h"
|
||||
|
||||
// The default seed database filename. Used when the object store has not been initialized
|
||||
extern NSString* const RKDefaultSeedDatabaseFileName;
|
||||
|
||||
@protocol RKManagedObjectSeederDelegate
|
||||
@required
|
||||
|
||||
// Invoked when the seeder creates a new object
|
||||
- (void)didSeedObject:(NSObject<RKObjectMappable>*)object fromFile:(NSString*)fileName;
|
||||
@end
|
||||
|
||||
/**
|
||||
* Provides an interface for generating a seed database suitable for initializing
|
||||
* a Core Data backed RestKit application. The object seeder loads files from the
|
||||
* application's main bundle and processes them with the Object Mapper to produce
|
||||
* a database on disk. This file can then be copied into the main bundle of an application
|
||||
* and provided to RKManagedObjectStore at initialization to start the app with a set of
|
||||
* data immediately available for use within Core Data.
|
||||
*/
|
||||
@interface RKManagedObjectSeeder : NSObject {
|
||||
RKObjectManager* _manager;
|
||||
NSObject<RKManagedObjectSeederDelegate>* _delegate;
|
||||
}
|
||||
|
||||
// Delegate for seeding operations
|
||||
@property (nonatomic, assign) NSObject<RKManagedObjectSeederDelegate>* delegate;
|
||||
|
||||
// Path to the generated seed database on disk
|
||||
@property (nonatomic, readonly) NSString* pathToSeedDatabase;
|
||||
|
||||
/**
|
||||
* Generates a seed database using an object manager and a null terminated list of files. Exits
|
||||
* the seeding process and outputs an informational message
|
||||
*/
|
||||
+ (void)generateSeedDatabaseWithObjectManager:(RKObjectManager*)objectManager fromFiles:(NSString*)fileName, ...;
|
||||
|
||||
/**
|
||||
* Returns an object seeder ready to begin seeding. Requires a fully configured instance of an object manager.
|
||||
*/
|
||||
+ (RKManagedObjectSeeder*)objectSeederWithObjectManager:(RKObjectManager*)objectManager;
|
||||
|
||||
/**
|
||||
* Seed the database with objects from the specified file(s). The list must be terminated by nil
|
||||
*/
|
||||
- (void)seedObjectsFromFiles:(NSString*)fileName, ...;
|
||||
|
||||
/**
|
||||
* Seed the database with objects from the specified file. Optionally use the specified mappable class and
|
||||
* keyPath to traverse the object graph before seeding
|
||||
*/
|
||||
- (void)seedObjectsFromFile:(NSString*)fileName toClass:(Class<RKObjectMappable>)nilOrMppableClass keyPath:(NSString*)nilOrKeyPath;
|
||||
|
||||
/**
|
||||
* Completes a seeding session by persisting the store, outputing an informational message
|
||||
* and exiting the process
|
||||
*/
|
||||
- (void)finalizeSeedingAndExit;
|
||||
|
||||
@end
|
||||
139
Code/CoreData/RKManagedObjectSeeder.m
Normal file
139
Code/CoreData/RKManagedObjectSeeder.m
Normal file
@@ -0,0 +1,139 @@
|
||||
//
|
||||
// RKObjectSeeder.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKManagedObjectSeeder.h"
|
||||
#import "RKManagedObjectStore.h"
|
||||
|
||||
@interface RKManagedObjectSeeder (Private)
|
||||
- (id)initWithObjectManager:(RKObjectManager*)manager;
|
||||
- (void)seedObjectsFromFileNames:(NSArray*)fileNames;
|
||||
@end
|
||||
|
||||
NSString* const RKDefaultSeedDatabaseFileName = @"RKSeedDatabase.sqlite";
|
||||
|
||||
@implementation RKManagedObjectSeeder
|
||||
|
||||
@synthesize delegate = _delegate;
|
||||
|
||||
+ (void)generateSeedDatabaseWithObjectManager:(RKObjectManager*)objectManager fromFiles:(NSString*)firstFileName, ... {
|
||||
RKManagedObjectSeeder* seeder = [RKManagedObjectSeeder objectSeederWithObjectManager:objectManager];
|
||||
|
||||
va_list args;
|
||||
va_start(args, firstFileName);
|
||||
NSMutableArray* fileNames = [NSMutableArray array];
|
||||
for (NSString* fileName = firstFileName; fileName != nil; fileName = va_arg(args, id)) {
|
||||
[fileNames addObject:fileName];
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
// Seed the files
|
||||
for (NSString* fileName in fileNames) {
|
||||
[seeder seedObjectsFromFile:fileName toClass:nil keyPath:nil];
|
||||
}
|
||||
|
||||
[seeder finalizeSeedingAndExit];
|
||||
}
|
||||
|
||||
+ (RKManagedObjectSeeder*)objectSeederWithObjectManager:(RKObjectManager*)objectManager {
|
||||
return [[[RKManagedObjectSeeder alloc] initWithObjectManager:objectManager] autorelease];
|
||||
}
|
||||
|
||||
- (id)initWithObjectManager:(RKObjectManager*)manager {
|
||||
self = [self init];
|
||||
if (self) {
|
||||
_manager = [manager retain];
|
||||
|
||||
// If the user hasn't configured an object store, set one up for them
|
||||
if (nil == _manager.objectStore) {
|
||||
_manager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:RKDefaultSeedDatabaseFileName];
|
||||
}
|
||||
|
||||
// Delete any existing persistent store
|
||||
[_manager.objectStore deletePersistantStore];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_manager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString*)pathToSeedDatabase {
|
||||
return _manager.objectStore.pathToStoreFile;
|
||||
}
|
||||
|
||||
- (void)seedObjectsFromFiles:(NSString*)firstFileName, ... {
|
||||
va_list args;
|
||||
va_start(args, firstFileName);
|
||||
NSMutableArray* fileNames = [NSMutableArray array];
|
||||
for (NSString* fileName = firstFileName; fileName != nil; fileName = va_arg(args, id)) {
|
||||
[fileNames addObject:fileName];
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
for (NSString* fileName in fileNames) {
|
||||
[self seedObjectsFromFile:fileName toClass:nil keyPath:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)seedObjectsFromFile:(NSString*)fileName toClass:(Class<RKObjectMappable>)nilOrMppableClass keyPath:(NSString*)nilOrKeyPath {
|
||||
NSError* error = nil;
|
||||
NSArray* mappedObjects;
|
||||
NSString* filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:nil];
|
||||
NSString* payload = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
|
||||
|
||||
if (nil == error) {
|
||||
// TODO: When we support multiple parsers, we should auto-detect the MIME Type from the file extension
|
||||
// and pass it through to the mapper
|
||||
id objects = [_manager.mapper parseString:payload];
|
||||
NSAssert1(objects != nil, @"Unable to parse data from file %@", filePath);
|
||||
if (nilOrKeyPath) {
|
||||
objects = [objects valueForKeyPath:nilOrKeyPath];
|
||||
}
|
||||
NSAssert1([objects isKindOfClass:[NSArray class]], @"Expected an NSArray of objects, got %@", objects);
|
||||
NSAssert1([[objects objectAtIndex:0] isKindOfClass:[NSDictionary class]], @"Expected an array of NSDictionaries, got %@", [objects objectAtIndex:0]);
|
||||
|
||||
if (nilOrMppableClass) {
|
||||
mappedObjects = [_manager.mapper mapObjectsFromArrayOfDictionaries:objects toClass:nilOrMppableClass];
|
||||
} else {
|
||||
mappedObjects = [_manager.mapper mapObjectsFromArrayOfDictionaries:objects];
|
||||
}
|
||||
|
||||
// Inform the delegate
|
||||
if (self.delegate) {
|
||||
for (NSObject<RKObjectMappable>* object in mappedObjects) {
|
||||
[self.delegate didSeedObject:object fromFile:fileName];
|
||||
}
|
||||
}
|
||||
|
||||
NSLog(@"[RestKit] RKManagedObjectSeeder: Seeded %d objects from %@...", [mappedObjects count], [NSString stringWithFormat:@"%@", fileName]);
|
||||
} else {
|
||||
NSLog(@"Unable to read file %@: %@", fileName, [error localizedDescription]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)finalizeSeedingAndExit {
|
||||
NSError* error = [[_manager objectStore] save];
|
||||
if (error != nil) {
|
||||
NSLog(@"[RestKit] RKManagedObjectSeeder: Error saving object context: %@", [error localizedDescription]);
|
||||
}
|
||||
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString* basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
|
||||
NSString* storeFileName = [[_manager objectStore] storeFilename];
|
||||
NSString* destinationPath = [basePath stringByAppendingPathComponent:storeFileName];
|
||||
NSLog(@"[RestKit] RKManagedObjectSeeder: A seeded database has been generated at '%@'. "
|
||||
@"Please execute `open \"%@\"` in your Terminal and copy %@ to your app. Be sure to add the seed database to your \"Copy Resources\" build phase.",
|
||||
destinationPath, basePath, storeFileName);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -24,14 +24,25 @@ extern NSString* const RKManagedObjectStoreDidFailSaveNotification;
|
||||
NSObject<RKManagedObjectCache>* _managedObjectCache;
|
||||
}
|
||||
|
||||
// The filename of the database backing this object store
|
||||
@property (nonatomic, readonly) NSString* storeFilename;
|
||||
|
||||
// The full path to the database backing this object store
|
||||
@property (nonatomic, readonly) NSString* pathToStoreFile;
|
||||
|
||||
// Core Data
|
||||
@property (nonatomic, readonly) NSManagedObjectModel* managedObjectModel;
|
||||
@property (nonatomic, readonly) NSPersistentStoreCoordinator* persistentStoreCoordinator;
|
||||
|
||||
/**
|
||||
* Managed object cache provides support for automatic removal of objects pruned
|
||||
* from a server side load. Also used to provide offline object loading
|
||||
*/
|
||||
@property (nonatomic, retain) NSObject<RKManagedObjectCache>* managedObjectCache;
|
||||
|
||||
/*
|
||||
* This returns an appropriate managed object context for this object store.
|
||||
* Because of the intrecacies of how CoreData works across threads it returns
|
||||
* Because of the intrecacies of how Core Data works across threads it returns
|
||||
* a different NSManagedObjectContext for each thread.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSManagedObjectContext* managedObjectContext;
|
||||
@@ -39,7 +50,20 @@ extern NSString* const RKManagedObjectStoreDidFailSaveNotification;
|
||||
/**
|
||||
* Initialize a new managed object store with a SQLite database with the filename specified
|
||||
*/
|
||||
- (id)initWithStoreFilename:(NSString*)storeFilename;
|
||||
+ (RKManagedObjectStore*)objectStoreWithStoreFilename:(NSString*)storeFilename;
|
||||
|
||||
/**
|
||||
* Initialize a new managed object store backed by a SQLite database with the specified filename. If a seed database name is provided
|
||||
* and no existing database is found, initialize the store by copying the seed database from the main bundle. If the managed object model
|
||||
* provided is nil, all models will be merged from the main bundle for you.
|
||||
*/
|
||||
+ (RKManagedObjectStore*)objectStoreWithStoreFilename:(NSString *)storeFilename usingSeedDatabaseName:(NSString *)nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:(NSManagedObjectModel*)nilOrManagedObjectModel;
|
||||
|
||||
/**
|
||||
* Initialize a new managed object store with a SQLite database with the filename specified
|
||||
* @deprecated
|
||||
*/
|
||||
- (id)initWithStoreFilename:(NSString*)storeFilename DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
* Save the current contents of the managed object store
|
||||
@@ -71,5 +95,4 @@ extern NSString* const RKManagedObjectStoreDidFailSaveNotification;
|
||||
*/
|
||||
- (RKManagedObject*)findOrCreateInstanceOfManagedObject:(Class)class withPrimaryKeyValue:(id)primaryKeyValue;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -13,7 +13,9 @@ NSString* const RKManagedObjectStoreDidFailSaveNotification = @"RKManagedObjectS
|
||||
static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
|
||||
@interface RKManagedObjectStore (Private)
|
||||
- (id)initWithStoreFilename:(NSString *)storeFilename usingSeedDatabaseName:(NSString *)nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:(NSManagedObjectModel*)nilOrManagedObjectModel;
|
||||
- (void)createPersistentStoreCoordinator;
|
||||
- (void)createStoreIfNecessaryUsingSeedDatabase:(NSString*)seedDatabase;
|
||||
- (NSString *)applicationDocumentsDirectory;
|
||||
- (NSManagedObjectContext*)newManagedObjectContext;
|
||||
@end
|
||||
@@ -25,18 +27,38 @@ static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
|
||||
@synthesize managedObjectCache = _managedObjectCache;
|
||||
|
||||
+ (RKManagedObjectStore*)objectStoreWithStoreFilename:(NSString*)storeFilename {
|
||||
return [self objectStoreWithStoreFilename:storeFilename usingSeedDatabaseName:nil managedObjectModel:nil];
|
||||
}
|
||||
|
||||
+ (RKManagedObjectStore*)objectStoreWithStoreFilename:(NSString *)storeFilename usingSeedDatabaseName:(NSString *)nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:(NSManagedObjectModel*)nilOrManagedObjectModel {
|
||||
return [[[self alloc] initWithStoreFilename:storeFilename usingSeedDatabaseName:nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:nilOrManagedObjectModel] autorelease];
|
||||
}
|
||||
|
||||
- (id)initWithStoreFilename:(NSString*)storeFilename {
|
||||
if (self = [self init]) {
|
||||
return self = [self initWithStoreFilename:storeFilename usingSeedDatabaseName:nil managedObjectModel:nil];
|
||||
}
|
||||
|
||||
- (id)initWithStoreFilename:(NSString *)storeFilename usingSeedDatabaseName:(NSString *)nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:(NSManagedObjectModel*)nilOrManagedObjectModel {
|
||||
self = [self init];
|
||||
if (self) {
|
||||
_storeFilename = [storeFilename retain];
|
||||
_managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];
|
||||
if (nilOrManagedObjectModel == nil) {
|
||||
nilOrManagedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
|
||||
}
|
||||
_managedObjectModel = [nilOrManagedObjectModel retain];
|
||||
if (nilOrNameOfSeedDatabaseInMainBundle) {
|
||||
[self createStoreIfNecessaryUsingSeedDatabase:nilOrNameOfSeedDatabaseInMainBundle];
|
||||
}
|
||||
[self createPersistentStoreCoordinator];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
[_storeFilename release];
|
||||
_storeFilename = nil;
|
||||
[_managedObjectModel release];
|
||||
@@ -45,6 +67,7 @@ static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
_persistentStoreCoordinator = nil;
|
||||
[_managedObjectCache release];
|
||||
_managedObjectCache = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -90,8 +113,26 @@ static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
return managedObjectContext;
|
||||
}
|
||||
|
||||
- (NSString*)pathToStoreFile {
|
||||
return [[self applicationDocumentsDirectory] stringByAppendingPathComponent:self.storeFilename];
|
||||
}
|
||||
|
||||
- (void)createStoreIfNecessaryUsingSeedDatabase:(NSString*)seedDatabase {
|
||||
NSError* error = nil;
|
||||
if (NO == [[NSFileManager defaultManager] fileExistsAtPath:self.pathToStoreFile]) {
|
||||
NSString* seedDatabasePath = [[NSBundle mainBundle] pathForResource:seedDatabase ofType:nil];
|
||||
NSAssert1(seedDatabasePath, @"Unable to find seed database file '%@' in the Main Bundle, aborting...", seedDatabase);
|
||||
NSLog(@"No existing database found, copying from seed path '%@'", seedDatabasePath);
|
||||
[[NSFileManager defaultManager] copyItemAtPath:seedDatabasePath toPath:self.pathToStoreFile error:&error];
|
||||
if (error) {
|
||||
NSLog(@"Encountered an error during seed database copy: %@", [error localizedDescription]);
|
||||
}
|
||||
NSAssert1([[NSFileManager defaultManager] fileExistsAtPath:seedDatabasePath], @"Seed database not found at path '%@'!", seedDatabasePath);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createPersistentStoreCoordinator {
|
||||
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent:_storeFilename]];
|
||||
NSURL *storeUrl = [NSURL fileURLWithPath:self.pathToStoreFile];
|
||||
|
||||
NSError *error;
|
||||
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:_managedObjectModel];
|
||||
@@ -107,7 +148,7 @@ static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
}
|
||||
|
||||
- (void)deletePersistantStore {
|
||||
NSURL* storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent:_storeFilename]];
|
||||
NSURL* storeUrl = [NSURL fileURLWithPath:self.pathToStoreFile];
|
||||
NSError* error = nil;
|
||||
NSLog(@"Error removing persistant store: %@", [error localizedDescription]);
|
||||
if (error) {
|
||||
@@ -123,7 +164,9 @@ static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
|
||||
// Clear the current managed object context. Will be re-created next time it is accessed.
|
||||
NSMutableDictionary* threadDictionary = [[NSThread currentThread] threadDictionary];
|
||||
[threadDictionary setObject:nil forKey:kRKManagedObjectContextKey];
|
||||
if ([threadDictionary objectForKey:kRKManagedObjectContextKey]) {
|
||||
[threadDictionary setNilValueForKey:kRKManagedObjectContextKey];
|
||||
}
|
||||
|
||||
[self createPersistentStoreCoordinator];
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
//
|
||||
// RKObjectSeeder.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "../ObjectMapping/ObjectMapping.h"
|
||||
|
||||
// TODO: This class needs an API scrubbing
|
||||
@interface RKObjectSeeder : NSObject {
|
||||
RKObjectManager* _manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a new object seeder
|
||||
*/
|
||||
- (id)initWithObjectManager:(RKObjectManager*)manager;
|
||||
|
||||
/**
|
||||
* Read a file from the main bundle and seed the database with its contents.
|
||||
* Returns the array of model objects built from the file.
|
||||
*/
|
||||
- (NSArray*)seedDatabaseWithBundledFile:(NSString*)fileName ofType:(NSString*)type;
|
||||
|
||||
/**
|
||||
* Seeds the database with an array of files of the specified type
|
||||
*/
|
||||
- (void)seedDatabaseWithBundledFiles:(NSArray*)fileNames ofType:(NSString*)type;
|
||||
|
||||
/**
|
||||
* Seed a specific object class with data from a file
|
||||
*/
|
||||
- (void)seedObjectsFromFile:(NSString*)fileName ofType:(NSString*)type toClass:(Class)theClass keyPath:(NSString*)keyPath;
|
||||
|
||||
/**
|
||||
* Completes a seeding session by persisting the store, outputing an informational message
|
||||
* and exiting the process
|
||||
*/
|
||||
- (void)finalizeSeedingAndExit;
|
||||
|
||||
@end
|
||||
@@ -1,81 +0,0 @@
|
||||
//
|
||||
// RKObjectSeeder.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKObjectSeeder.h"
|
||||
#import "RKManagedObjectStore.h"
|
||||
|
||||
@implementation RKObjectSeeder
|
||||
|
||||
- (id)initWithObjectManager:(RKObjectManager*)manager {
|
||||
if (self = [self init]) {
|
||||
_manager = [manager retain];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_manager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray*)seedDatabaseWithBundledFile:(NSString*)fileName ofType:(NSString*)type {
|
||||
NSError* error = nil;
|
||||
NSString* filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:type];
|
||||
NSString* payload = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
|
||||
if (nil == error) {
|
||||
return [[_manager mapper] mapFromString:payload];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)seedDatabaseWithBundledFiles:(NSArray*)fileNames ofType:(NSString*)type {
|
||||
NSLog(@"[RestKit] RKModelSeeder: Seeding database with contents of %d %@ files...", [fileNames count], [type uppercaseString]);
|
||||
for (NSString* fileName in fileNames) {
|
||||
NSArray* objects = [self seedDatabaseWithBundledFile:fileName ofType:type];
|
||||
NSLog(@"[RestKit] RKModelSeeder: Seeded %d objects from %@...", [objects count], [NSString stringWithFormat:@"%@.%@", fileName, type]);
|
||||
}
|
||||
|
||||
[self finalizeSeedingAndExit];
|
||||
}
|
||||
|
||||
- (void)seedObjectsFromFile:(NSString*)fileName ofType:(NSString*)type toClass:(Class)theClass keyPath:(NSString*)keyPath {
|
||||
NSError* error = nil;
|
||||
NSString* filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:type];
|
||||
NSString* payload = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
|
||||
if (nil == error) {
|
||||
id objects = [_manager.mapper parseString:payload];
|
||||
NSAssert1(objects != nil, @"Unable to parse data from file %@", filePath);
|
||||
id parseableObjects = [objects valueForKeyPath:keyPath];
|
||||
NSAssert1([parseableObjects isKindOfClass:[NSArray class]], @"Expected an NSArray of objects, got %@", objects);
|
||||
NSAssert1([[parseableObjects objectAtIndex:0] isKindOfClass:[NSDictionary class]], @"Expected an array of NSDictionaries, got %@", [objects objectAtIndex:0]);
|
||||
|
||||
NSArray* mappedObjects = [_manager.mapper mapObjectsFromArrayOfDictionaries:parseableObjects toClass:theClass];
|
||||
NSLog(@"[RestKit] RKModelSeeder: Seeded %d objects from %@...", [mappedObjects count], [NSString stringWithFormat:@"%@.%@", fileName, type]);
|
||||
} else {
|
||||
NSLog(@"Unable to read file %@ with type %@: %@", fileName, type, [error localizedDescription]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)finalizeSeedingAndExit {
|
||||
NSError* error = [[_manager objectStore] save];
|
||||
if (error != nil) {
|
||||
NSLog(@"[RestKit] RKModelSeeder: Error saving object context: %@", [error localizedDescription]);
|
||||
}
|
||||
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString* basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
|
||||
NSString* storeFileName = [[_manager objectStore] storeFilename];
|
||||
NSString* destinationPath = [basePath stringByAppendingPathComponent:storeFileName];
|
||||
NSLog(@"[RestKit] RKModelSeeder: A Pre-loaded database has been generated at %@. Please copy into Resources/", destinationPath);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -180,6 +180,12 @@
|
||||
_isLoading = YES;
|
||||
payload = [NSURLConnection sendSynchronousRequest:_URLRequest returningResponse:&URLResponse error:&error];
|
||||
response = [[[RKResponse alloc] initWithSynchronousRequest:self URLResponse:URLResponse body:payload error:error] autorelease];
|
||||
|
||||
if (error) {
|
||||
[self didFailLoadWithError:error];
|
||||
} else {
|
||||
[self didFinishLoad:response];
|
||||
}
|
||||
} else {
|
||||
NSString* errorMessage = [NSString stringWithFormat:@"The client is unable to contact the resource at %@", [[self URL] absoluteString]];
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
@implementation RKDynamicRouter
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
if ((self = [super init])) {
|
||||
_routes = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
NSDictionary* classRoutes = [_routes objectForKey:className];
|
||||
|
||||
NSString* resourcePath = nil;
|
||||
if (resourcePath = [classRoutes objectForKey:methodName]) {
|
||||
if ((resourcePath = [classRoutes objectForKey:methodName])) {
|
||||
return RKMakePathWithObject(resourcePath, object);
|
||||
}
|
||||
|
||||
if (resourcePath = [classRoutes objectForKey:@"ANY"]) {
|
||||
if ((resourcePath = [classRoutes objectForKey:@"ANY"])) {
|
||||
return RKMakePathWithObject(resourcePath, object);
|
||||
}
|
||||
|
||||
@@ -94,6 +94,13 @@
|
||||
}
|
||||
|
||||
- (NSObject<RKRequestSerializable>*)serializationForObject:(NSObject<RKObjectMappable>*)object method:(RKRequestMethod)method {
|
||||
// Don't return a serialization for a GET request
|
||||
// There is an extensive discussion about this on the ASIHTTPRequest list
|
||||
// See http://groups.google.com/group/asihttprequest/browse_thread/thread/ef79a8333dde6acb
|
||||
if (method == RKRequestMethodGET) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// By default return a form encoded serializable dictionary
|
||||
return [object propertiesForSerialization];
|
||||
}
|
||||
|
||||
@@ -57,11 +57,22 @@ typedef enum {
|
||||
*/
|
||||
+ (RKObjectManager*)objectManagerWithBaseURL:(NSString*)baseURL;
|
||||
|
||||
/**
|
||||
* Create and initialize a new object manager. If this is the first instance created
|
||||
* it will be set as the shared instance
|
||||
*/
|
||||
+ (RKObjectManager*)objectManagerWithBaseURL:(NSString*)baseURL objectMapper:(RKObjectMapper*)mapper router:(NSObject<RKRouter>*)router;
|
||||
|
||||
/**
|
||||
* Initialize a new model manager instance
|
||||
*/
|
||||
- (id)initWithBaseURL:(NSString*)baseURL;
|
||||
|
||||
/**
|
||||
* Initialize a new model manager instance
|
||||
*/
|
||||
- (id)initWithBaseURL:(NSString*)baseURL objectMapper:(RKObjectMapper*)mapper router:(NSObject<RKRouter>*)router;
|
||||
|
||||
/**
|
||||
* The wire format to use for communications. Either RKMappingFormatXML or RKMappingFormatJSON.
|
||||
*
|
||||
|
||||
@@ -28,10 +28,15 @@ static RKObjectManager* sharedManager = nil;
|
||||
@synthesize router = _router;
|
||||
|
||||
- (id)initWithBaseURL:(NSString*)baseURL {
|
||||
return self = [self initWithBaseURL:baseURL objectMapper:[[[RKObjectMapper alloc] init] autorelease] router:[[[RKDynamicRouter alloc] init] autorelease]];
|
||||
}
|
||||
|
||||
- (id)initWithBaseURL:(NSString*)baseURL objectMapper:(RKObjectMapper*)mapper router:(NSObject<RKRouter>*)router {
|
||||
if (self = [super init]) {
|
||||
_mapper = [[RKObjectMapper alloc] init];
|
||||
_router = [[RKDynamicRouter alloc] init];
|
||||
_mapper = [mapper retain];
|
||||
_router = [router retain];
|
||||
_client = [[RKClient clientWithBaseURL:baseURL] retain];
|
||||
|
||||
self.format = RKMappingFormatJSON;
|
||||
_onlineState = RKObjectManagerOnlineStateUndetermined;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
@@ -64,6 +69,14 @@ static RKObjectManager* sharedManager = nil;
|
||||
sharedManager = manager;
|
||||
}
|
||||
|
||||
+ (RKObjectManager*)objectManagerWithBaseURL:(NSString*)baseURL objectMapper:(RKObjectMapper*)mapper router:(NSObject<RKRouter>*)router {
|
||||
RKObjectManager* manager = [[[RKObjectManager alloc] initWithBaseURL:baseURL objectMapper:mapper router:router] autorelease];
|
||||
if (nil == sharedManager) {
|
||||
[RKObjectManager setSharedManager:manager];
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
+ (RKObjectManager*)objectManagerWithBaseURL:(NSString*)baseURL {
|
||||
RKObjectManager* manager = [[[RKObjectManager alloc] initWithBaseURL:baseURL] autorelease];
|
||||
if (nil == sharedManager) {
|
||||
|
||||
@@ -27,7 +27,6 @@ static const NSString* kRKModelMapperXMLMappingFormatParserKey = @"RKXMLMappingF
|
||||
@interface RKObjectMapper (Private)
|
||||
|
||||
- (id)parseString:(NSString*)string;
|
||||
- (void)updateModel:(id)model fromElements:(NSDictionary*)elements;
|
||||
|
||||
- (Class)typeClassForProperty:(NSString*)property ofClass:(Class)class;
|
||||
- (NSDictionary*)elementToPropertyMappingsForModel:(id)model;
|
||||
@@ -36,9 +35,9 @@ static const NSString* kRKModelMapperXMLMappingFormatParserKey = @"RKXMLMappingF
|
||||
- (id)createOrUpdateInstanceOfModelClass:(Class)class fromElements:(NSDictionary*)elements;
|
||||
|
||||
- (void)updateModel:(id)model ifNewPropertyValue:(id)propertyValue forPropertyNamed:(NSString*)propertyName; // Rename!
|
||||
- (void)updateModel:(id)model fromElements:(NSDictionary*)elements;
|
||||
- (void)setPropertiesOfModel:(id)model fromElements:(NSDictionary*)elements;
|
||||
- (void)setRelationshipsOfModel:(id)object fromElements:(NSDictionary*)elements;
|
||||
- (void)updateModel:(id)model fromElements:(NSDictionary*)elements;
|
||||
|
||||
- (NSDate*)parseDateFromString:(NSString*)string;
|
||||
- (NSDate*)dateInLocalTime:(NSDate*)date;
|
||||
@@ -401,14 +400,22 @@ static const NSString* kRKModelMapperXMLMappingFormatParserKey = @"RKXMLMappingF
|
||||
@catch (NSException* e) {
|
||||
NSLog(@"Caught exception:%@ when trying valueForKeyPath with path:%@ for elements:%@", e, elementKeyPath, elements);
|
||||
}
|
||||
|
||||
// TODO: Need to send NSSet or NSArray depending on what the property type is...
|
||||
|
||||
// NOTE: The last part of the keyPath contains the elementName for the mapped destination class of our children
|
||||
NSArray* componentsOfKeyPath = [elementKeyPath componentsSeparatedByString:@"."];
|
||||
NSString *className = [componentsOfKeyPath objectAtIndex:[componentsOfKeyPath count] - 1];
|
||||
Class modelClass = [_elementToClassMappings objectForKey:className];
|
||||
if ([modelClass isKindOfClass: [NSNull class]]) {
|
||||
NSLog(@"Warning: could not find a class mapping for relationship '%@':", className);
|
||||
NSLog(@" parent class : %@", [object class]);
|
||||
NSLog(@" elements to map: %@", elements);
|
||||
NSLog(@"maybe you want to register your model with the object mapper or you want to pluralize the keypath?");
|
||||
break;
|
||||
}
|
||||
|
||||
Class collectionClass = [self typeClassForProperty:propertyName ofClass:[object class]];
|
||||
// if ([relationshipElements isKindOfClass:[NSArray class]] || [relationshipElements isKindOfClass:[NSSet class]]) {
|
||||
if ([collectionClass isSubclassOfClass:[NSSet class]] || [collectionClass isSubclassOfClass:[NSArray class]]) {
|
||||
// NOTE: The last part of the keyPath contains the elementName for the mapped destination class of our children
|
||||
NSArray* componentsOfKeyPath = [elementKeyPath componentsSeparatedByString:@"."];
|
||||
Class class = [_elementToClassMappings objectForKey:[componentsOfKeyPath objectAtIndex:[componentsOfKeyPath count] - 1]];
|
||||
if ([collectionClass isSubclassOfClass:[NSSet class]] || [collectionClass isSubclassOfClass:[NSArray class]])
|
||||
{
|
||||
id children = nil;
|
||||
if ([collectionClass isSubclassOfClass:[NSSet class]]) {
|
||||
children = [NSMutableSet setWithCapacity:[relationshipElements count]];
|
||||
@@ -416,45 +423,44 @@ static const NSString* kRKModelMapperXMLMappingFormatParserKey = @"RKXMLMappingF
|
||||
children = [NSMutableArray arrayWithCapacity:[relationshipElements count]];
|
||||
}
|
||||
|
||||
for (NSDictionary* childElements in relationshipElements) {
|
||||
id child = [self createOrUpdateInstanceOfModelClass:class fromElements:childElements];
|
||||
if (child) {
|
||||
[(NSMutableArray*)children addObject:child];
|
||||
}
|
||||
}
|
||||
|
||||
[object setValue:children forKey:propertyName];
|
||||
} else if ([relationshipElements isKindOfClass:[NSDictionary class]]) {
|
||||
NSArray* componentsOfKeyPath = [elementKeyPath componentsSeparatedByString:@"."];
|
||||
Class class = [_elementToClassMappings objectForKey:[componentsOfKeyPath objectAtIndex:[componentsOfKeyPath count] - 1]];
|
||||
id child = [self createOrUpdateInstanceOfModelClass:class fromElements:relationshipElements];
|
||||
[object setValue:child forKey:propertyName];
|
||||
}
|
||||
}
|
||||
|
||||
if ([object isKindOfClass:[RKManagedObject class]]) {
|
||||
RKManagedObject* managedObject = (RKManagedObject*)object;
|
||||
NSDictionary* relationshipToPkPropertyMappings = [[managedObject class] relationshipToPrimaryKeyPropertyMappings];
|
||||
for (NSString* relationship in relationshipToPkPropertyMappings) {
|
||||
NSString* primaryKeyPropertyString = [relationshipToPkPropertyMappings objectForKey:relationship];
|
||||
|
||||
NSNumber* objectPrimaryKeyValue = nil;
|
||||
@try {
|
||||
objectPrimaryKeyValue = [managedObject valueForKeyPath:primaryKeyPropertyString];
|
||||
} @catch (NSException* e) {
|
||||
NSLog(@"Caught exception:%@ when trying valueForKeyPath with path:%@ for object:%@", e, primaryKeyPropertyString, managedObject);
|
||||
}
|
||||
|
||||
NSDictionary* relationshipsByName = [[managedObject entity] relationshipsByName];
|
||||
NSEntityDescription* relationshipDestinationEntity = [[relationshipsByName objectForKey:relationship] destinationEntity];
|
||||
id relationshipDestinationClass = objc_getClass([[relationshipDestinationEntity managedObjectClassName] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
RKManagedObject* relationshipValue = [[[RKObjectManager sharedManager] objectStore] findOrCreateInstanceOfManagedObject:relationshipDestinationClass
|
||||
for (NSDictionary* childElements in relationshipElements) {
|
||||
id child = [self createOrUpdateInstanceOfModelClass:modelClass fromElements:childElements];
|
||||
if (child) {
|
||||
[(NSMutableArray*)children addObject:child];
|
||||
}
|
||||
}
|
||||
|
||||
[object setValue:children forKey:propertyName];
|
||||
} else if ([relationshipElements isKindOfClass:[NSDictionary class]]) {
|
||||
id child = [self createOrUpdateInstanceOfModelClass:modelClass fromElements:relationshipElements];
|
||||
[object setValue:child forKey:propertyName];
|
||||
}
|
||||
|
||||
}
|
||||
if ([object isKindOfClass:[RKManagedObject class]]) {
|
||||
RKManagedObject* managedObject = (RKManagedObject*)object;
|
||||
NSDictionary* relationshipToPkPropertyMappings = [[managedObject class] relationshipToPrimaryKeyPropertyMappings];
|
||||
for (NSString* relationship in relationshipToPkPropertyMappings) {
|
||||
NSString* primaryKeyPropertyString = [relationshipToPkPropertyMappings objectForKey:relationship];
|
||||
|
||||
NSNumber* objectPrimaryKeyValue = nil;
|
||||
@try {
|
||||
objectPrimaryKeyValue = [managedObject valueForKeyPath:primaryKeyPropertyString];
|
||||
} @catch (NSException* e) {
|
||||
NSLog(@"Caught exception:%@ when trying valueForKeyPath with path:%@ for object:%@", e, primaryKeyPropertyString, managedObject);
|
||||
}
|
||||
|
||||
NSDictionary* relationshipsByName = [[managedObject entity] relationshipsByName];
|
||||
NSEntityDescription* relationshipDestinationEntity = [[relationshipsByName objectForKey:relationship] destinationEntity];
|
||||
id relationshipDestinationClass = objc_getClass([[relationshipDestinationEntity managedObjectClassName] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
RKManagedObject* relationshipValue = [[[RKObjectManager sharedManager] objectStore] findOrCreateInstanceOfManagedObject:relationshipDestinationClass
|
||||
withPrimaryKeyValue:objectPrimaryKeyValue];
|
||||
if (relationshipValue) {
|
||||
[managedObject setValue:relationshipValue forKey:relationship];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (relationshipValue) {
|
||||
[managedObject setValue:relationshipValue forKey:relationship];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)updateModel:(id)model fromElements:(NSDictionary*)elements {
|
||||
|
||||
@@ -246,7 +246,7 @@ static NSString* const kDefaultLoadedTimeKey = @"RKRequestTTModelDefaultLoadedTi
|
||||
|
||||
if (!store.managedObjectCache || !cacheFetchRequests || _cacheLoaded ||
|
||||
([cachedObjects count] == 0 && [[RKObjectManager sharedManager] isOnline])) {
|
||||
RKObjectLoader* objectLoader = [[[RKObjectManager sharedManager] objectLoaderWithResourcePath:_resourcePath delegate:self] retain];
|
||||
RKObjectLoader* objectLoader = [[RKObjectManager sharedManager] objectLoaderWithResourcePath:_resourcePath delegate:self];
|
||||
objectLoader.method = self.method;
|
||||
objectLoader.objectClass = _objectClass;
|
||||
objectLoader.keyPath = _keyPath;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:DiscussionBoard.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
7
Examples/RKTwitter/RKTwitter.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
Examples/RKTwitter/RKTwitter.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:RKTwitter.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import <RestKit/CoreData/CoreData.h>
|
||||
#import "RKTwitterAppDelegate.h"
|
||||
#import "RKTwitterViewController.h"
|
||||
#import "RKTStatus.h"
|
||||
@@ -17,25 +18,46 @@
|
||||
#pragma mark -
|
||||
#pragma mark Application lifecycle
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// Initialize RestKit
|
||||
RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://twitter.com"];
|
||||
RKObjectMapper* mapper = objectManager.mapper;
|
||||
|
||||
// Initialize object store
|
||||
objectManager.objectStore = [[[RKManagedObjectStore alloc] initWithStoreFilename:@"RKTwitterData.sqlite"] autorelease];
|
||||
|
||||
// Add our element to object mappings
|
||||
[mapper registerClass:[RKTUser class] forElementNamed:@"user"];
|
||||
[mapper registerClass:[RKTStatus class] forElementNamed:@"status"];
|
||||
|
||||
// Update date format so that we can parse twitter dates properly
|
||||
RKObjectMapper* mapper = objectManager.mapper;
|
||||
|
||||
// Update date format so that we can parse twitter dates properly
|
||||
// Wed Sep 29 15:31:08 +0000 2010
|
||||
NSMutableArray* dateFormats = [[[mapper dateFormats] mutableCopy] autorelease];
|
||||
[dateFormats addObject:@"E MMM d HH:mm:ss Z y"];
|
||||
[mapper setDateFormats:dateFormats];
|
||||
|
||||
|
||||
// Add our element to object mappings
|
||||
[mapper registerClass:[RKTUser class] forElementNamed:@"user"];
|
||||
[mapper registerClass:[RKTStatus class] forElementNamed:@"status"];
|
||||
|
||||
// Database seeding is configured as a copied target of the main application. There are only two differences
|
||||
// between the main application target and the 'Generate Seed Database' target:
|
||||
// 1) RESTKIT_GENERATE_SEED_DB is defined in the 'Preprocessor Macros' section of the build setting for the target
|
||||
// This is what triggers the conditional compilation to cause the seed database to be built
|
||||
// 2) Source JSON files are added to the 'Generate Seed Database' target to be copied into the bundle. This is required
|
||||
// so that the object seeder can find the files when run in the simulator.
|
||||
#ifdef RESTKIT_GENERATE_SEED_DB
|
||||
RKManagedObjectSeeder* seeder = [RKManagedObjectSeeder objectSeederWithObjectManager:objectManager];
|
||||
|
||||
// Seed the database with instances of RKTStatus from a snapshot of the RestKit Twitter timeline
|
||||
[seeder seedObjectsFromFile:@"restkit.json" toClass:[RKTStatus class] keyPath:nil];
|
||||
|
||||
// Seed the database with RKTUser objects. The class will be inferred via element registration
|
||||
[seeder seedObjectsFromFiles:@"users.json", nil];
|
||||
|
||||
// Finalize the seeding operation and output a helpful informational message
|
||||
[seeder finalizeSeedingAndExit];
|
||||
|
||||
// NOTE: If all of your mapped objects use element -> class registration, you can perform seeding in one line of code:
|
||||
// [RKManagedObjectSeeder generateSeedDatabaseWithObjectManager:objectManager fromFiles:@"users.json", nil];
|
||||
#endif
|
||||
|
||||
// Initialize object store
|
||||
objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"RKTwitterData.sqlite" usingSeedDatabaseName:RKDefaultSeedDatabaseFileName managedObjectModel:nil];
|
||||
|
||||
// Create Window and View Controllers
|
||||
RKTwitterViewController* viewController = [[[RKTwitterViewController alloc] initWithNibName:nil bundle:nil] autorelease];
|
||||
UINavigationController* controller = [[UINavigationController alloc] initWithRootViewController:viewController];
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
- (void)loadData {
|
||||
RKObjectManager* objectManager = [RKObjectManager sharedManager];
|
||||
[[objectManager loadObjectsAtResourcePath:@"/status/user_timeline/twotoasters.json" objectClass:[RKTStatus class] delegate:self] retain];
|
||||
[[objectManager loadObjectsAtResourcePath:@"/status/user_timeline/restkit.json" objectClass:[RKTStatus class] delegate:self] retain];
|
||||
}
|
||||
|
||||
- (void)reloadButtonWasPressed:(id)sender {
|
||||
|
||||
BIN
Examples/RKTwitterCoreData/RKSeedDatabase.sqlite
Normal file
BIN
Examples/RKTwitterCoreData/RKSeedDatabase.sqlite
Normal file
Binary file not shown.
@@ -15,6 +15,33 @@
|
||||
2538E814123419EC00ACB5D7 /* RKTStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 2538E813123419EC00ACB5D7 /* RKTStatus.m */; };
|
||||
2538E865123424F000ACB5D7 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E864123424F000ACB5D7 /* CoreData.framework */; };
|
||||
2538E8671234250100ACB5D7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E8661234250100ACB5D7 /* SystemConfiguration.framework */; };
|
||||
25F2A1791322D59400A33DE4 /* listbg.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F3CE3FA125B9A6E0083FDCB /* listbg.png */; };
|
||||
25F2A17A1322D59400A33DE4 /* listbg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F3CE3FB125B9A6E0083FDCB /* listbg@2x.png */; };
|
||||
25F2A17B1322D59400A33DE4 /* BG.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F3CE40A125B9B450083FDCB /* BG.png */; };
|
||||
25F2A17C1322D59400A33DE4 /* BG@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F3CE40B125B9B450083FDCB /* BG@2x.png */; };
|
||||
25F2A17D1322D59400A33DE4 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F3CE40C125B9B450083FDCB /* Default.png */; };
|
||||
25F2A17E1322D59400A33DE4 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3F3CE40D125B9B450083FDCB /* Default@2x.png */; };
|
||||
25F2A1801322D59400A33DE4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
|
||||
25F2A1811322D59400A33DE4 /* RKTwitterAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* RKTwitterAppDelegate.m */; };
|
||||
25F2A1821322D59400A33DE4 /* RKTwitterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* RKTwitterViewController.m */; };
|
||||
25F2A1831322D59400A33DE4 /* RKTUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 2538E810123419CA00ACB5D7 /* RKTUser.m */; };
|
||||
25F2A1841322D59400A33DE4 /* RKTStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 2538E813123419EC00ACB5D7 /* RKTStatus.m */; };
|
||||
25F2A1851322D59400A33DE4 /* RKTwitterCoreData.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 3F94E0C6125BA8C0001E8585 /* RKTwitterCoreData.xcdatamodel */; };
|
||||
25F2A1871322D59400A33DE4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
|
||||
25F2A1881322D59400A33DE4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
|
||||
25F2A1891322D59400A33DE4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
|
||||
25F2A18A1322D59400A33DE4 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E864123424F000ACB5D7 /* CoreData.framework */; };
|
||||
25F2A18B1322D59400A33DE4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E8661234250100ACB5D7 /* SystemConfiguration.framework */; };
|
||||
25F2A18C1322D59400A33DE4 /* libRestKitCoreData.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F3CE2CF125B93780083FDCB /* libRestKitCoreData.a */; };
|
||||
25F2A18D1322D59400A33DE4 /* libRestKitNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F3CE2C5125B93780083FDCB /* libRestKitNetwork.a */; };
|
||||
25F2A18E1322D59400A33DE4 /* libRestKitObjectMapping.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F3CE2C7125B93780083FDCB /* libRestKitObjectMapping.a */; };
|
||||
25F2A18F1322D59400A33DE4 /* libRestKitJSONParserYAJL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F3CE2CB125B93780083FDCB /* libRestKitJSONParserYAJL.a */; };
|
||||
25F2A1901322D59400A33DE4 /* libRestKitSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F3CE2C9125B93780083FDCB /* libRestKitSupport.a */; };
|
||||
25F2A1911322D59400A33DE4 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8452D3F8128244D90069F4A9 /* CFNetwork.framework */; };
|
||||
25F2A1921322D59400A33DE4 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8452D3FC128244E60069F4A9 /* MobileCoreServices.framework */; };
|
||||
25F2A1991322D93500A33DE4 /* restkit.json in Resources */ = {isa = PBXBuildFile; fileRef = 25F2A1981322D93500A33DE4 /* restkit.json */; };
|
||||
25F2A19C1322DD1800A33DE4 /* users.json in Resources */ = {isa = PBXBuildFile; fileRef = 25F2A19A1322DCDC00A33DE4 /* users.json */; };
|
||||
25F2A2D913240CEC00A33DE4 /* RKSeedDatabase.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = 25F2A2D813240CEC00A33DE4 /* RKSeedDatabase.sqlite */; };
|
||||
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
|
||||
28D7ACF80DDB3853001CB0EB /* RKTwitterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* RKTwitterViewController.m */; };
|
||||
3F3CE34C125B95F60083FDCB /* libRestKitCoreData.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F3CE2CF125B93780083FDCB /* libRestKitCoreData.a */; };
|
||||
@@ -49,6 +76,13 @@
|
||||
remoteGlobalIDString = 3F6C39A510FE5C95008F47C5;
|
||||
remoteInfo = UISpec;
|
||||
};
|
||||
25F2A1771322D59400A33DE4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 25956956126DF0A8004BAC4C;
|
||||
remoteInfo = RestKit;
|
||||
};
|
||||
3F3CE2C4125B93780083FDCB /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */;
|
||||
@@ -113,6 +147,10 @@
|
||||
2538E813123419EC00ACB5D7 /* RKTStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTStatus.m; sourceTree = "<group>"; };
|
||||
2538E864123424F000ACB5D7 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
2538E8661234250100ACB5D7 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
25F2A1961322D59400A33DE4 /* Generate Seed Database.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Generate Seed Database.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
25F2A1981322D93500A33DE4 /* restkit.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = restkit.json; sourceTree = SOURCE_ROOT; };
|
||||
25F2A19A1322DCDC00A33DE4 /* users.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = users.json; path = ../users.json; sourceTree = "<group>"; };
|
||||
25F2A2D813240CEC00A33DE4 /* RKSeedDatabase.sqlite */ = {isa = PBXFileReference; lastKnownFileType = file; path = RKSeedDatabase.sqlite; sourceTree = SOURCE_ROOT; };
|
||||
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
28D7ACF60DDB3853001CB0EB /* RKTwitterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKTwitterViewController.h; sourceTree = "<group>"; };
|
||||
28D7ACF70DDB3853001CB0EB /* RKTwitterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTwitterViewController.m; sourceTree = "<group>"; };
|
||||
@@ -152,6 +190,25 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
25F2A1861322D59400A33DE4 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
25F2A1871322D59400A33DE4 /* Foundation.framework in Frameworks */,
|
||||
25F2A1881322D59400A33DE4 /* UIKit.framework in Frameworks */,
|
||||
25F2A1891322D59400A33DE4 /* CoreGraphics.framework in Frameworks */,
|
||||
25F2A18A1322D59400A33DE4 /* CoreData.framework in Frameworks */,
|
||||
25F2A18B1322D59400A33DE4 /* SystemConfiguration.framework in Frameworks */,
|
||||
25F2A18C1322D59400A33DE4 /* libRestKitCoreData.a in Frameworks */,
|
||||
25F2A18D1322D59400A33DE4 /* libRestKitNetwork.a in Frameworks */,
|
||||
25F2A18E1322D59400A33DE4 /* libRestKitObjectMapping.a in Frameworks */,
|
||||
25F2A18F1322D59400A33DE4 /* libRestKitJSONParserYAJL.a in Frameworks */,
|
||||
25F2A1901322D59400A33DE4 /* libRestKitSupport.a in Frameworks */,
|
||||
25F2A1911322D59400A33DE4 /* CFNetwork.framework in Frameworks */,
|
||||
25F2A1921322D59400A33DE4 /* MobileCoreServices.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
@@ -174,6 +231,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D6058910D05DD3D006BFB54 /* RKTwitter.app */,
|
||||
25F2A1961322D59400A33DE4 /* Generate Seed Database.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -219,6 +277,9 @@
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
25F2A2D813240CEC00A33DE4 /* RKSeedDatabase.sqlite */,
|
||||
25F2A19A1322DCDC00A33DE4 /* users.json */,
|
||||
25F2A1981322D93500A33DE4 /* restkit.json */,
|
||||
3F3CE40A125B9B450083FDCB /* BG.png */,
|
||||
3F3CE40B125B9B450083FDCB /* BG@2x.png */,
|
||||
3F3CE40C125B9B450083FDCB /* Default.png */,
|
||||
@@ -266,6 +327,24 @@
|
||||
productReference = 1D6058910D05DD3D006BFB54 /* RKTwitter.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
25F2A1751322D59400A33DE4 /* Generate Seed Database */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 25F2A1931322D59400A33DE4 /* Build configuration list for PBXNativeTarget "Generate Seed Database" */;
|
||||
buildPhases = (
|
||||
25F2A1781322D59400A33DE4 /* Resources */,
|
||||
25F2A17F1322D59400A33DE4 /* Sources */,
|
||||
25F2A1861322D59400A33DE4 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
25F2A1761322D59400A33DE4 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "Generate Seed Database";
|
||||
productName = RKTwitter;
|
||||
productReference = 25F2A1961322D59400A33DE4 /* Generate Seed Database.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
@@ -292,6 +371,7 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1D6058900D05DD3D006BFB54 /* RKTwitter */,
|
||||
25F2A1751322D59400A33DE4 /* Generate Seed Database */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -366,6 +446,22 @@
|
||||
3F3CE40F125B9B450083FDCB /* BG@2x.png in Resources */,
|
||||
3F3CE410125B9B450083FDCB /* Default.png in Resources */,
|
||||
3F3CE411125B9B450083FDCB /* Default@2x.png in Resources */,
|
||||
25F2A2D913240CEC00A33DE4 /* RKSeedDatabase.sqlite in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
25F2A1781322D59400A33DE4 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
25F2A19C1322DD1800A33DE4 /* users.json in Resources */,
|
||||
25F2A1791322D59400A33DE4 /* listbg.png in Resources */,
|
||||
25F2A17A1322D59400A33DE4 /* listbg@2x.png in Resources */,
|
||||
25F2A17B1322D59400A33DE4 /* BG.png in Resources */,
|
||||
25F2A17C1322D59400A33DE4 /* BG@2x.png in Resources */,
|
||||
25F2A17D1322D59400A33DE4 /* Default.png in Resources */,
|
||||
25F2A17E1322D59400A33DE4 /* Default@2x.png in Resources */,
|
||||
25F2A1991322D93500A33DE4 /* restkit.json in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -385,9 +481,27 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
25F2A17F1322D59400A33DE4 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
25F2A1801322D59400A33DE4 /* main.m in Sources */,
|
||||
25F2A1811322D59400A33DE4 /* RKTwitterAppDelegate.m in Sources */,
|
||||
25F2A1821322D59400A33DE4 /* RKTwitterViewController.m in Sources */,
|
||||
25F2A1831322D59400A33DE4 /* RKTUser.m in Sources */,
|
||||
25F2A1841322D59400A33DE4 /* RKTStatus.m in Sources */,
|
||||
25F2A1851322D59400A33DE4 /* RKTwitterCoreData.xcdatamodel in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
25F2A1761322D59400A33DE4 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = RestKit;
|
||||
targetProxy = 25F2A1771322D59400A33DE4 /* PBXContainerItemProxy */;
|
||||
};
|
||||
3F3CE2E4125B93EB0083FDCB /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = RestKit;
|
||||
@@ -435,6 +549,47 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
25F2A1941322D59400A33DE4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUILD_STYLE = Debug;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = RKTwitter_Prefix.pch;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = RESTKIT_GENERATE_SEED_DB;
|
||||
HEADER_SEARCH_PATHS = ../../Build;
|
||||
INFOPLIST_FILE = "Resources/RKTwitter-Info.plist";
|
||||
OTHER_LDFLAGS = (
|
||||
"-all_load",
|
||||
"-ObjC",
|
||||
);
|
||||
PRODUCT_NAME = "Generate Seed Database";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
25F2A1951322D59400A33DE4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUILD_STYLE = Release;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = RKTwitter_Prefix.pch;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = RESTKIT_GENERATE_SEED_DB;
|
||||
HEADER_SEARCH_PATHS = ../../Build;
|
||||
INFOPLIST_FILE = "Resources/RKTwitter-Info.plist";
|
||||
OTHER_LDFLAGS = (
|
||||
"-all_load",
|
||||
"-ObjC",
|
||||
);
|
||||
PRODUCT_NAME = "Generate Seed Database";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -476,6 +631,15 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
25F2A1931322D59400A33DE4 /* Build configuration list for PBXNativeTarget "Generate Seed Database" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
25F2A1941322D59400A33DE4 /* Debug */,
|
||||
25F2A1951322D59400A33DE4 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "RKTwitterCoreData" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:RKTwitterCoreData.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
1
Examples/RKTwitterCoreData/restkit.json
Normal file
1
Examples/RKTwitterCoreData/restkit.json
Normal file
File diff suppressed because one or more lines are too long
7
Examples/RKTwitterCoreData/users.json
Normal file
7
Examples/RKTwitterCoreData/users.json
Normal file
@@ -0,0 +1,7 @@
|
||||
[{
|
||||
"user": {
|
||||
"id": 31337,
|
||||
"name": "Blake Watters",
|
||||
"screen_name": "Blake Watters"
|
||||
}
|
||||
}]
|
||||
5
Gemfile
Normal file
5
Gemfile
Normal file
@@ -0,0 +1,5 @@
|
||||
source "http://rubygems.org"
|
||||
|
||||
gem "rake"
|
||||
gem "uispecrunner", ">= 0.4.0"
|
||||
gem "bundler", "~> 1.0.0"
|
||||
18
Gemfile.lock
Normal file
18
Gemfile.lock
Normal file
@@ -0,0 +1,18 @@
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
open4 (1.0.1)
|
||||
rake (0.8.7)
|
||||
uispecrunner (0.4.0)
|
||||
open4 (= 1.0.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
bundler (~> 1.0.0)
|
||||
rake
|
||||
uispecrunner (>= 0.4.0)
|
||||
|
||||
METADATA
|
||||
version: 1.0.6
|
||||
35
Rakefile
Normal file
35
Rakefile
Normal file
@@ -0,0 +1,35 @@
|
||||
require 'rubygems'
|
||||
|
||||
begin
|
||||
gem 'uispecrunner'
|
||||
require 'uispecrunner'
|
||||
require 'uispecrunner/options'
|
||||
rescue LoadError => error
|
||||
puts "Unable to load UISpecRunner: #{error}"
|
||||
end
|
||||
|
||||
namespace :uispec do
|
||||
desc "Run all specs"
|
||||
task :all do
|
||||
options = UISpecRunner::Options.from_file('uispec.opts') rescue {}
|
||||
uispec_runner = UISpecRunner.new(options)
|
||||
uispec_runner.run_all!
|
||||
end
|
||||
|
||||
desc "Run all unit specs (those that implement UISpecUnit)"
|
||||
task :units do
|
||||
options = UISpecRunner::Options.from_file('uispec.opts') rescue {}
|
||||
uispec_runner = UISpecRunner.new(options)
|
||||
uispec_runner.run_protocol!('UISpecUnit')
|
||||
end
|
||||
|
||||
desc "Run all integration specs (those that implement UISpecIntegration)"
|
||||
task :integration do
|
||||
options = UISpecRunner::Options.from_file('uispec.opts') rescue {}
|
||||
uispec_runner = UISpecRunner.new(options)
|
||||
uispec_runner.run_protocol!('UISpecIntegration')
|
||||
end
|
||||
end
|
||||
|
||||
desc "Run all specs"
|
||||
task :default => 'uispec:all'
|
||||
@@ -31,7 +31,6 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
250429A911F62E0200553519 /* UISpec+UISpecRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 250429A811F62E0200553519 /* UISpec+UISpecRunner.m */; };
|
||||
250BC22B11F621B400F3FE5A /* RKDynamicRouterSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 250BC22A11F621B400F3FE5A /* RKDynamicRouterSpec.m */; };
|
||||
250BC51111F62D6B00F3FE5A /* UISpec.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 250BC50A11F62D6B00F3FE5A /* UISpec.bundle */; };
|
||||
2520776E113587BE00382018 /* NSDictionary+RKRequestSerializationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 2520776D113587BE00382018 /* NSDictionary+RKRequestSerializationSpec.m */; };
|
||||
2523363E11E7A1F00048F9B4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F6C3A9510FE7524008F47C5 /* UIKit.framework */; };
|
||||
2524CB5D1278930200D1314C /* RKParamsAttachmentSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 2524CB5C1278930200D1314C /* RKParamsAttachmentSpec.m */; };
|
||||
@@ -91,8 +90,8 @@
|
||||
253A09F612552BDC00976E89 /* Support.h in Headers */ = {isa = PBXBuildFile; fileRef = 253A09F512552BDC00976E89 /* Support.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
253E1B1112E9450700F3E4B0 /* RKObjectMappable.m in Sources */ = {isa = PBXBuildFile; fileRef = 253E1B1012E9450700F3E4B0 /* RKObjectMappable.m */; };
|
||||
25431EBB1255640800A315CF /* CoreData.h in Headers */ = {isa = PBXBuildFile; fileRef = 25431EBA1255640800A315CF /* CoreData.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2543201C1256179900A315CF /* RKObjectSeeder.h in Headers */ = {isa = PBXBuildFile; fileRef = 253A088812551D8D00976E89 /* RKObjectSeeder.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2543201D1256179900A315CF /* RKObjectSeeder.m in Sources */ = {isa = PBXBuildFile; fileRef = 253A088912551D8D00976E89 /* RKObjectSeeder.m */; };
|
||||
2543201C1256179900A315CF /* RKManagedObjectSeeder.h in Headers */ = {isa = PBXBuildFile; fileRef = 253A088812551D8D00976E89 /* RKManagedObjectSeeder.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2543201D1256179900A315CF /* RKManagedObjectSeeder.m in Sources */ = {isa = PBXBuildFile; fileRef = 253A088912551D8D00976E89 /* RKManagedObjectSeeder.m */; };
|
||||
25432041125618F000A315CF /* RKParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 25432040125618F000A315CF /* RKParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
25432064125632A300A315CF /* RKJSONParser+YAJL.m in Sources */ = {isa = PBXBuildFile; fileRef = 253A08B71255212300976E89 /* RKJSONParser+YAJL.m */; };
|
||||
25432065125632AA00A315CF /* RKJSONParser+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 253A08B61255212300976E89 /* RKJSONParser+SBJSON.m */; };
|
||||
@@ -164,12 +163,11 @@
|
||||
25956985126DF1AE004BAC4C /* libRestKitNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 253A07FC1255161B00976E89 /* libRestKitNetwork.a */; };
|
||||
25956986126DF1AE004BAC4C /* libRestKitObjectMapping.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 253A08031255162C00976E89 /* libRestKitObjectMapping.a */; };
|
||||
25956987126DF1AE004BAC4C /* libRestKitSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 253A080C12551D3000976E89 /* libRestKitSupport.a */; };
|
||||
259569D5126DF464004BAC4C /* UISpec_1_0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 250BC51011F62D6B00F3FE5A /* UISpec_1_0.a */; };
|
||||
25957826126E3BE9004BAC4C /* RKRailsRouterSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 25957825126E3BE9004BAC4C /* RKRailsRouterSpec.m */; };
|
||||
2596AC9012F7B015004C02F9 /* RKClientSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 2596AC8F12F7B015004C02F9 /* RKClientSpec.m */; };
|
||||
25A5B4E912762249003DC8A4 /* blake.png in Resources */ = {isa = PBXBuildFile; fileRef = 25A5B4E812762249003DC8A4 /* blake.png */; };
|
||||
3F02F584131D6682004E1F54 /* RKXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F02F582131D6682004E1F54 /* RKXMLParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3F02F585131D6682004E1F54 /* RKXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F02F583131D6682004E1F54 /* RKXMLParser.m */; };
|
||||
25F48FF61327DA3400F6B59F /* libUISpec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25F48FF51327DA3400F6B59F /* libUISpec.a */; };
|
||||
25F48FF81327DAB300F6B59F /* UISpec.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 25F48FF71327DAB300F6B59F /* UISpec.bundle */; };
|
||||
3F032A7910FFB89100F35142 /* RKCat.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F032A7810FFB89100F35142 /* RKCat.m */; };
|
||||
3F032AA810FFBBCD00F35142 /* RKHouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F032AA710FFBBCD00F35142 /* RKHouse.m */; };
|
||||
3F032AAB10FFBC1F00F35142 /* RKResident.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F032AAA10FFBC1F00F35142 /* RKResident.m */; };
|
||||
@@ -178,6 +176,9 @@
|
||||
3F6C3A2E10FE749C008F47C5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F6C3A2D10FE749C008F47C5 /* Foundation.framework */; };
|
||||
3F6C3A9410FE7519008F47C5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C3A9310FE7519008F47C5 /* main.m */; };
|
||||
3F6C3A9610FE7524008F47C5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F6C3A9510FE7524008F47C5 /* UIKit.framework */; };
|
||||
3F76235D133A316800EEAAA7 /* RKXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F76235B133A316800EEAAA7 /* RKXMLParser.h */; };
|
||||
3F76235E133A316800EEAAA7 /* RKXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F76235C133A316800EEAAA7 /* RKXMLParser.m */; };
|
||||
3F762365133A32BB00EEAAA7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F6C3A2D10FE749C008F47C5 /* Foundation.framework */; };
|
||||
7377FBE21268E96300868752 /* RKManagedObjectCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 7377FBE11268E96300868752 /* RKManagedObjectCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
73C89EF212A5BB9A000FE600 /* RKReachabilityObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 73C89EEF12A5BB9A000FE600 /* RKReachabilityObserver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
73C89EF312A5BB9A000FE600 /* RKReachabilityObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C89EF012A5BB9A000FE600 /* RKReachabilityObserver.m */; };
|
||||
@@ -186,20 +187,6 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
25042B8211F62FF500553519 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 25042A9511F62F2400553519 /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
|
||||
remoteInfo = OCMock;
|
||||
};
|
||||
25042B8411F62FF500553519 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 25042A9511F62F2400553519 /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 03BF2D3708F1C69500978C59;
|
||||
remoteInfo = OCMockTests;
|
||||
};
|
||||
250BC43211F6260100F3FE5A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 3F6C39B610FE738A008F47C5 /* UISpec.xcodeproj */;
|
||||
@@ -221,55 +208,6 @@
|
||||
remoteGlobalIDString = C7D4F29310BDA39C00B00019;
|
||||
remoteInfo = Specs;
|
||||
};
|
||||
250BC45211F6262600F3FE5A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 250BC36211F625DF00F3FE5A /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
|
||||
remoteInfo = OCMock;
|
||||
};
|
||||
250BC45411F6262600F3FE5A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 250BC36211F625DF00F3FE5A /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 03BF2D3708F1C69500978C59;
|
||||
remoteInfo = OCMockTests;
|
||||
};
|
||||
250BC4E311F62D4400F3FE5A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 250BC43F11F6261700F3FE5A /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
|
||||
remoteInfo = OCMock;
|
||||
};
|
||||
250BC4E511F62D4400F3FE5A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 250BC43F11F6261700F3FE5A /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 03BF2D3708F1C69500978C59;
|
||||
remoteInfo = OCMockTests;
|
||||
};
|
||||
257EA42D11F6319800DB04C3 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 25042A9511F62F2400553519 /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 3F45512511E4BCD700AE56A6;
|
||||
remoteInfo = "OCMock-iPhone";
|
||||
};
|
||||
257EA43211F6319800DB04C3 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 250BC43F11F6261700F3FE5A /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 3F45512511E4BCD700AE56A6;
|
||||
remoteInfo = "OCMock-iPhone";
|
||||
};
|
||||
257EA43711F6319800DB04C3 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 250BC36211F625DF00F3FE5A /* OCMock.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 3F45512511E4BCD700AE56A6;
|
||||
remoteInfo = "OCMock-iPhone";
|
||||
};
|
||||
25956959126DF0B4004BAC4C /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
@@ -326,13 +264,6 @@
|
||||
remoteGlobalIDString = C76EB5D20F74586B00EF8398;
|
||||
remoteInfo = UISpec_Simulator;
|
||||
};
|
||||
2595699A126DF283004BAC4C /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2595698D126DF283004BAC4C /* UISpec.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = C76EB5DA0F7458C100EF8398;
|
||||
remoteInfo = UISpec_Device;
|
||||
};
|
||||
2595699C126DF283004BAC4C /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2595698D126DF283004BAC4C /* UISpec.xcodeproj */;
|
||||
@@ -340,6 +271,13 @@
|
||||
remoteGlobalIDString = C7D4F29310BDA39C00B00019;
|
||||
remoteInfo = Specs;
|
||||
};
|
||||
25F48FF31327DA2300F6B59F /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2595698D126DF283004BAC4C /* UISpec.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = C76EB5D10F74586B00EF8398;
|
||||
remoteInfo = UISpec;
|
||||
};
|
||||
3F4BC8F212DE4C7F00048E71 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
@@ -357,15 +295,6 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
255DE48A110112F500A85891 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "$(BUILT_PRODUCTS_DIR)";
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
25956979126DF0E3004BAC4C /* Copy Headers */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -382,42 +311,7 @@
|
||||
/* Begin PBXFileReference section */
|
||||
250429A711F62E0200553519 /* UISpec+UISpecRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UISpec+UISpecRunner.h"; sourceTree = "<group>"; };
|
||||
250429A811F62E0200553519 /* UISpec+UISpecRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UISpec+UISpecRunner.m"; sourceTree = "<group>"; };
|
||||
25042A9511F62F2400553519 /* OCMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OCMock.xcodeproj; path = /Users/blake/Projects/two_toasters/InMotion/Libraries/RestKit/Specs/Support/OCMock/Source/OCMock.xcodeproj; sourceTree = "<absolute>"; };
|
||||
25042C5011F6309000553519 /* OCMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OCMock.xcodeproj; path = /Users/blake/Projects/two_toasters/RestKit/Specs/Support/OCMock/Source/OCMock.xcodeproj; sourceTree = "<absolute>"; };
|
||||
250BC22A11F621B400F3FE5A /* RKDynamicRouterSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKDynamicRouterSpec.m; sourceTree = "<group>"; };
|
||||
250BC36211F625DF00F3FE5A /* OCMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OCMock.xcodeproj; path = /Users/blake/Projects/two_toasters/InMotion/Libraries/RestKit/Specs/Support/OCMock/Source/OCMock.xcodeproj; sourceTree = "<absolute>"; };
|
||||
250BC43F11F6261700F3FE5A /* OCMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OCMock.xcodeproj; path = /Users/blake/Projects/two_toasters/InMotion/Libraries/RestKit/Specs/Support/OCMock/Source/OCMock.xcodeproj; sourceTree = "<absolute>"; };
|
||||
250BC4ED11F62D6B00F3FE5A /* CallCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallCache.h; sourceTree = "<group>"; };
|
||||
250BC4EE11F62D6B00F3FE5A /* NSNumberCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSNumberCreator.h; sourceTree = "<group>"; };
|
||||
250BC4EF11F62D6B00F3FE5A /* Recordable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Recordable.h; sourceTree = "<group>"; };
|
||||
250BC4F011F62D6B00F3FE5A /* ReturnCacher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReturnCacher.h; sourceTree = "<group>"; };
|
||||
250BC4F111F62D6B00F3FE5A /* UIBug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIBug.h; sourceTree = "<group>"; };
|
||||
250BC4F211F62D6B00F3FE5A /* UIChildren.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIChildren.h; sourceTree = "<group>"; };
|
||||
250BC4F311F62D6B00F3FE5A /* UIConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIConsole.h; sourceTree = "<group>"; };
|
||||
250BC4F411F62D6B00F3FE5A /* UIConsoleLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIConsoleLog.h; sourceTree = "<group>"; };
|
||||
250BC4F511F62D6B00F3FE5A /* UIDescendants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDescendants.h; sourceTree = "<group>"; };
|
||||
250BC4F611F62D6B00F3FE5A /* UIExpectation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIExpectation.h; sourceTree = "<group>"; };
|
||||
250BC4F711F62D6B00F3FE5A /* UIFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIFilter.h; sourceTree = "<group>"; };
|
||||
250BC4F811F62D6B00F3FE5A /* UIInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIInspector.h; sourceTree = "<group>"; };
|
||||
250BC4F911F62D6B00F3FE5A /* UILog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILog.h; sourceTree = "<group>"; };
|
||||
250BC4FA11F62D6B00F3FE5A /* UIMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIMatcher.h; sourceTree = "<group>"; };
|
||||
250BC4FB11F62D6B00F3FE5A /* UIParents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIParents.h; sourceTree = "<group>"; };
|
||||
250BC4FC11F62D6B00F3FE5A /* UIProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIProxy.h; sourceTree = "<group>"; };
|
||||
250BC4FD11F62D6B00F3FE5A /* UIQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQuery.h; sourceTree = "<group>"; };
|
||||
250BC4FE11F62D6B00F3FE5A /* UIQueryAll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQueryAll.h; sourceTree = "<group>"; };
|
||||
250BC4FF11F62D6B00F3FE5A /* UIQueryExpectation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQueryExpectation.h; sourceTree = "<group>"; };
|
||||
250BC50011F62D6B00F3FE5A /* UIQuerySearchBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQuerySearchBar.h; sourceTree = "<group>"; };
|
||||
250BC50111F62D6B00F3FE5A /* UIQuerySegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQuerySegmentedControl.h; sourceTree = "<group>"; };
|
||||
250BC50211F62D6B00F3FE5A /* UIQueryTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQueryTabBar.h; sourceTree = "<group>"; };
|
||||
250BC50311F62D6B00F3FE5A /* UIQueryTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQueryTableView.h; sourceTree = "<group>"; };
|
||||
250BC50411F62D6B00F3FE5A /* UIQueryTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQueryTableViewCell.h; sourceTree = "<group>"; };
|
||||
250BC50511F62D6B00F3FE5A /* UIQueryWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIQueryWebView.h; sourceTree = "<group>"; };
|
||||
250BC50611F62D6B00F3FE5A /* UIRedoer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIRedoer.h; sourceTree = "<group>"; };
|
||||
250BC50711F62D6B00F3FE5A /* UISpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISpec.h; sourceTree = "<group>"; };
|
||||
250BC50811F62D6B00F3FE5A /* ViewFilterSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewFilterSwizzler.h; sourceTree = "<group>"; };
|
||||
250BC50911F62D6B00F3FE5A /* WaitUntilIdle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaitUntilIdle.h; sourceTree = "<group>"; };
|
||||
250BC50A11F62D6B00F3FE5A /* UISpec.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = UISpec.bundle; sourceTree = "<group>"; };
|
||||
250BC51011F62D6B00F3FE5A /* UISpec_1_0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = UISpec_1_0.a; sourceTree = "<group>"; };
|
||||
2520776D113587BE00382018 /* NSDictionary+RKRequestSerializationSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+RKRequestSerializationSpec.m"; sourceTree = "<group>"; };
|
||||
2523360511E79F090048F9B4 /* libRestKitThree20.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRestKitThree20.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2524CB5C1278930200D1314C /* RKParamsAttachmentSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKParamsAttachmentSpec.m; sourceTree = "<group>"; };
|
||||
@@ -460,8 +354,8 @@
|
||||
253A088512551D8D00976E89 /* RKObjectMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectMapper.m; sourceTree = "<group>"; };
|
||||
253A088612551D8D00976E89 /* RKObjectPropertyInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKObjectPropertyInspector.h; sourceTree = "<group>"; };
|
||||
253A088712551D8D00976E89 /* RKObjectPropertyInspector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectPropertyInspector.m; sourceTree = "<group>"; };
|
||||
253A088812551D8D00976E89 /* RKObjectSeeder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKObjectSeeder.h; sourceTree = "<group>"; };
|
||||
253A088912551D8D00976E89 /* RKObjectSeeder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectSeeder.m; sourceTree = "<group>"; };
|
||||
253A088812551D8D00976E89 /* RKManagedObjectSeeder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKManagedObjectSeeder.h; sourceTree = "<group>"; };
|
||||
253A088912551D8D00976E89 /* RKManagedObjectSeeder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKManagedObjectSeeder.m; sourceTree = "<group>"; };
|
||||
253A088A12551D8D00976E89 /* RKRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKRouter.h; sourceTree = "<group>"; };
|
||||
253A089212551D8D00976E89 /* RestKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestKit.h; sourceTree = "<group>"; };
|
||||
253A089412551D8D00976E89 /* Errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Errors.h; sourceTree = "<group>"; };
|
||||
@@ -579,8 +473,8 @@
|
||||
2596AC8F12F7B015004C02F9 /* RKClientSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKClientSpec.m; sourceTree = "<group>"; };
|
||||
25A5B4E812762249003DC8A4 /* blake.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blake.png; sourceTree = "<group>"; };
|
||||
25E075981279D9AB00B22EC9 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
|
||||
3F02F582131D6682004E1F54 /* RKXMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKXMLParser.h; sourceTree = "<group>"; };
|
||||
3F02F583131D6682004E1F54 /* RKXMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKXMLParser.m; sourceTree = "<group>"; };
|
||||
25F48FF51327DA3400F6B59F /* libUISpec.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libUISpec.a; sourceTree = SOURCE_ROOT; };
|
||||
25F48FF71327DAB300F6B59F /* UISpec.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = UISpec.bundle; path = Specs/Support/UISpec/src/UISpec.bundle; sourceTree = SOURCE_ROOT; };
|
||||
3F032A7710FFB89100F35142 /* RKCat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKCat.h; sourceTree = "<group>"; };
|
||||
3F032A7810FFB89100F35142 /* RKCat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKCat.m; sourceTree = "<group>"; };
|
||||
3F032AA610FFBBCD00F35142 /* RKHouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKHouse.h; sourceTree = "<group>"; };
|
||||
@@ -596,6 +490,10 @@
|
||||
3F6C3A9310FE7519008F47C5 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
3F6C3A9510FE7524008F47C5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
3F6C3AD010FE76C1008F47C5 /* RKModelMapperSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKModelMapperSpec.m; sourceTree = "<group>"; };
|
||||
3F76235B133A316800EEAAA7 /* RKXMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKXMLParser.h; sourceTree = "<group>"; };
|
||||
3F76235C133A316800EEAAA7 /* RKXMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKXMLParser.m; sourceTree = "<group>"; };
|
||||
3F762364133A32BB00EEAAA7 /* libRestKitLibXMLParser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRestKitLibXMLParser.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3F762368133A32BB00EEAAA7 /* RestKitLibXMLParser-Prefix.pch */ = {isa = PBXFileReference; path = "RestKitLibXMLParser-Prefix.pch"; sourceTree = "<group>"; };
|
||||
7377FBE11268E96300868752 /* RKManagedObjectCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKManagedObjectCache.h; sourceTree = "<group>"; };
|
||||
73C89EEF12A5BB9A000FE600 /* RKReachabilityObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKReachabilityObserver.h; sourceTree = "<group>"; };
|
||||
73C89EF012A5BB9A000FE600 /* RKReachabilityObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKReachabilityObserver.m; sourceTree = "<group>"; };
|
||||
@@ -659,6 +557,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
25F48FF61327DA3400F6B59F /* libUISpec.a in Frameworks */,
|
||||
3F6C3A2E10FE749C008F47C5 /* Foundation.framework in Frameworks */,
|
||||
3F6C3A9610FE7524008F47C5 /* UIKit.framework in Frameworks */,
|
||||
255DE0E210FFABA500A85891 /* CoreData.framework in Frameworks */,
|
||||
@@ -669,12 +568,19 @@
|
||||
25956985126DF1AE004BAC4C /* libRestKitNetwork.a in Frameworks */,
|
||||
25956986126DF1AE004BAC4C /* libRestKitObjectMapping.a in Frameworks */,
|
||||
25956987126DF1AE004BAC4C /* libRestKitSupport.a in Frameworks */,
|
||||
259569D5126DF464004BAC4C /* UISpec_1_0.a in Frameworks */,
|
||||
3F1912A712DF6B4800C077AD /* CFNetwork.framework in Frameworks */,
|
||||
3F1912AF12DF6B6200C077AD /* MobileCoreServices.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3F762361133A32BB00EEAAA7 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3F762365133A32BB00EEAAA7 /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
@@ -689,6 +595,7 @@
|
||||
253A080C12551D3000976E89 /* libRestKitSupport.a */,
|
||||
253A081412551D5300976E89 /* libRestKitCoreData.a */,
|
||||
3F6C39A510FE5C95008F47C5 /* UISpec.app */,
|
||||
3F762364133A32BB00EEAAA7 /* libRestKitLibXMLParser.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -700,6 +607,7 @@
|
||||
3F6C3A9210FE750E008F47C5 /* Specs */,
|
||||
253A0A8D1255300000976E89 /* Scripts */,
|
||||
2590E6711252357200531FA8 /* Vendor */,
|
||||
3F762366133A32BB00EEAAA7 /* RestKitLibXMLParser */,
|
||||
0867D69AFE84028FC02AAC07 /* Frameworks */,
|
||||
034768DFFF38A50411DB9C8B /* Products */,
|
||||
);
|
||||
@@ -721,16 +629,6 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
25042B7C11F62FF500553519 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
25042B8311F62FF500553519 /* OCMock */,
|
||||
25042B8511F62FF500553519 /* OCMockTests.octest */,
|
||||
257EA42E11F6319800DB04C3 /* libOCMock-iPhone.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
250BC42C11F6260100F3FE5A /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -741,74 +639,17 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
250BC44C11F6262600F3FE5A /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
250BC45311F6262600F3FE5A /* OCMock */,
|
||||
250BC45511F6262600F3FE5A /* OCMockTests.octest */,
|
||||
257EA43811F6319800DB04C3 /* libOCMock-iPhone.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
250BC4DD11F62D4400F3FE5A /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
250BC4E411F62D4400F3FE5A /* OCMock */,
|
||||
250BC4E611F62D4400F3FE5A /* OCMockTests.octest */,
|
||||
257EA43311F6319800DB04C3 /* libOCMock-iPhone.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
250BC4EB11F62D6B00F3FE5A /* UISpec */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
25F48FF71327DAB300F6B59F /* UISpec.bundle */,
|
||||
25F48FF51327DA3400F6B59F /* libUISpec.a */,
|
||||
2595698D126DF283004BAC4C /* UISpec.xcodeproj */,
|
||||
250BC4EC11F62D6B00F3FE5A /* Headers */,
|
||||
250BC50A11F62D6B00F3FE5A /* UISpec.bundle */,
|
||||
250BC51011F62D6B00F3FE5A /* UISpec_1_0.a */,
|
||||
);
|
||||
name = UISpec;
|
||||
path = UISpec/bin/UISpec;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
250BC4EC11F62D6B00F3FE5A /* Headers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
250BC4ED11F62D6B00F3FE5A /* CallCache.h */,
|
||||
250BC4EE11F62D6B00F3FE5A /* NSNumberCreator.h */,
|
||||
250BC4EF11F62D6B00F3FE5A /* Recordable.h */,
|
||||
250BC4F011F62D6B00F3FE5A /* ReturnCacher.h */,
|
||||
250BC4F111F62D6B00F3FE5A /* UIBug.h */,
|
||||
250BC4F211F62D6B00F3FE5A /* UIChildren.h */,
|
||||
250BC4F311F62D6B00F3FE5A /* UIConsole.h */,
|
||||
250BC4F411F62D6B00F3FE5A /* UIConsoleLog.h */,
|
||||
250BC4F511F62D6B00F3FE5A /* UIDescendants.h */,
|
||||
250BC4F611F62D6B00F3FE5A /* UIExpectation.h */,
|
||||
250BC4F711F62D6B00F3FE5A /* UIFilter.h */,
|
||||
250BC4F811F62D6B00F3FE5A /* UIInspector.h */,
|
||||
250BC4F911F62D6B00F3FE5A /* UILog.h */,
|
||||
250BC4FA11F62D6B00F3FE5A /* UIMatcher.h */,
|
||||
250BC4FB11F62D6B00F3FE5A /* UIParents.h */,
|
||||
250BC4FC11F62D6B00F3FE5A /* UIProxy.h */,
|
||||
250BC4FD11F62D6B00F3FE5A /* UIQuery.h */,
|
||||
250BC4FE11F62D6B00F3FE5A /* UIQueryAll.h */,
|
||||
250BC4FF11F62D6B00F3FE5A /* UIQueryExpectation.h */,
|
||||
250BC50011F62D6B00F3FE5A /* UIQuerySearchBar.h */,
|
||||
250BC50111F62D6B00F3FE5A /* UIQuerySegmentedControl.h */,
|
||||
250BC50211F62D6B00F3FE5A /* UIQueryTabBar.h */,
|
||||
250BC50311F62D6B00F3FE5A /* UIQueryTableView.h */,
|
||||
250BC50411F62D6B00F3FE5A /* UIQueryTableViewCell.h */,
|
||||
250BC50511F62D6B00F3FE5A /* UIQueryWebView.h */,
|
||||
250BC50611F62D6B00F3FE5A /* UIRedoer.h */,
|
||||
250BC50711F62D6B00F3FE5A /* UISpec.h */,
|
||||
250BC50811F62D6B00F3FE5A /* ViewFilterSwizzler.h */,
|
||||
250BC50911F62D6B00F3FE5A /* WaitUntilIdle.h */,
|
||||
);
|
||||
path = Headers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
253A085F12551D8D00976E89 /* Code */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -831,8 +672,8 @@
|
||||
7377FBE11268E96300868752 /* RKManagedObjectCache.h */,
|
||||
253A086312551D8D00976E89 /* RKManagedObjectStore.h */,
|
||||
253A086412551D8D00976E89 /* RKManagedObjectStore.m */,
|
||||
253A088812551D8D00976E89 /* RKObjectSeeder.h */,
|
||||
253A088912551D8D00976E89 /* RKObjectSeeder.m */,
|
||||
253A088812551D8D00976E89 /* RKManagedObjectSeeder.h */,
|
||||
253A088912551D8D00976E89 /* RKManagedObjectSeeder.m */,
|
||||
);
|
||||
path = CoreData;
|
||||
sourceTree = "<group>";
|
||||
@@ -929,8 +770,8 @@
|
||||
253A08B41255212300976E89 /* Parsers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3F02F582131D6682004E1F54 /* RKXMLParser.h */,
|
||||
3F02F583131D6682004E1F54 /* RKXMLParser.m */,
|
||||
3F76235B133A316800EEAAA7 /* RKXMLParser.h */,
|
||||
3F76235C133A316800EEAAA7 /* RKXMLParser.m */,
|
||||
253A08B51255212300976E89 /* JSON */,
|
||||
253A08B81255212300976E89 /* RKJSONParser.h */,
|
||||
);
|
||||
@@ -1140,13 +981,6 @@
|
||||
path = GTM;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
25956591126DE9CF004BAC4C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
25956593126DE9DF004BAC4C /* OCMock */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1180,8 +1014,7 @@
|
||||
25956992126DF283004BAC4C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
25956999126DF283004BAC4C /* UISpec_Simulator.a */,
|
||||
2595699B126DF283004BAC4C /* UISpec_Device.a */,
|
||||
25956999126DF283004BAC4C /* libUISpec.a */,
|
||||
2595699D126DF283004BAC4C /* Specs.app */,
|
||||
);
|
||||
name = Products;
|
||||
@@ -1202,6 +1035,22 @@
|
||||
path = Specs;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3F762366133A32BB00EEAAA7 /* RestKitLibXMLParser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3F762367133A32BB00EEAAA7 /* Supporting Files */,
|
||||
);
|
||||
path = RestKitLibXMLParser;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3F762367133A32BB00EEAAA7 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3F762368133A32BB00EEAAA7 /* RestKitLibXMLParser-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
@@ -1261,10 +1110,10 @@
|
||||
253A091A1255250E00976E89 /* NSObject+RKJSONSerialization.h in Headers */,
|
||||
253A091B1255250E00976E89 /* NSString+InflectionSupport.h in Headers */,
|
||||
253A091D1255251600976E89 /* RKJSONParser.h in Headers */,
|
||||
3F02F584131D6682004E1F54 /* RKXMLParser.h in Headers */,
|
||||
253A091E1255251800976E89 /* RKSearchEngine.h in Headers */,
|
||||
253A09F612552BDC00976E89 /* Support.h in Headers */,
|
||||
25432041125618F000A315CF /* RKParser.h in Headers */,
|
||||
3F76235D133A316800EEAAA7 /* RKXMLParser.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1275,7 +1124,7 @@
|
||||
253A09241255258400976E89 /* RKManagedObject.h in Headers */,
|
||||
253A09261255258500976E89 /* RKManagedObjectStore.h in Headers */,
|
||||
25431EBB1255640800A315CF /* CoreData.h in Headers */,
|
||||
2543201C1256179900A315CF /* RKObjectSeeder.h in Headers */,
|
||||
2543201C1256179900A315CF /* RKManagedObjectSeeder.h in Headers */,
|
||||
7377FBE21268E96300868752 /* RKManagedObjectCache.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -1318,6 +1167,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3F762362133A32BB00EEAAA7 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -1448,12 +1304,11 @@
|
||||
3F6C39A110FE5C95008F47C5 /* Resources */,
|
||||
3F6C39A210FE5C95008F47C5 /* Sources */,
|
||||
3F6C39A310FE5C95008F47C5 /* Frameworks */,
|
||||
255DE2B810FFBFBF00A85891 /* ShellScript */,
|
||||
255DE48A110112F500A85891 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
25F48FF41327DA2300F6B59F /* PBXTargetDependency */,
|
||||
3F4BC8F312DE4C7F00048E71 /* PBXTargetDependency */,
|
||||
25956982126DF182004BAC4C /* PBXTargetDependency */,
|
||||
);
|
||||
@@ -1462,6 +1317,23 @@
|
||||
productReference = 3F6C39A510FE5C95008F47C5 /* UISpec.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
3F762363133A32BB00EEAAA7 /* RestKitLibXMLParser */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3F762369133A32BB00EEAAA7 /* Build configuration list for PBXNativeTarget "RestKitLibXMLParser" */;
|
||||
buildPhases = (
|
||||
3F762360133A32BB00EEAAA7 /* Sources */,
|
||||
3F762361133A32BB00EEAAA7 /* Frameworks */,
|
||||
3F762362133A32BB00EEAAA7 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = RestKitLibXMLParser;
|
||||
productName = RestKitLibXMLParser;
|
||||
productReference = 3F762364133A32BB00EEAAA7 /* libRestKitLibXMLParser.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
@@ -1484,22 +1356,6 @@
|
||||
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 25956591126DE9CF004BAC4C /* Products */;
|
||||
ProjectRef = 25042C5011F6309000553519 /* OCMock.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 250BC4DD11F62D4400F3FE5A /* Products */;
|
||||
ProjectRef = 250BC43F11F6261700F3FE5A /* OCMock.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 25042B7C11F62FF500553519 /* Products */;
|
||||
ProjectRef = 25042A9511F62F2400553519 /* OCMock.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 250BC44C11F6262600F3FE5A /* Products */;
|
||||
ProjectRef = 250BC36211F625DF00F3FE5A /* OCMock.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 25956992126DF283004BAC4C /* Products */;
|
||||
ProjectRef = 2595698D126DF283004BAC4C /* UISpec.xcodeproj */;
|
||||
@@ -1520,25 +1376,12 @@
|
||||
253A081312551D5300976E89 /* RestKitCoreData */,
|
||||
2523360411E79F090048F9B4 /* RestKitThree20 */,
|
||||
3F6C39A410FE5C95008F47C5 /* UISpec */,
|
||||
3F762363133A32BB00EEAAA7 /* RestKitLibXMLParser */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
25042B8311F62FF500553519 /* OCMock */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = OCMock;
|
||||
remoteRef = 25042B8211F62FF500553519 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
25042B8511F62FF500553519 /* OCMockTests.octest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = OCMockTests.octest;
|
||||
remoteRef = 25042B8411F62FF500553519 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
250BC43311F6260100F3FE5A /* UISpec_Simulator.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
@@ -1560,69 +1403,13 @@
|
||||
remoteRef = 250BC43611F6260100F3FE5A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
250BC45311F6262600F3FE5A /* OCMock */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = OCMock;
|
||||
remoteRef = 250BC45211F6262600F3FE5A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
250BC45511F6262600F3FE5A /* OCMockTests.octest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = OCMockTests.octest;
|
||||
remoteRef = 250BC45411F6262600F3FE5A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
250BC4E411F62D4400F3FE5A /* OCMock */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = OCMock;
|
||||
remoteRef = 250BC4E311F62D4400F3FE5A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
250BC4E611F62D4400F3FE5A /* OCMockTests.octest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = OCMockTests.octest;
|
||||
remoteRef = 250BC4E511F62D4400F3FE5A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
257EA42E11F6319800DB04C3 /* libOCMock-iPhone.a */ = {
|
||||
25956999126DF283004BAC4C /* libUISpec.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libOCMock-iPhone.a";
|
||||
remoteRef = 257EA42D11F6319800DB04C3 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
257EA43311F6319800DB04C3 /* libOCMock-iPhone.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libOCMock-iPhone.a";
|
||||
remoteRef = 257EA43211F6319800DB04C3 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
257EA43811F6319800DB04C3 /* libOCMock-iPhone.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libOCMock-iPhone.a";
|
||||
remoteRef = 257EA43711F6319800DB04C3 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
25956999126DF283004BAC4C /* UISpec_Simulator.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = UISpec_Simulator.a;
|
||||
path = libUISpec.a;
|
||||
remoteRef = 25956998126DF283004BAC4C /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2595699B126DF283004BAC4C /* UISpec_Device.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = UISpec_Device.a;
|
||||
remoteRef = 2595699A126DF283004BAC4C /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2595699D126DF283004BAC4C /* Specs.app */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.application;
|
||||
@@ -1637,8 +1424,8 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
250BC51111F62D6B00F3FE5A /* UISpec.bundle in Resources */,
|
||||
25A5B4E912762249003DC8A4 /* blake.png in Resources */,
|
||||
25F48FF81327DAB300F6B59F /* UISpec.bundle in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1658,19 +1445,6 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "IFS=$'\\n'\n\nif [ ${BUILD_ROOT} != ${SRCROOT}/Build ]; then\n rm -rf ${SRCROOT}/Build/RestKit\n cp -R ${BUILD_ROOT}/RestKit ${SRCROOT}/Build\n\n cd ${SRCROOT}/Build/RestKit\n find * -name '*.h' | xargs chmod a-w\nfi\n\nexit 0";
|
||||
};
|
||||
255DE2B810FFBFBF00A85891 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Disabled - Xcode 4\n#osascript Specs/Support/set_ip_address.scpt";
|
||||
};
|
||||
25956980126DF159004BAC4C /* Protect Copied Headers */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -1739,7 +1513,7 @@
|
||||
253A09191255250C00976E89 /* NSDictionary+RKAdditions.m in Sources */,
|
||||
253A091C1255250F00976E89 /* NSString+InflectionSupport.m in Sources */,
|
||||
253A091F1255251900976E89 /* RKSearchEngine.m in Sources */,
|
||||
3F02F585131D6682004E1F54 /* RKXMLParser.m in Sources */,
|
||||
3F76235E133A316800EEAAA7 /* RKXMLParser.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1749,7 +1523,7 @@
|
||||
files = (
|
||||
253A09251255258500976E89 /* RKManagedObject.m in Sources */,
|
||||
253A09271255258600976E89 /* RKManagedObjectStore.m in Sources */,
|
||||
2543201D1256179900A315CF /* RKObjectSeeder.m in Sources */,
|
||||
2543201D1256179900A315CF /* RKManagedObjectSeeder.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1817,6 +1591,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3F762360133A32BB00EEAAA7 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
@@ -1855,6 +1636,11 @@
|
||||
target = 25956956126DF0A8004BAC4C /* RestKit */;
|
||||
targetProxy = 25956981126DF182004BAC4C /* PBXContainerItemProxy */;
|
||||
};
|
||||
25F48FF41327DA2300F6B59F /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = UISpec;
|
||||
targetProxy = 25F48FF31327DA2300F6B59F /* PBXContainerItemProxy */;
|
||||
};
|
||||
3F4BC8F312DE4C7F00048E71 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 2523360411E79F090048F9B4 /* RestKitThree20 */;
|
||||
@@ -2203,14 +1989,15 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
Build,
|
||||
Specs/Support/OCMock/Headers,
|
||||
Specs/Support/UISpec/headers,
|
||||
);
|
||||
INFOPLIST_FILE = "Specs/UISpec-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/Specs/Support/UISpec/bin/UISpec\"",
|
||||
"\"$(SRCROOT)/Specs/Support/OCMock\"",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-force_load",
|
||||
@@ -2241,14 +2028,15 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
Build,
|
||||
Specs/Support/OCMock/Headers,
|
||||
Specs/Support/UISpec/headers,
|
||||
);
|
||||
INFOPLIST_FILE = "Specs/UISpec-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/Specs/Support/UISpec/bin/UISpec\"",
|
||||
"\"$(SRCROOT)/Specs/Support/OCMock\"",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-force_load",
|
||||
@@ -2264,6 +2052,38 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3F76236A133A32BB00EEAAA7 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
DSTROOT = /tmp/RestKitLibXMLParser.dst;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "RestKitLibXMLParser/RestKitLibXMLParser-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvmgcc42;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
3F76236B133A32BB00EEAAA7 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
DSTROOT = /tmp/RestKitLibXMLParser.dst;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "RestKitLibXMLParser/RestKitLibXMLParser-Prefix.pch";
|
||||
GCC_VERSION = com.apple.compilers.llvmgcc42;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
@@ -2357,6 +2177,14 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3F762369133A32BB00EEAAA7 /* Build configuration list for PBXNativeTarget "RestKitLibXMLParser" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3F76236A133A32BB00EEAAA7 /* Debug */,
|
||||
3F76236B133A32BB00EEAAA7 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
|
||||
7
RestKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
RestKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:RestKit.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
7
RestKitLibXMLParser/RestKitLibXMLParser-Prefix.pch
Normal file
7
RestKitLibXMLParser/RestKitLibXMLParser-Prefix.pch
Normal file
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'RestKitLibXMLParser' target in the 'RestKitLibXMLParser' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
Submodule Specs/Support/UISpec updated: 7f6bd0cdcd...d539d8ca14
@@ -16,11 +16,17 @@
|
||||
*/
|
||||
+(void)runSpecsConformingToProtocol:(Protocol *)protocol afterDelay:(NSTimeInterval)delay;
|
||||
|
||||
/**
|
||||
* Run all UISpec classes inheriting from a given base class
|
||||
*/
|
||||
+(void)runSpecsInheritingFromClass:(Class)class afterDelay:(NSTimeInterval)delay;
|
||||
|
||||
/**
|
||||
* Infers which set of UISpec classes to run from the following environment variables:
|
||||
* UISPEC_PROTOCOL - Specifies a protocol to run
|
||||
* UISPEC_SPEC - Specifies a spec class to run
|
||||
* UISPEC_METHOD - Specifies an example to run (requires UISPEC_SPEC to be set)
|
||||
* UISPEC_EXIT_ON_FINISH - When YES, instructs UISpecRunner to terminate the application when specs run is complete
|
||||
*/
|
||||
+(void)runSpecsFromEnvironmentAfterDelay:(int)seconds;
|
||||
|
||||
|
||||
@@ -6,8 +6,42 @@
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <objc/runtime.h>
|
||||
#import "UISpec+UISpecRunner.h"
|
||||
#import <objc/runtime.h>
|
||||
#import "UIConsoleLog.h"
|
||||
#import "UISpec.h"
|
||||
|
||||
@interface UISpecRunnerLog : UIConsoleLog {
|
||||
BOOL _exitOnFinish;
|
||||
}
|
||||
|
||||
// When YES, the application will terminate after specs finish running
|
||||
@property (nonatomic, assign) BOOL exitOnFinish;
|
||||
|
||||
@end
|
||||
|
||||
@implementation UISpecRunnerLog
|
||||
|
||||
@synthesize exitOnFinish = _exitOnFinish;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_exitOnFinish = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)onFinish:(int)count {
|
||||
[super onFinish:count];
|
||||
|
||||
if (self.exitOnFinish) {
|
||||
exit(errors.count);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface UISpec ()
|
||||
|
||||
@@ -53,10 +87,56 @@
|
||||
[self performSelector:@selector(runSpecClasses:) withObject:specClasses afterDelay:delay];
|
||||
}
|
||||
|
||||
+(NSArray*)specClassesInheritingFromClass:(Class)parentClass {
|
||||
int numClasses = objc_getClassList(NULL, 0);
|
||||
Class *classes = NULL;
|
||||
|
||||
classes = malloc(sizeof(Class) * numClasses);
|
||||
numClasses = objc_getClassList(classes, numClasses);
|
||||
|
||||
NSMutableArray *result = [NSMutableArray arrayWithObject:parentClass];
|
||||
for (NSInteger i = 0; i < numClasses; i++)
|
||||
{
|
||||
Class superClass = classes[i];
|
||||
do
|
||||
{
|
||||
superClass = class_getSuperclass(superClass);
|
||||
} while(superClass && superClass != parentClass);
|
||||
|
||||
if (superClass == nil)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ([self isASpec:classes[i]]) {
|
||||
[result addObject:classes[i]];
|
||||
}
|
||||
}
|
||||
|
||||
free(classes);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+(void)runSpecsInheritingFromClass:(Class)class afterDelay:(NSTimeInterval)delay {
|
||||
NSArray* specClasses = [self specClassesInheritingFromClass:class];
|
||||
NSLog(@"Executing Specs: %@", specClasses);
|
||||
[self performSelector:@selector(runSpecClasses:) withObject:specClasses afterDelay:delay];
|
||||
}
|
||||
|
||||
+(void)runSpecsFromEnvironmentAfterDelay:(int)seconds {
|
||||
char* protocolName = getenv("UISPEC_PROTOCOL");
|
||||
char* specName = getenv("UISPEC_SPEC");
|
||||
char* exampleName = getenv("UISPEC_EXAMPLE");
|
||||
char* exitOnFinish = getenv("UISPEC_EXIT_ON_FINISH");
|
||||
|
||||
UISpecRunnerLog* log = [[UISpecRunnerLog alloc] init];
|
||||
[UISpec setLog:(UILog*)log];
|
||||
|
||||
if (NULL == exitOnFinish || [[NSString stringWithUTF8String:exitOnFinish] isEqualToString:@"YES"]) {
|
||||
log.exitOnFinish = YES;
|
||||
}
|
||||
|
||||
if (protocolName) {
|
||||
Protocol* protocol = NSProtocolFromString([NSString stringWithUTF8String:protocolName]);
|
||||
NSLog(@"[UISpecRunner] Running Specs conforming to Protocol: %@", [NSString stringWithUTF8String:protocolName]);
|
||||
@@ -68,11 +148,12 @@
|
||||
NSLog(@"[UISpecRunner] Running Examples %s on Spec %s", exampleName, specName);
|
||||
[UISpec runSpec:[NSString stringWithUTF8String:specName] example:[NSString stringWithUTF8String:exampleName] afterDelay:seconds];
|
||||
} else if (specName) {
|
||||
NSLog(@"[UISpecRunner] Running Spec %s", specName);
|
||||
[UISpec runSpec:[NSString stringWithUTF8String:specName] afterDelay:seconds];
|
||||
NSLog(@"[UISpecRunner] Running Spec classes inheriting from %s", specName);
|
||||
Class class = NSClassFromString([NSString stringWithUTF8String:specName]);
|
||||
[UISpec runSpecsInheritingFromClass:class afterDelay:seconds];
|
||||
} else {
|
||||
[UISpec runSpecsAfterDelay:seconds];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "UISpec.h"
|
||||
#import "UISpec+UISpecRunner.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
84
uispec
84
uispec
@@ -1,84 +0,0 @@
|
||||
#!/bin/zsh
|
||||
# UISpec CLI Runner
|
||||
# By Blake Watters <blake@twotoasters.com>
|
||||
# Base code taken from: http://stackoverflow.com/questions/1514302/build-and-run-an-xcode-project-via-applescript
|
||||
|
||||
BUILD_PATH=$(dirname $0)
|
||||
|
||||
while [[ -z $BUILD_FILE && $BUILD_PATH != "/" ]]; do
|
||||
BUILD_FILE=$(find $BUILD_PATH -name '*.xcodeproj' -maxdepth 1)
|
||||
BUILD_PATH=$(dirname $BUILD_PATH)
|
||||
done
|
||||
|
||||
if [[ -z $BUILD_FILE ]]; then
|
||||
echo "Couldn't find an xcode project file in directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Applescript likes's : instead of / (because it's insane)
|
||||
BUILD_FILE=${BUILD_FILE//\//:}
|
||||
|
||||
# Find the latest Simulator SDK
|
||||
SIMULATOR_SDKS=( /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/*.sdk )
|
||||
|
||||
SIMULATOR_SDK=${SIMULATOR_SDKS[-1]}
|
||||
SIMULATOR_SDK_STRING=$(basename ${(L)SIMULATOR_SDK%.[a-z]*})
|
||||
|
||||
if [[ -z $SIMULATOR_SDK ]]; then
|
||||
echo "Couldn't find a simulator SDK"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use the first arg as the spec to run...
|
||||
UISPEC_RUN_SPEC=$1
|
||||
|
||||
osascript <<SCRIPT
|
||||
on setEnvironmentVariable(variableName, variableValue)
|
||||
|
||||
tell application "Xcode"
|
||||
tell active project document
|
||||
set executableName to name of executable of active target as string
|
||||
tell executable executableName
|
||||
|
||||
-- Check to see if the fallback path already exists
|
||||
set hasVariable to false as boolean
|
||||
|
||||
repeat with environmentVariable in environment variables
|
||||
if name of environmentVariable is equal to variableName then
|
||||
-- Overwrite any value
|
||||
set value of environmentVariable to variableValue
|
||||
set active of environmentVariable to yes
|
||||
set hasVariable to true as boolean
|
||||
exit repeat
|
||||
end if
|
||||
end repeat
|
||||
|
||||
-- Since the fallback path doesn't exist yet, create it
|
||||
if not hasVariable then
|
||||
make new environment variable with properties {name:variableName, value:variableValue, active:yes}
|
||||
end if
|
||||
end tell -- executable
|
||||
end tell -- active project document
|
||||
end tell -- Xcode
|
||||
|
||||
end setEnvironmentVariable
|
||||
|
||||
application "iPhone Simulator" quit
|
||||
application "iPhone Simulator" activate
|
||||
|
||||
tell application "Xcode"
|
||||
open "$BUILD_FILE"
|
||||
set targetProject to project of active project document
|
||||
my setEnvironmentVariable("UISPEC_RUN_SPEC", "$UISPEC_RUN_SPEC")
|
||||
|
||||
tell targetProject
|
||||
set active build configuration type to build configuration type "Debug"
|
||||
set active SDK to "$SIMULATOR_SDK_STRING"
|
||||
set the active target to the target named "UISpec"
|
||||
set value of build setting "SDKROOT" of build configuration "Debug" of active target to "$SIMULATOR_SDK"
|
||||
|
||||
build targetProject
|
||||
launch targetProject
|
||||
end tell
|
||||
end tell
|
||||
SCRIPT
|
||||
1
uispec.opts
Normal file
1
uispec.opts
Normal file
@@ -0,0 +1 @@
|
||||
--workspace RestKit.xcodeproj/project.xcworkspace
|
||||
Reference in New Issue
Block a user