Commit Graph

554 Commits

Author SHA1 Message Date
Blake Watters
c493ec3cd5 Fix for missing rename on OAuth client 2011-09-20 19:04:43 -04:00
Blake Watters
eb887e38c6 Refactored OAuth support for merge into master. fixes #84, #211
Cleaned up @rodchile's excellent work integration OAuth 1.0 and 2.0 into RestKit. Changes
are as follows:

* Introduced new RKRequestAuthenticationType to replace the forceBasicAuthentication and other
    methods for influencing how authorization works.
* Moved TDOAuth code into Vendor/
* Renamed authorization code flow classes and delegate methods for clarity.
2011-09-20 15:52:17 -04:00
Blake Watters
144533cdd5 Renamed RKObjectDynamicMapping to RKDynamicObjectMapping to better mesh with Cocoa idioms. fixes #354
The old class name has been aliased for backwards compatibility.
2011-09-20 13:18:09 -04:00
Blake Watters
0c96aedc85 Fix use of reserved 'class' keyword that breaks import into Objective-C++. fixes #355
Added basic spec file that imports the public headers into an Objective-C++ source file.
2011-09-20 13:04:29 -04:00
Blake Watters
e535f3abf0 Removed unnecessary InflectionSupport 2011-09-20 12:36:39 -04:00
Blake Watters
70c73f2981 Fixed issue with order dependence in Core Data connections. fixes #173
Since OM 2.0 connection of relationships happened during the object mapping operation
instead of aggregately at the end of the process. In this commit, we have introduced a lightweight
queue for deferring portions of the mapping operation until a larger aggregate mapping has completed.

The changes are as follows:
* Introduced RKMappingOperationQueue for queueing portions of mapping. This is a synchronous queue modeled off
of NSOperationQueue that does NOT use threading (for Core Data friendliness).
* RKObjectMappingOperation now has a RKMappingOperationQueue queue property that defaults to nil
* RKObjectMappingOperation instances built via RKObjectMapper will has a mapping operation queue
assigned to the property.
* If a queue is present, RKManagedObjectMappingOperation will use it to defer the connection of relationships.
* At the end of an RKObjectMapper process, the mapping operation queue used by all mapping operations created
during the process will be executed. This allows all relationships to be connected after all object creation
has completed.

The queue is general purpose, though currently only used for the connection of relationships.
2011-09-20 12:02:50 -04:00
Blake Watters
91a6e9423e Added convenience methods and docs for mapping NSSet and NSArray attribute collections. fixes #285 2011-09-19 21:03:02 -04:00
Blake Watters
4b287a5b24 Added ability to overload the params on object loaders composed by the object manager. fixes #352 2011-09-19 19:54:58 -04:00
Greg Combs
e33d9e519a Unfortunately introduced an error while fixing #342 in commit a1b2201 in the RKObjectMappingProvider where retrieving mappings by class was broken, partially, yet passed unit tests. This fixes the bug and covers the gap in the tests. 2011-09-18 21:06:19 -05:00
Greg Combs
52e5a7b911 AppDirectory return value was incorrect for OSX Core Data. Fixes #350. Thanks @martijnthe 2011-09-18 12:00:23 -05:00
Greg Combs
c49310162e RKPathMatcher can now accommodate non-KVM dots that follow parameter keys in the pattern. Where /:filename.json would fail before, we use special escapes like /:filename\.json ... this fixes #349. Thanks @jverkoey for the fix and @coryalder for the catch. 2011-09-16 15:35:27 -05:00
Greg Combs
62d7042ebc Merge pull request #334 from parkerboundy/add-apache-license
Add the Apache License to headers (Issue #145) Closes #145.  Thanks @parkerboundy.
2011-09-14 21:56:15 -07:00
Greg Combs
a1b2201f2a Fixes a crash in RKObjectMappingProvider where objectMappingsForClass is called after some dynamic mappings have been registered in the provider. Fixes #342. Thanks to @bjornjonsson 2011-09-14 20:32:37 -05:00
Greg Combs
3006516794 Merge pull request #347 from bjornjonsson/master
Fix of RKObjectMappingOperation does not respect forceCollectionMapping (Issue #341) This fixes #341.  A solid pull request with good tests.  I ran through it prior to his new test coverage last night and it looked good with no discernible side-effects.  With the new test coverage, the added code gets exercised appropriately.
2011-09-14 17:20:10 -07:00
Björn Jonsson
90ef91e890 Fix of RKObjectMappingOperation does not respect forceCollectionMapping (Issue 341)
Includes test cases and fixtures
2011-09-14 22:50:03 +02:00
Blake Watters
05b94cae5d Added assertions for object store nilness.
The managedObjectContext helper method will now raise an exception if there is not a sharedManager or the current sharedManager does not have an objectStore configured.
2011-09-13 13:13:12 -04:00
Blake Watters
b946fc3cd9 Small header file changes for Appledoc output changes 2011-09-13 13:13:11 -04:00
Greg Combs
20fb9043b3 Clarified header documentation for RKRequest's cancel method. 2011-09-13 10:53:19 -05:00
Greg Combs
fc5f2b38be Minor cleanup of some whitespace after recent feature pull requests 2011-09-13 01:30:43 -05:00
Greg Combs
6dd1e8da40 Now gracefully handles escaping interpolated resource paths in RKRouter, RKMakePathWithObject, and RKPathMatcher. By adding an encoding handler to SOCKit, we now (by default, but optionally) add percent escapes to each object's property value while it's being interpolated into a resource path pattern, like /stuff/things/:others?apikey=:apikey ... that way it won't brutally mangle the slashes and question marks and ampersands that exist in the resource path pattern, while at the same time properly escaping those same characters when they occur inside the object's property value. Closes #221 2011-09-13 00:50:55 -05:00
Greg Combs
2bd113fd42 Added two static initializers to RKDotNetDateFormatter and amended the specs. 2011-09-09 09:51:35 -05:00
Greg Combs
9ce25f5689 Added RKDotNetDateFormatter to translate back and forth between NSDate and strings like /Date(1234567890123-0500)/ Also includes header docs and specs. Fixes #264 2011-09-09 03:26:46 -05:00
Blake Watters
5c359edfc5 Use relative imports for headers in Support module. Removed import of SCNetworkReachability in RKClient 2011-09-08 19:26:33 -04:00
Blake Watters
4226067b8a Use Grand Central Dispatch to fire reachability notifications for IP addresses 2011-09-08 19:22:58 -04:00
Blake Watters
bebc08e34c Remove improper import of RKObjectLoader in RKClient 2011-09-08 19:22:28 -04:00
Blake Watters
12bacf9be4 Removed references to sharedQueue from Advanced Tutorial sources 2011-09-08 09:38:26 -04:00
Blake Watters
6ed37f0eb9 Fix Cocoa 512 errors logged from RKRequestCache. fixes #246
The following changes were made:
* Added isCacheable to RKRequest
* Return nil for cacheKey on non-cacheable RKRequests
* Updated RKRequestCache to ensure attempts to cache uncacheable requests has no effect
* Added basic unit tests and expanded comments on some parts of the cache API
2011-09-07 22:39:57 -04:00
Blake Watters
2a89404f7d Return nil from needNewBodyStream: to avoid weirdness with connections being revived. refs #335 2011-09-07 21:37:11 -04:00
Parker
ccb3cb4332 Added license to files in the Three20 directory 2011-09-07 12:03:57 -04:00
Parker
990ab16a6b Added Apache License to files in Support directory
Didn't add license to: NSString+InflectionSupport.h,
NSString+InflectionSupport.m, RKParser.h
2011-09-07 12:02:29 -04:00
Parker
a58eb6dcf2 Added Apache License to files in Support/Parsers directory 2011-09-07 11:58:16 -04:00
Parker
c888af6f25 Added Apache License header to files in CoreData directory
Didn't add header to NSManagedObject+ActiveRecord.h,
NSManagedObject+ActiveRecord.m and RKManagedObjectCache.h .
NSManagedObject+ActiveRecord was adapted from someone else, and
RKManagedObjectCache has different code formatting. Will update those
once I get confirmation on them.
2011-09-07 11:55:17 -04:00
Parker
99250475ad added Apache License headers to all files in ObjectMapping directory 2011-09-07 11:31:01 -04:00
Parker
e8b24a3959 added apache license to everything in the Network directory
I got tired of doing individual commits for each file, so I just did the
rest of the directory.
2011-09-07 10:45:42 -04:00
Parker
43040935d7 added apache license 2011-09-07 10:36:49 -04:00
Parker
f4c83a8ae8 added apache license 2011-09-07 10:36:16 -04:00
Parker
a43b711b14 added apache license 2011-09-07 10:35:40 -04:00
Parker
aae7a7f642 added blank comment to the RestKit.h header
Added another blank comment row to the header to keep with the previous
comment styles.
2011-09-07 10:34:26 -04:00
Parker
940437573e re-added apache header to RestKit.h (got the date wrong) 2011-09-07 10:30:23 -04:00
Parker
d7a21c688f Revert "added header to RestKit.h"
This reverts commit 4482850aff.
2011-09-07 10:29:24 -04:00
Parker
4482850aff added header to RestKit.h 2011-09-07 10:27:56 -04:00
Greg Combs
feb941d241 Oops … RKPathMatcher merge didn't actually have RKPathMatcher .h and .m in it … Thanks @dmthomas for the heads up. 2011-09-06 16:44:55 -05:00
Greg Combs
e38562ffce Introduces RKPathMatcher. This is basically a dressed up front end to jverkoey/SOCKit. Using this will make it very easy to do complex things with patterns, resource paths, and object property interpolation thereof. Whereas RKMakePathWithObject() once took parenthesized parameters like "/stuff/(things)" it now uses colons like "/stuff/:things". It has specs and updated header docs where appropriate. Closes #305. 2011-09-06 15:51:18 -05:00
Blake Watters
4299cab994 Added convenience accessors on RKObjectManager for the requestCache and requestQueue. Cleaned up some styling and normalized method names. 2011-09-06 11:36:50 -04:00
Blake Watters
2ccc44954a Configured default locale to en_US_POSIX for default date formatters. closes #273 2011-09-05 17:54:07 -04:00
Blake Watters
54007c78d4 Reworked Brendan Ribera's contributions around time zone handling to eliminate the use of transient
NSDateFormatters, added a preferredDateFormatter for use when serializing dates to strings,
replaced the use of the description method for date encoding to strings with invocation of the
preferredDateFormatter, added new attribute transformation strategy from NSDate -> NSString properties
(also using the preferred date formatter), and provided customization support for date handling globally
and on a per-mapping basis. closes #200, closes #313, closes #309, closes #308
2011-09-05 17:25:43 -04:00
Blake Watters
6cc7f1e4d6 Added test coverage for queue loading count being decremented when the response is unmappable. fixes #230, fixes #286 2011-09-03 17:29:58 -04:00
Blake Watters
d9d0f7a650 Eliminated the global sharedQueue in favor of allowing each RKClient to own its a private queue. This eliminates problems where multiple clients are tracking reachability notifications and mutating the suspension state on a single queue. If you want to use a single queue across multiple RKClient instances, you can assign a single queue to both and worry about suspension and reachability yourself. fixes #278 2011-09-03 15:52:45 -04:00
Blake Watters
32461e916f Added support for parsing XML containing CDATA content. fixes #327 2011-09-03 14:30:07 -04:00
Blake Watters
b96940cc64 Eliminated requirement to use -all_load linker flag. Fixed breakage in OS X builds due to ivar/property name disagreement. Removed references to all_load from the install docs. fixes #239 2011-09-01 20:52:46 -04:00