Permalink
Commits on Dec 19, 2011
  1. Handle exceeding rate limit.

    Owain R Hunt
    Owain R Hunt committed Dec 19, 2011
    Connection returns NSError with UAGithubAPILimitReached domain.
  2. Remove references to connections array.

    Owain R Hunt
    Owain R Hunt committed Dec 19, 2011
    No longer used since the move to blocks.
  3. Add -dealloc to UAReachability.

    Owain R Hunt
    Owain R Hunt committed Dec 19, 2011
    reachabilityRef is a CF object and so needs releasing via CFRelease() even though we're under ARC. (Credit Donny Kurniawan).
Commits on Nov 12, 2011
  1. ARCify.

    Owain R Hunt
    Owain R Hunt committed Nov 12, 2011
    Converted to ARC using migration tool.
  2. Remove obsolete iVars from UAGithubJSONParser.

    Owain R Hunt
    Owain R Hunt committed Nov 12, 2011
  3. Remove NSData from failure block in UAGithubURLConnection.

    Owain R Hunt
    Owain R Hunt committed Nov 12, 2011
    Not used, so we only need the error.
  4. Remove initialiser and dealloc from UAGithubJSONParser.

    Owain R Hunt
    Owain R Hunt committed Nov 12, 2011
    No longer used as everything is through the class method now.
  5. Implement organisation methods.

    Owain R Hunt
    Owain R Hunt committed Nov 12, 2011
    Die a little inside every time I use a 'z' instead of an 's'.
Commits on Nov 9, 2011
  1. Add Organisation methods.

    Owain R Hunt
    Owain R Hunt committed Nov 9, 2011
    Methods definitions added to header, stub implementations added to implementation.
  2. Make methods return BOOL where appropriate.

    Owain R Hunt
    Owain R Hunt committed Nov 9, 2011
    All methods that should return a BOOL value (e.g. for No Content responses, or where we're checking if a value is true or false) now do so.
Commits on Nov 3, 2011
  1. Make -sendRequest's return type variable.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Still returns an id, but this can be either an NSArray, an NSNumber with YES or NO for boolean handling, or an NSError.
    - If it's an array, json was received and parsed as expected.
    - If it's an NSNumber YES, that's a successful call to a method that expects a No Content response.
    - If it's an NSNumber NO, that's a successful call to a method that returns an expected 404.
    - If it's an NSError, it's either a connection error, an HTTP error other than the above, or a parser error. NSError instance can be inspected to determine which.
    
    This all enables us to return e.g. a BOOL from a call to UAGE. This is useful in situations where Github will return no data, when calling e.g. -follows:completion:. This can now return a simple YES or NO. Error handling is also significantly improved, in that it now exists.
  2. Rename repositoriescompletion: to repositoriesWithCompletion:

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Missed in the first pass.
  3. Clean up -sendRequest:… error handling.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Returns error if JSON serialisation fails.
  4. UAGithubURLConnection class method now returns an id.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
  5. Clean up UAGithubJSONParser and add error checking.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Removed old commented-out class method for instantiation. Re-added dateElement handling. Added error handling - +parse:error: now takes a pointer to an error that gets filled if either the JSON deserialization fails or Github returns an error in JSON.
  6. Annotate Followers methods.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Unclear from method names what's going on. Should rename to make it obvious.
  7. Remove commented-out obsolete API calls.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Old delete, publicise, privatise repository methods. Now handled elsewhere.
  8. Removed followers method with no corresponding API call.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Not even sure where - (id)followedBy:(NSString *)user completion:(id(^)(id obj))successBlock_; came from.
  9. Renamed all methods to use 'completion:' instead of 'success:'.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
    Callback gets called whether the call succeeds or not, so completion is more semantically accurate.
  10. Filled out Events stub methods.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
  11. Temporarily silence 2 warnings for unused variables.

    Owain R Hunt
    Owain R Hunt committed Nov 3, 2011
Commits on Nov 1, 2011
  1. Add Events methods.

    Owain R Hunt
    Owain R Hunt committed Nov 1, 2011
    Stub methods and request types for new Events API.
Commits on Oct 31, 2011
  1. Remove delegates.

    Owain R Hunt
    Owain R Hunt committed Oct 31, 2011
    Now we're using blocks, we can get rid of the delegates we were using previously, namely UAGithubEngineDelegate and UAGithubJSONParserDelegate. Also allows us to shave method names, e.g. + (id)parseJSON:(NSData *)theJSON delegate:(id)theDelegate connectionIdentifier:(NSString *)theIdentifier requestType:(UAGithubRequestType)reqType responseType:(UAGithubResponseType)respType; becomes + (id)parseJSON:(NSData *)theJSON;.
  2. Refactor all engine methods to use blocks.

    Owain R Hunt
    Owain R Hunt committed Oct 31, 2011
    All engine methods now return an id instead of an NSString, and all now take a block as their final argument, to be executed when connection and parsing is complete.
  3. Blockify UAGithubEngine.m

    Owain R Hunt
    Owain R Hunt committed Oct 31, 2011
    - Engine methods now take an extra parameter: successBlock. This block takes an id and returns an id.
    - -sendRequest:… methods now return an id instead of an NSString. This id is the JSON returned from the API, parsed for ObjC consumption.
    - All calls to -sendRequest:… are wrapped in a call to successBlock().
    - When calling engine methods, we populate the successBlock parameter with what we want to be executed on successful completion of the call.
    - All the above is in place of using delegation. May (should?) eventually lead to the fiery death of UAGithubEngineDelegate.
  4. Class method for JSON parsing.

    Owain R Hunt
    Owain R Hunt committed Oct 31, 2011
    UAGithubJSONParser is now interfaced with using a class method that returns the parsed JSON instead of farting around with delegates.
  5. Change asynchronous to synchronous in UAGithubURLConnection.

    Owain R Hunt
    Owain R Hunt committed Oct 31, 2011
    Ensure any completion-blocks execute *after* the connection returns instead of trying to do it beforehand.
Commits on Oct 28, 2011
  1. @autorelease.

    Owain R Hunt
    Owain R Hunt committed Oct 28, 2011
Commits on Oct 25, 2011
  1. Blockification.

    Owain R Hunt
    Owain R Hunt committed Oct 25, 2011
    UAGE now uses blocks throughout the main engine file. URLConnections are fired off using a new class method on UAGithubURLConnection, which takes a success/failure block pair. The success block calls a new class method on UAGithubJSONParser, which also takes a success/failure block pair. All remaining methods that were delegate calls are now called or handled by the core -sendRequest:… method.
Commits on Oct 24, 2011
  1. Add blocks-based method to the JSON parser.

    Owain R Hunt
    Owain R Hunt committed Oct 24, 2011
    + (void)parseJSON:(NSData *)theJSON delegate:(id)theDelegate connectionIdentifier:(NSString *)theIdentifier requestType:(UAGithubRequestType)reqType responseType:(UAGithubResponseType)respType success:(void(^)(id))successBlock_ failure:(void(^)(id, NSError *))failureBlock_;
    
    Takes a successBlock and a failureBlock, removing the need for delegate callbacks etc.
  2. Add blocks-based method to UAGithubURLConnection.

    Owain R Hunt
    Owain R Hunt committed Oct 24, 2011
    + (void)asyncRequest:(NSURLRequest *)request requestType:(UAGithubRequestType)reqType responseType:(UAGithubResponseType)respTyp success:(void(^)(NSData *, NSURLResponse *))successBlock_ failure:(void(^)(NSData *, NSError *))failureBlock_;
    
    Takes a successBlock and a failureBlock, removing the need for delegate callbacks etc. Influenced by https://github.com/rickerbh/NSURLConnection-Blocks.
  3. Comments.

    Owain R Hunt
    Owain R Hunt committed Oct 24, 2011
Commits on Oct 12, 2011
  1. Check for 204 in -connection:didReceiveResponse: and cancel connectio…

    Owain R Hunt
    Owain R Hunt committed Oct 12, 2011
    …n if true, calling delegate's -noContentResponseReceivedForConnection: method without going through unnecessary parsing steps.
    
    Not sure if this is where this code is going to stay. T for B Mr Melty-Brain.