Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

omniauth 2 for douban

  • Loading branch information...
commit 4801ee260ddd75f80c8e1cfd34d3a3845a1515f8 1 parent ab18503
@hlcfan authored
Showing with 56 additions and 87 deletions.
  1. +3 −4 Gemfile
  2. +50 −74 Gemfile.lock
  3. +3 −9 config/initializers/devise.rb
View
7 Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-gem 'rails', '3.2.2'
+gem 'rails'
gem "rails-i18n","0.1.8"
gem 'jquery-rails'
gem "rails_autolink", ">= 1.0.4"
@@ -24,12 +24,10 @@ gem 'bootstrap-will_paginate'
gem "omniauth"
gem 'omniauth-openid', "~> 1.0.1"
gem "omniauth-weibo-oauth2"
-gem 'omniauth-twitter'
#gem "omniauth-github", "~> 1.0.0"
#gem "omniauth-twitter", "~> 0.0.7"
-gem "omniauth-douban", :git => "git://github.com/ballantyne/omniauth-douban.git"
-
+gem "omniauth-douban-oauth2"
# Markdown 格式
gem 'redcarpet'
gem 'hpricot', '~> 0.8.5'
@@ -70,3 +68,4 @@ gem 'therubyracer'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
+
View
124 Gemfile.lock
@@ -1,19 +1,10 @@
GIT
remote: git://github.com/anjlab/bootstrap-rails.git
- revision: 9182e777aafb258f3741ff82f0672d33245de48d
+ revision: f48c60c989d1dadb057490e83285c44e613fbc08
specs:
- anjlab-bootstrap-rails (2.1.0.0)
+ anjlab-bootstrap-rails (2.1.1.1)
railties (>= 3.0)
- sass
-
-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)
+ sass (>= 3.2)
GIT
remote: git://github.com/ichord/jquery-atwho-rails.git
@@ -24,42 +15,42 @@ GIT
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.2.2)
- actionpack (= 3.2.2)
- mail (~> 2.4.0)
- actionpack (3.2.2)
- activemodel (= 3.2.2)
- activesupport (= 3.2.2)
+ actionmailer (3.2.8)
+ actionpack (= 3.2.8)
+ mail (~> 2.4.4)
+ 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.1)
+ rack-cache (~> 1.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.1.2)
- activemodel (3.2.2)
- activesupport (= 3.2.2)
+ sprockets (~> 2.1.3)
+ activemodel (3.2.8)
+ activesupport (= 3.2.8)
builder (~> 3.0.0)
- activerecord (3.2.2)
- activemodel (= 3.2.2)
- activesupport (= 3.2.2)
+ activerecord (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
- activeresource (3.2.2)
- activemodel (= 3.2.2)
- activesupport (= 3.2.2)
- activesupport (3.2.2)
+ 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)
bcrypt-ruby (3.0.1)
- blankslate (2.1.2.4)
- bootstrap-will_paginate (0.0.7)
+ blankslate (3.1.2)
+ bootstrap-will_paginate (0.0.8)
will_paginate
- bson (1.6.4)
- bson_ext (1.6.4)
- bson (~> 1.6.4)
- builder (3.0.0)
+ bson (1.7.0)
+ bson_ext (1.7.0)
+ bson (~> 1.7.0)
+ builder (3.0.3)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
@@ -84,9 +75,9 @@ GEM
hike (1.2.1)
hpricot (0.8.6)
httpauth (0.1)
- i18n (0.6.0)
+ i18n (0.6.1)
journey (1.0.4)
- jquery-rails (2.1.1)
+ jquery-rails (2.1.2)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
@@ -100,8 +91,8 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
- mongo (1.6.2)
- bson (~> 1.6.2)
+ mongo (1.3.1)
+ bson (>= 1.3.1)
mongo-rails-instrumentation (0.2.4)
mongoid (2.4.12)
activemodel (~> 3.1)
@@ -116,38 +107,24 @@ GEM
railties (>= 3.0.0)
multi_json (1.3.6)
multipart-post (1.1.5)
- oauth (0.4.6)
-<<<<<<< HEAD
- oauth2 (0.6.1)
- faraday (~> 0.7)
-=======
oauth2 (0.8.0)
faraday (~> 0.8)
->>>>>>> 349cb51ed95b7637266c4ad1b09f071e7eb23972
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-oauth (1.0.1)
- oauth
+ omniauth-douban-oauth2 (0.0.5)
omniauth (~> 1.0)
-<<<<<<< HEAD
- omniauth-oauth2 (1.0.2)
- oauth2 (~> 0.6.0)
-=======
+ omniauth-oauth2 (~> 1.1)
omniauth-oauth2 (1.1.0)
oauth2 (~> 0.8.0)
->>>>>>> 349cb51ed95b7637266c4ad1b09f071e7eb23972
omniauth (~> 1.0)
omniauth-openid (1.0.1)
omniauth (~> 1.0)
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 (~> 1.0)
omniauth-oauth2 (~> 1.0)
@@ -165,25 +142,25 @@ GEM
rack
rack-test (0.6.1)
rack (>= 1.0)
- rails (3.2.2)
- actionmailer (= 3.2.2)
- actionpack (= 3.2.2)
- activerecord (= 3.2.2)
- activeresource (= 3.2.2)
- activesupport (= 3.2.2)
+ 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.2)
+ railties (= 3.2.8)
rails-i18n (0.1.8)
i18n (~> 0.5)
rails_autolink (1.0.9)
rails (~> 3.1)
- railties (3.2.2)
- actionpack (= 3.2.2)
- activesupport (= 3.2.2)
+ 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)
+ thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
@@ -204,15 +181,15 @@ GEM
tilt (~> 1.1, != 1.3.0)
therubyracer (0.10.2)
libv8 (~> 3.3.10)
- thor (0.14.6)
+ thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
- uglifier (1.2.7)
+ uglifier (1.3.0)
execjs (>= 0.3.0)
- multi_json (~> 1.3)
+ multi_json (~> 1.0, >= 1.0.2)
warden (1.2.1)
rack (>= 1.0)
wicked_pdf (0.7.9)
@@ -242,12 +219,11 @@ DEPENDENCIES
mongoid_auto_increment_id (= 0.4.0)
mongoid_rails_migrations (~> 0.0.14)
omniauth
- omniauth-douban!
+ omniauth-douban-oauth2
omniauth-openid (~> 1.0.1)
- omniauth-twitter
omniauth-weibo-oauth2
pygments.rb (~> 0.2.4)
- rails (= 3.2.2)
+ rails
rails-i18n (= 0.1.8)
rails_autolink (>= 1.0.4)
redcarpet
View
12 config/initializers/devise.rb
@@ -233,16 +233,10 @@
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
-<<<<<<< HEAD
-config.omniauth :weibo, "2853851567", "249ae4ac6cb3bf18f70e234597a32721"
+ api_config = YAML::load(File.open("#{Rails.root}/config/config.yml"))
-config.omniauth :twitter, "16FZ4s0TVqPXouVquq11rw", "Aw52VoWHPT9ssJTUpNQV0by75FGOWKbSHT9SAOOA0"
-=======
-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 :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']
->>>>>>> 349cb51ed95b7637266c4ad1b09f071e7eb23972
+ config.omniauth :douban, api_config['defaults']['douban_api_key'], api_config['defaults']['douban_secret']
end
Please sign in to comment.
Something went wrong with that request. Please try again.