0.0
No commit activity in last 3 years
No release in over 3 years
ruby-openid wrappers to make it simpler for a rails app
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Rails OpenId¶ ↑

Rails OpenId is a very small library that intends to abstract away a little bit of ruby-openid to make it easier to use in Rails applications. It is a very infant library, use at your own peril.

Where?¶ ↑

The canonical places for this gem are:

Installation¶ ↑

This gem is provided through RubyGems.org so you need to have gem configured to pull gems from RubyGems.org.

Enabling RubyGems.org (formerly known as GemCutter)¶ ↑

You can skip this if you have RubyGems.org enabled (which is going to be the default in the future anyway). A properly configured environment should list rubygems.org or gemcutter.org in the gem sources, like:

$ gem sources
*** CURRENT SOURCES ***

http://rubygems.org/

If you don’t have it, you can probably add it this way:

$ gem source -a http://rubygems.org/

Installing rails_openid manually¶ ↑

It’s simple a matter of running:

$ gem install rails_openid

and that’s it. Let me know if something breaks.

Installing through your Ruby on Rails 3 project¶ ↑

In the Gemfile file of your Ruby on Rails project you’ll need to add:

gem "rails_openid"

after that run

bundle install

and watch the magic happen, all required gems will be installed. Configuring your Rails project like that is something you’ll need anyway, so this is my recommended way.

Installing through your Ruby on Rails 2.3 project¶ ↑

In the environment.rb file of your Ruby on Rails project you’ll have some commented out lines like this:

# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"

After those you can just add

config.gem "rails_openid"

and then run

$ rake gems:install

and you’ll get this and all the gems your Rails project need installed. Configuring your Rails project like that is something you’ll need anyway, so this is my recommended way.

Getting started¶ ↑

A good way to get started is to run the open_id_scaffold generator:

./script/generate open_id_scaffold

Be sure to have the following line in your environment.rb (or the equivalent in Rails 3)

config.gem "rails_openid"
config.gem "ruby-openid", :lib => "openid"

To be able to run the provided tests, you’ll need mocha, so add:

config.gem "mocha"

to your config/environments/test.rb

If you don’t have a user model, you’ll want to create one. You can do it like this:

./script/generate model User name:string email:string nickname:string

To link your user model to their open ids add the following line to your user model:

has_many :open_ids

rails_openid come with tests you already have in your project. Their failures will show things you need to complete on your own. Also, if you go through the generated code, search for TODOs and you’ll find the places where there’s code you are likely to want to change.

API Documentation¶ ↑

Up to date api documentation should be automatically generated on rdoc.info/projects/pupeno/rails_openid

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2009 J. Pablo Fernández. See LICENSE for details.