Skip to content

Commit

Permalink
changed from 'json' to 'multi_json' dependency so clients of Omniauth…
Browse files Browse the repository at this point in the history
… can use any JSON library they want
  • Loading branch information
jamesarosen committed Jun 13, 2010
1 parent dd78895 commit b980b88
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions oa-basic/lib/omniauth/strategies/campfire.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'omniauth/basic'
require 'multi_json'

module OmniAuth
module Strategies
class Campfire < HttpBasic
def initialize(app)
require 'json'
super(app, :campfire, nil)
end

Expand All @@ -17,7 +17,7 @@ def perform_authentication(endpoint)
end

def auth_hash
user_hash = JSON.parse(@response.body)['user']
user_hash = MultiJson.decode(@response.body)['user']
OmniAuth::Utils.deep_merge(super, {
'uid' => user_hash['id'],
'user_info' => user_info(user_hash),
Expand Down
2 changes: 1 addition & 1 deletion oa-basic/oa-basic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |gem|

gem.add_dependency 'oa-core', version
gem.add_dependency 'rest-client', '~> 1.5.1'
gem.add_dependency 'json', '~> 1.4.3'
gem.add_dependency 'multi_json', '~> 0.0.2'
gem.add_dependency 'nokogiri', '~> 1.4.2'

eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
Expand Down
4 changes: 2 additions & 2 deletions oa-oauth/lib/omniauth/strategies/facebook.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'json'
require 'omniauth/oauth'
require 'multi_json'

module OmniAuth
module Strategies
Expand All @@ -21,7 +21,7 @@ def initialize(app, app_id, app_secret, options = {})
end

def user_data
@data ||= JSON.parse(@access_token.get('/me'))
@data ||= MultiJson.decode(@access_token.get('/me'))
end

def request_phase(options = {})
Expand Down
4 changes: 2 additions & 2 deletions oa-oauth/lib/omniauth/strategies/github.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'json'
require 'omniauth/oauth'
require 'multi_json'

module OmniAuth
module Strategies
Expand All @@ -12,7 +12,7 @@ def initialize(app, app_id, app_secret, options = {})
end

def user_data
@data ||= JSON.parse(@access_token.get('/api/v2/json/user/show'))['user']
@data ||= MultiJson.decode(@access_token.get('/api/v2/json/user/show'))['user']
end

def user_info
Expand Down
4 changes: 2 additions & 2 deletions oa-oauth/lib/omniauth/strategies/twitter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'json'
require 'omniauth/oauth'
require 'multi_json'

module OmniAuth
module Strategies
Expand Down Expand Up @@ -40,7 +40,7 @@ def user_info
end

def user_hash
@user_hash ||= JSON.parse(@access_token.get('/1/account/verify_credentials.json').body)
@user_hash ||= MultiJson.decode(@access_token.get('/1/account/verify_credentials.json').body)
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions oa-oauth/oa-oauth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Gem::Specification.new do |gem|

gem.files = Dir.glob("{lib}/**/*") + %w(README.rdoc LICENSE.rdoc CHANGELOG.rdoc)

gem.add_dependency 'oa-core', version
gem.add_dependency 'rack', '~> 1.1.0'
gem.add_dependency 'json', '~> 1.4.3'
gem.add_dependency 'nokogiri', '~> 1.4.2'
gem.add_dependency 'oauth', '~> 0.4.0'
gem.add_dependency 'oauth2', '~> 0.0.8'
gem.add_dependency 'oa-core', version
gem.add_dependency 'rack', '~> 1.1.0'
gem.add_dependency 'multi_json', '~> 0.0.2'
gem.add_dependency 'nokogiri', '~> 1.4.2'
gem.add_dependency 'oauth', '~> 0.4.0'
gem.add_dependency 'oauth2', '~> 0.0.8'

eval File.read(File.join(File.dirname(__FILE__), '../development_dependencies.rb'))
end

0 comments on commit b980b88

Please sign in to comment.