Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Commit

Permalink
omniauth 2 for douban
Browse files Browse the repository at this point in the history
  • Loading branch information
hlcfan committed Sep 10, 2012
1 parent ab18503 commit 4801ee2
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 87 deletions.
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'http://rubygems.org' source 'http://rubygems.org'


gem 'rails', '3.2.2' gem 'rails'
gem "rails-i18n","0.1.8" gem "rails-i18n","0.1.8"
gem 'jquery-rails' gem 'jquery-rails'
gem "rails_autolink", ">= 1.0.4" gem "rails_autolink", ">= 1.0.4"
Expand All @@ -24,12 +24,10 @@ gem 'bootstrap-will_paginate'
gem "omniauth" gem "omniauth"
gem 'omniauth-openid', "~> 1.0.1" gem 'omniauth-openid', "~> 1.0.1"
gem "omniauth-weibo-oauth2" gem "omniauth-weibo-oauth2"
gem 'omniauth-twitter'


#gem "omniauth-github", "~> 1.0.0" #gem "omniauth-github", "~> 1.0.0"
#gem "omniauth-twitter", "~> 0.0.7" #gem "omniauth-twitter", "~> 0.0.7"
gem "omniauth-douban", :git => "git://github.com/ballantyne/omniauth-douban.git" gem "omniauth-douban-oauth2"

# Markdown 格式 # Markdown 格式
gem 'redcarpet' gem 'redcarpet'
gem 'hpricot', '~> 0.8.5' gem 'hpricot', '~> 0.8.5'
Expand Down Expand Up @@ -70,3 +68,4 @@ gem 'therubyracer'


# To use debugger # To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug' # gem 'ruby-debug19', :require => 'ruby-debug'

124 changes: 50 additions & 74 deletions Gemfile.lock
Original file line number Original file line Diff line number Diff line change
@@ -1,19 +1,10 @@
GIT GIT
remote: git://github.com/anjlab/bootstrap-rails.git remote: git://github.com/anjlab/bootstrap-rails.git
revision: 9182e777aafb258f3741ff82f0672d33245de48d revision: f48c60c989d1dadb057490e83285c44e613fbc08
specs: specs:
anjlab-bootstrap-rails (2.1.0.0) anjlab-bootstrap-rails (2.1.1.1)
railties (>= 3.0) railties (>= 3.0)
sass sass (>= 3.2)

GIT
remote: git://github.com/ballantyne/omniauth-douban.git
revision: e3173ec1aa0c8572def6f696e5b2f8dadc7fa834
specs:
omniauth-douban (1.0.1)
multi_json
omniauth (~> 1.1.0)
omniauth-oauth (~> 1.0.1)


GIT GIT
remote: git://github.com/ichord/jquery-atwho-rails.git remote: git://github.com/ichord/jquery-atwho-rails.git
Expand All @@ -24,42 +15,42 @@ GIT
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
actionmailer (3.2.2) actionmailer (3.2.8)
actionpack (= 3.2.2) actionpack (= 3.2.8)
mail (~> 2.4.0) mail (~> 2.4.4)
actionpack (3.2.2) actionpack (3.2.8)
activemodel (= 3.2.2) activemodel (= 3.2.8)
activesupport (= 3.2.2) activesupport (= 3.2.8)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.1) journey (~> 1.0.4)
rack (~> 1.4.0) rack (~> 1.4.0)
rack-cache (~> 1.1) rack-cache (~> 1.2)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
sprockets (~> 2.1.2) sprockets (~> 2.1.3)
activemodel (3.2.2) activemodel (3.2.8)
activesupport (= 3.2.2) activesupport (= 3.2.8)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.2) activerecord (3.2.8)
activemodel (= 3.2.2) activemodel (= 3.2.8)
activesupport (= 3.2.2) activesupport (= 3.2.8)
arel (~> 3.0.2) arel (~> 3.0.2)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.2) activeresource (3.2.8)
activemodel (= 3.2.2) activemodel (= 3.2.8)
activesupport (= 3.2.2) activesupport (= 3.2.8)
activesupport (3.2.2) activesupport (3.2.8)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
arel (3.0.2) arel (3.0.2)
bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1)
blankslate (2.1.2.4) blankslate (3.1.2)
bootstrap-will_paginate (0.0.7) bootstrap-will_paginate (0.0.8)
will_paginate will_paginate
bson (1.6.4) bson (1.7.0)
bson_ext (1.6.4) bson_ext (1.7.0)
bson (~> 1.6.4) bson (~> 1.7.0)
builder (3.0.0) builder (3.0.3)
coffee-rails (3.2.2) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0) railties (~> 3.2.0)
Expand All @@ -84,9 +75,9 @@ GEM
hike (1.2.1) hike (1.2.1)
hpricot (0.8.6) hpricot (0.8.6)
httpauth (0.1) httpauth (0.1)
i18n (0.6.0) i18n (0.6.1)
journey (1.0.4) journey (1.0.4)
jquery-rails (2.1.1) jquery-rails (2.1.2)
railties (>= 3.1.0, < 5.0) railties (>= 3.1.0, < 5.0)
thor (~> 0.14) thor (~> 0.14)
json (1.7.5) json (1.7.5)
Expand All @@ -100,8 +91,8 @@ GEM
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
mime-types (1.19) mime-types (1.19)
mongo (1.6.2) mongo (1.3.1)
bson (~> 1.6.2) bson (>= 1.3.1)
mongo-rails-instrumentation (0.2.4) mongo-rails-instrumentation (0.2.4)
mongoid (2.4.12) mongoid (2.4.12)
activemodel (~> 3.1) activemodel (~> 3.1)
Expand All @@ -116,38 +107,24 @@ GEM
railties (>= 3.0.0) railties (>= 3.0.0)
multi_json (1.3.6) multi_json (1.3.6)
multipart-post (1.1.5) multipart-post (1.1.5)
oauth (0.4.6)
<<<<<<< HEAD
oauth2 (0.6.1)
faraday (~> 0.7)
=======
oauth2 (0.8.0) oauth2 (0.8.0)
faraday (~> 0.8) faraday (~> 0.8)
>>>>>>> 349cb51ed95b7637266c4ad1b09f071e7eb23972
httpauth (~> 0.1) httpauth (~> 0.1)
jwt (~> 0.1.4) jwt (~> 0.1.4)
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.2) rack (~> 1.2)
omniauth (1.1.0) omniauth (1.1.1)
hashie (~> 1.2) hashie (~> 1.2)
rack rack
omniauth-oauth (1.0.1) omniauth-douban-oauth2 (0.0.5)
oauth
omniauth (~> 1.0) omniauth (~> 1.0)
<<<<<<< HEAD omniauth-oauth2 (~> 1.1)
omniauth-oauth2 (1.0.2)
oauth2 (~> 0.6.0)
=======
omniauth-oauth2 (1.1.0) omniauth-oauth2 (1.1.0)
oauth2 (~> 0.8.0) oauth2 (~> 0.8.0)
>>>>>>> 349cb51ed95b7637266c4ad1b09f071e7eb23972
omniauth (~> 1.0) omniauth (~> 1.0)
omniauth-openid (1.0.1) omniauth-openid (1.0.1)
omniauth (~> 1.0) omniauth (~> 1.0)
rack-openid (~> 1.3.1) rack-openid (~> 1.3.1)
omniauth-twitter (0.0.12)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
omniauth-weibo-oauth2 (0.2.0) omniauth-weibo-oauth2 (0.2.0)
omniauth (~> 1.0) omniauth (~> 1.0)
omniauth-oauth2 (~> 1.0) omniauth-oauth2 (~> 1.0)
Expand All @@ -165,25 +142,25 @@ GEM
rack rack
rack-test (0.6.1) rack-test (0.6.1)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.2) rails (3.2.8)
actionmailer (= 3.2.2) actionmailer (= 3.2.8)
actionpack (= 3.2.2) actionpack (= 3.2.8)
activerecord (= 3.2.2) activerecord (= 3.2.8)
activeresource (= 3.2.2) activeresource (= 3.2.8)
activesupport (= 3.2.2) activesupport (= 3.2.8)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.2) railties (= 3.2.8)
rails-i18n (0.1.8) rails-i18n (0.1.8)
i18n (~> 0.5) i18n (~> 0.5)
rails_autolink (1.0.9) rails_autolink (1.0.9)
rails (~> 3.1) rails (~> 3.1)
railties (3.2.2) railties (3.2.8)
actionpack (= 3.2.2) actionpack (= 3.2.8)
activesupport (= 3.2.2) activesupport (= 3.2.8)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
thor (~> 0.14.6) thor (>= 0.14.6, < 2.0)
rake (0.9.2.2) rake (0.9.2.2)
rdoc (3.12) rdoc (3.12)
json (~> 1.4) json (~> 1.4)
Expand All @@ -204,15 +181,15 @@ GEM
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
therubyracer (0.10.2) therubyracer (0.10.2)
libv8 (~> 3.3.10) libv8 (~> 3.3.10)
thor (0.14.6) thor (0.16.0)
tilt (1.3.3) tilt (1.3.3)
treetop (1.4.10) treetop (1.4.10)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.33) tzinfo (0.3.33)
uglifier (1.2.7) uglifier (1.3.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (~> 1.3) multi_json (~> 1.0, >= 1.0.2)
warden (1.2.1) warden (1.2.1)
rack (>= 1.0) rack (>= 1.0)
wicked_pdf (0.7.9) wicked_pdf (0.7.9)
Expand Down Expand Up @@ -242,12 +219,11 @@ DEPENDENCIES
mongoid_auto_increment_id (= 0.4.0) mongoid_auto_increment_id (= 0.4.0)
mongoid_rails_migrations (~> 0.0.14) mongoid_rails_migrations (~> 0.0.14)
omniauth omniauth
omniauth-douban! omniauth-douban-oauth2
omniauth-openid (~> 1.0.1) omniauth-openid (~> 1.0.1)
omniauth-twitter
omniauth-weibo-oauth2 omniauth-weibo-oauth2
pygments.rb (~> 0.2.4) pygments.rb (~> 0.2.4)
rails (= 3.2.2) rails
rails-i18n (= 0.1.8) rails-i18n (= 0.1.8)
rails_autolink (>= 1.0.4) rails_autolink (>= 1.0.4)
redcarpet redcarpet
Expand Down
12 changes: 3 additions & 9 deletions config/initializers/devise.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -233,16 +233,10 @@
# manager.default_strategies(:scope => :user).unshift :some_external_strategy # manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end # end


<<<<<<< HEAD api_config = YAML::load(File.open("#{Rails.root}/config/config.yml"))
config.omniauth :weibo, "2853851567", "249ae4ac6cb3bf18f70e234597a32721"


config.omniauth :twitter, "16FZ4s0TVqPXouVquq11rw", "Aw52VoWHPT9ssJTUpNQV0by75FGOWKbSHT9SAOOA0" config.omniauth :weibo, api_config['defaults']['weibo_api_key'], api_config['defaults']['weibo_secret']
=======
api_config = YAML::load(File.open("#{Rails.root}/config/config.yml"))


config.omniauth :weibo, api_config['defaults']['weibo_api_key'], api_config['defaults']['weibo_secret'] config.omniauth :douban, api_config['defaults']['douban_api_key'], api_config['defaults']['douban_secret']

config.omniauth :douban, api_config['defaults']['douban_api_key'], api_config['defaults']['douban_secret']
>>>>>>> 349cb51ed95b7637266c4ad1b09f071e7eb23972
end end


0 comments on commit 4801ee2

Please sign in to comment.