[REBASE] Rename Router -> RouteSet. Add new Router class for generating URL's from the routes.

This commit is contained in:
Blake Watters
2012-06-20 22:08:42 -04:00
parent 6c3b75039b
commit fe9bfe59da
14 changed files with 417 additions and 330 deletions

View File

@@ -144,7 +144,7 @@ dispatch_queue_t rk_get_network_processing_queue(void)
{
self = [super init];
if (self) {
_router = [RKRouter new];
self.router = [[RKRouter new] autorelease];
self.HTTPHeaders = [NSMutableDictionary dictionary];
self.additionalRootCertificates = [NSMutableSet set];
self.defaultHTTPEncoding = NSUTF8StringEncoding;
@@ -161,7 +161,7 @@ dispatch_queue_t rk_get_network_processing_queue(void)
// Configure observers
[self addObserver:self forKeyPath:@"reachabilityObserver" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
[self addObserver:self forKeyPath:@"baseURL" options:NSKeyValueObservingOptionNew context:nil];
[self addObserver:self forKeyPath:@"baseURL" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:nil];
[self addObserver:self forKeyPath:@"requestQueue" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld | NSKeyValueObservingOptionInitial context:nil];
}
@@ -327,6 +327,9 @@ dispatch_queue_t rk_get_network_processing_queue(void)
// Don't crash if baseURL is nil'd out (i.e. dealloc)
if (! [newBaseURL isEqual:[NSNull null]]) {
// Update the router
self.router.baseURL = newBaseURL;
// Configure a cache for the new base URL
[_requestCache release];
_requestCache = [[RKRequestCache alloc] initWithPath:[self cachePath]