Archive for the 'Ruby' Category

Future of RFacebook

Thursday, January 10th, 2008

I’ve been maintaining RFacebook for the last 9 months or so, and recently I haven’t had the time to maintain it. Unfortunately, I don’t have any current projects that actually use the Facebook platform on a daily basis, so I have had to rely primarily on patches from the community (thank you!) and bug reports from other developers.

When I wrote the initial library, I was fairly new to Ruby and proper language idioms. Needless to say, this has led to some not-so-great designs that are difficult to fix while maintaining backward-compatibility. In particular, the direct access to the API via method_missing has turned out to be problematic for some people. Also, the so-called facepricot chaining (which gives quick access to XML parsing) is particularly poorly designed and I would like to get rid of it if possible.

Ideally, RFacebook 1.0 would do away with the cruft and simplify some of the design. As I considered certain aspects to redesign, I definitely re-evaluated Facebooker, a very solid looking Gem and plugin from Chad Fowler and some other experienced Ruby guys. Much of the improvements I would like to make to RFacebook are already present in Facebooker - API objects converted to Ruby objects, API methods are Ruby-ified, solid documentation, simplified Rails support, etc. Since RFacebook 1.0 would break a lot of applications (with the removal of facepricot and others), I am considering deferring to Facebooker for future Rails Facebook development. I am a big fan of not reinventing the wheel, and I feel that the Facebooker team has already achieved the improvements that RFacebook needs.

Through the process of writing and maintaining RFacebook, I’ve definitely learned quite a bit about Ruby, Rails, behavior-driven development, and the community around it all. Your comments, feedback, and encouragement helped make it a valuable experience. However, at this time I would really like to take on some new projects.

Regardless, I definitely do not want to leave existing RFacebook developers hanging. If you want to take over the RFacebook project, please let me know via the comments. I have also contacted the Facebooker developers to see if they are interested in a compatibility module (which I would write) for Facebooker to ease the transition from RFacebook to Facebooker. Please let me know your thoughts.

RFacebook 0.9.8 out, reinstall your plugin too

Wednesday, January 9th, 2008

Hey everyone, RFacebook 0.9.8 is released. The core API has been cleaned up a bit (although Facepricot is still in there, I plan on deprecating it in version 1.0 in favor of something much less hackish). The biggest change is that the plugin is now COMPLETELY separate from the Gem. This means that you’ll need to reinstall your plugin this time around:

script/plugin install svn://rubyforge.org/var/svn/rfacebook/trunk/rfacebook/plugins/rfacebook

The good part is that the Gem is easier to update on a less-frequent basis, while the plugin can get some serious work/reworking without requiring a Gem release each time. Also, everything should be Rails 2.0 compatible now. Let me know if you still experience any issues with Rails 2.0.

RFacebook to see some updates and code slimming

Friday, January 4th, 2008

It has been a while since I’ve updated RFacebook, and I finally have the time to do so. Again, I’m always looking for dedicated help, since my time is limited as it is. The project has gotten quite involved, and recent API changes + the Rails 2.0 release has complicated it somewhat.

In spite of the backlog of bugs and feature requests, you should see some improvements over the next few weeks. I plan on slimming down the code as much as possible, as well as removing some poorly designed portions of the library. I’ll have a few interim updates (0.98 and 0.99), but RFacebook 1.0 will have a much more solid core, with the Rails extensions pulled exclusively into a plugin.

Please let me know your biggest complaints with RFacebook (features, bugs, and code design) so that I can address them all fully. Good luck Facebooking!

RFacebook Gets Unit Tests

Monday, August 27th, 2007

Unit Tests Come to RFacebook

Finally, RFacebook on Rails has a unit testing suite. You can now run Rails testing like any other well-behaved Rails plugin. My apologies - this was a long time coming.

RFacebook Looking for Developers

The RFacebook project has been maintained mostly by myself, in addition to the very helpful patches of a few others (Evan Weaver and Scott Nedderman, to name just a few). In the coming months I will be quite busy, and I am looking for other developers that can help maintain the project.

To help ease new developers into the library, I’ve done a few things starting with version 0.9.2 of the gem:

  • Cleaned up the core - the API library is now cleaned up of cruft and is much easier to understand
  • Better documentation - the core API library is extensively documented, and the plugin extensions are getting better documentation as well.
  • Unit testing is well-separated - it is fairly simple to see where to place unit tests for any one component of RFacebook. Unit tests are organized into separate tests for Rails controller, model, sessions, plugin initialization, and core API calls.

Hopefully there are some great Rails developers that would like to contribute to what I think has become a pretty solid library, thanks to the already sizeable contributions of its users. With continuous vetting by tons of small developers, and a few large ones (like Causes), RFacebook should continue to provide a great, simple way to get into the Facebook Platform.

RFacebook 0.9.1 Released

Monday, August 20th, 2007

The newest RFacebook gem is released. This release should fix some more session issues, as well as give you better backtraces inside Facebook (when using the Facebook Debug Panel).

Short list of changes:

  • added basic backtrace rendering to Facebook Debug Panel
  • added “raw_xml” method to the Facepricot responses
  • parsing of facebook.yml is more helpful when you specify absolute URLs instead of relative paths
  • improved usage of fb_sig_session_key to create Rails sessions
  • miscellaneous corner case fixes to url_for and redirect_to

Hope this helps people out. Initial feedback sounds like it is a pretty solid release.

RFacebook on Rails update

Thursday, August 16th, 2007

The latest gem (0.8.8) adds support for mock ajax and Rails sessions when you are inside the Facebook Canvas. Detailed summary below

  • Rails session[] and flash[] work (only ActiveRecord and PStore session containers, memcached store in a future release)
  • Added in_mock_ajax? to all controllers, so that you know when you are handling a mock ajax operation
  • Added support for a new url_for parameter, :mock_ajax => true, so that you can override the http://app.facebook.com rewriting (since mock ajax URLs have to be absolute)
  • Fixed a bug where ampersands were being converted to &amp entities in URLs received from the API. Now, you can use fbsession.notifications_sendRequest(…).response, and the entities will automatically be gsub’ed with real ampersands
  • Thanks to everyone who filed bugs and contributed patches for this release! It’s looking pretty solid.

RFacebook on Rails

Monday, August 6th, 2007

Another update - wow these are coming fast now. This weekend I finished up another fairly major upgrade to RFacebook: a true Rails plugin. Features include:

  • fbsession and fbparams in both controllers and views
  • automatic URL rewriting when you are in the Canvas (all URLs made relative to apps.facebook.com)
  • acts_as_facebook_user
  • a unique debug panel to help with common issues
  • configuration via facebook.yml file
  • easy SSH tunneling so that you can develop from your local machine
  • no need to keep the plugin up to date - it stays up to date with the Gem

You can get all the information and documentation here: rfacebook.rubyforge.org.

Hope you enjoy the new features.