What have you found for these years?

2012-03-18

[ANN] rest-more 1.0.0 released

rest-more Build Status

by Cardinal Blue http://cardinalblue.com

Lin Jen-Shin (godfat) had given a talk about rest-core on RubyConf Taiwan 2011. The slide is in English, but the talk is in Mandarin.

You can also read some other topics at doc.

DESCRIPTION:

Various REST clients such as Facebook and Twitter built with [rest-core][]

CHANGES:

rest-more 1.0.0 – 2012-03-17

Enhancement

All clients are now asynchrony-aware. Asynchrony support is added in rest-core >=1.0.0. Whenever you pass a callback block, the response would then be passed to the block. Error handling is different, too. In synchronous style, usually an exception would be raised, but in asynchronous style, the exception would be passed to the block instead of being raised.

  • [Dropbox] Added Dropbox support.
  • [Bing::Error] Added code method to get the original error code.
  • [Twitter::Error] Added code method to get HTTP status code.
  • [Facebook::Error] Instead of passing [true], pass error messages.
  • [Facebook] Pages related API is reimplemented. Passing a block would result a serious call to the callback block, ending with a nil.
  • [Config] Make sure the default attributes module is there even if the config file isn’t presented.

INSTALLATION:

gem install rest-more

Or if you want development version, put this in Gemfile:

gem 'rest-more', :git => 'git://github.com/cardinalblue/rest-more.git',
                 :submodules => true

SYNOPSIS:

The simplest usage:

require 'rest-more'

RestCore::Twitter.new.statuses('_cardinalblue') # get user tweets
RestCore::Github.new.get('users/cardinalblue')  # get user info

linkedin = RestCore::Linkedin.new(:consumer_key    => '...',
                                  :consumer_secret => '...')
linkedin.authorize_url!   # copy and paste the URL in browser to authorize
linkedin.authorize!('..') # paste your code from browser
linkedin.me               # get current user info

RestCore::Facebook.new.get('4') # get user info

Runnable example is here: example/simple.rb. Please see slides from rubyconf.tw/2011 for concepts.

0 retries:

Post a Comment

Note: Only a member of this blog may post a comment.



All texts are licensed under CC Attribution 3.0