Skip to content

Commit

Permalink
Merge pull request #4 from panupan/master
Browse files Browse the repository at this point in the history
Update to Rails 3.2.8
  • Loading branch information
gautamrege committed Nov 5, 2012
2 parents 3d7bb20 + eb40b9d commit f6f46d0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 54 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
db/*.sqlite3
log/*.log
tmp/**/*
*.swp
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '3.2.6'
gem 'rails', '3.2.8'
gem 'sqlite3'

group :assets do
Expand Down
92 changes: 46 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.6)
actionpack (= 3.2.6)
actionmailer (3.2.8)
actionpack (= 3.2.8)
mail (~> 2.4.4)
actionpack (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
actionpack (3.2.8)
activemodel (= 3.2.8)
activesupport (= 3.2.8)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
journey (~> 1.0.4)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.1.3)
activemodel (3.2.6)
activesupport (= 3.2.6)
activemodel (3.2.8)
activesupport (= 3.2.8)
builder (~> 3.0.0)
activerecord (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
activerecord (3.2.8)
activemodel (= 3.2.8)
activesupport (= 3.2.8)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
activesupport (3.2.6)
activeresource (3.2.8)
activemodel (= 3.2.8)
activesupport (= 3.2.8)
activesupport (3.2.8)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.0)
builder (3.0.4)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.3.3)
coffee-script-source (1.4.0)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
faraday (0.8.1)
faraday (0.8.4)
multipart-post (~> 1.1)
hashie (1.2.0)
hike (1.2.1)
httpauth (0.1)
i18n (0.6.0)
httpauth (0.2.0)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
jquery-rails (2.1.3)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.3)
jwt (0.1.4)
json (>= 1.2.4)
json (1.7.5)
jwt (0.1.5)
multi_json (>= 1.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.3.6)
multi_json (1.3.7)
multipart-post (1.1.5)
oauth2 (0.8.0)
faraday (~> 0.8)
httpauth (~> 0.1)
jwt (~> 0.1.4)
multi_json (~> 1.0)
rack (~> 1.2)
omniauth (1.1.0)
omniauth (1.1.1)
hashie (~> 1.2)
rack
omniauth-oauth2 (1.1.0)
omniauth-oauth2 (1.1.1)
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
polyglot (0.3.3)
Expand All @@ -78,27 +78,27 @@ GEM
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.6)
actionmailer (= 3.2.6)
actionpack (= 3.2.6)
activerecord (= 3.2.6)
activeresource (= 3.2.6)
activesupport (= 3.2.6)
rails (3.2.8)
actionmailer (= 3.2.8)
actionpack (= 3.2.8)
activerecord (= 3.2.8)
activeresource (= 3.2.8)
activesupport (= 3.2.8)
bundler (~> 1.0)
railties (= 3.2.6)
railties (3.2.6)
actionpack (= 3.2.6)
activesupport (= 3.2.6)
railties (= 3.2.8)
railties (3.2.8)
actionpack (= 3.2.8)
activesupport (= 3.2.8)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.1.20)
sass (3.2.1)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
Expand All @@ -108,15 +108,15 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
thor (0.15.4)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
uglifier (1.2.6)
tzinfo (0.3.34)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.3)
multi_json (~> 1.0, >= 1.0.2)

PLATFORMS
ruby
Expand All @@ -126,7 +126,7 @@ DEPENDENCIES
jquery-rails
omniauth
omniauth-oauth2
rails (= 3.2.6)
rails (= 3.2.8)
sass-rails (~> 3.2.3)
sqlite3
uglifier (>= 1.0.3)
5 changes: 4 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ for single sign on between multiple applications.

On the *Provider*, register this client application:
rails c
> Client.create!(:app_id => 'some key', :app_secret => 'some secret')
> @client = Client.new
> @client.app_id = 'some key'
> @client.app_secret = 'some secret'
> @client.save

Copy these same values in the *Client* config/initializers/omniauth.rb

Expand Down
11 changes: 7 additions & 4 deletions app/controllers/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ def create
user = User.find_by_uid(omniauth['uid'])
if not user
# New user registration
user = User.create!(:uid => omniauth['uid'],
:first_name => omniauth['extra']['first_name'],
:last_name => omniauth['extra']['last_name'])
end
user = User.new(:uid => omniauth['uid'])
end
user.first_name = omniauth['extra']['first_name']
user.last_name = omniauth['extra']['last_name']
user.save

#p omniauth

# Currently storing all the info
session[:user_id] = omniauth
Expand Down
4 changes: 2 additions & 2 deletions lib/josh_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class JoshId < OmniAuth::Strategies::OAuth2

info do
{
:name => raw_info['name'],
:email => raw_info['email']
}
end

extra do
{
'raw_info' => raw_info
:first_name => raw_info['extra']['first_name'],
:last_name => raw_info['extra']['last_name']
}
end

Expand Down

0 comments on commit f6f46d0

Please sign in to comment.