Skip to content
Commits on Apr 25, 2009
  1. lazyuser.rb: #hash alias for #username.

    committed
    To use LazyUser objects as hash keys, as we'll need for User.traverse, we
    define the #hash method.
  2. Recursively traverse a user's follower network.

    committed
    User.traverse takes a username and block as an argument. It finds the user's
    followers, yielding each one to the block. It then repeats this process for
    each of the followers, recursively.
    
    This begs for a recursive function, but I kept exhausting the stack that way,
    so this implementation will have to do.
Commits on Apr 24, 2009
  1. Alias :login to the current username for speed.

    committed
    Calling .login on a LazyUser caused an API request despite the fact that we
    already had the value in the instance variable @username. Now we set up a
    reader called 'login' to optimise for the common case of wanting just the
    username of a LazyUser object.
  2. Require LazyRepository.

    committed
  3. LazyRepository object.

    committed
  4. Support missing class methods.

    committed
  5. Revert "This reverts commit 486914f4cf1ce746ac32efae786c134349d97836."

    committed
    This reverts commit bcd02a5306c8ce148d756ea2c1591e72c258773b.
  6. Make User#following and User#followers class meths.

    committed
    This is part of the grand refactoring. For now, these methods no longer coerce
    their results into Arrays of Users; this will return.
  7. Make .property a class method for Resources.

    committed
    So as to prevent methods using routes other than the object's default from
    having to suffer the performance penalty of the main route being called first,
    we want such methods to be implemented as class methods. Methods like
    User#followers is an example. It uses the current .property method which is an
    instance method. This change will allow such methods the desired flexibility.
  8. Call worker's class method where possible.

    committed
    method_missing now tries to dispatch to the worker's class before initializing
    @worker. Priority is so given to afford the worker every chance to avoid an
    expensive initialization when not needed. To make this work, we pass the class
    method the arguments we received in our constructor.
  9. Delegator for User class.

    committed
Commits on Apr 23, 2009
  1. @fcoury

    Merge commit 'runpaint/master'

    fcoury committed
  2. @fcoury

    Fix README

    fcoury committed
  3. Testing...

    committed
  4. Make .keys and .emails return Arrays.

    committed
    The .keys and .emails methods were returning HTTParty responses which were
    confusing to the caller, and contained an unnecessary level of depth. We now
    index the response with the appropriate hash key, thus returning its Array
    value.
  5. Removing superfluous yield.

    committed
    The `submit` method yields to the block it's been passed, prints out a trace,
    then makes almost the same yield again. I assume that this is in error, and
    could have been caused by my previous merge.
  6. Undo 3cb8fbd.

    committed
    Commit 3cb8fbd has been made obsolete by
    commit 67320c5. Now we're appending the
    credentials to GET requests, .keys and .emails can return to using the correct
    request type.
  7. Add credentials to `default_params` for auth'd GET.

    committed
    We want the token and login to be sent for all authenticated queries. They
    were being sent for POST requests, but, seemingly, not for GETs, causing
    methods relying on the latter to fail. HTTParty's `default_params` method
    causes parameters so set to be sent on every request. We specify `login` and
    `token` as default parameters if the request is authenticated.
  8. POST is required for /user/keys and /user/emails.

    committed
    The .keys and .emails methods returned a "not authenticated" error because
    they were fetched via GET and thus the credentials were not sent. Using POST
    fixes this bug.
Commits on Apr 22, 2009
  1. @fcoury
  2. @fcoury

    Version bump to 0.0.7

    fcoury committed
  3. @fcoury

    Add '?' suffix to generated method names of bools

    committed with fcoury
    Objects with values that are either true or false have an '?' appended to
    their name to fit with standard Ruby convention. For example, Repository
    objects now have a .fork? and .private? method. This convention is not
    reflected in the value of the @keys instance variable, because we assume
    callers will use it to iterate through the instance variables, whose names do
    not have a '?' suffix...
    
    Note: This commit theoretically breaks backward compatibility, as the
    unadorned method names no longer work.
    
    This closes #2.
    
    Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
Something went wrong with that request. Please try again.