Permalink
Browse files

gree, mixi methods now accepts app_id.

  • Loading branch information...
1 parent 88e25ab commit 435699f6c4032a2ca58a79b8045c3f6d432ccd10 @xanagi xanagi committed Aug 26, 2011
@@ -74,6 +74,13 @@ def self.api_endpoint(arg = nil)
@api_endpoint if @api_endpoint
end
+ def self.app_id(arg = nil)
+ if arg
+ @app_id = arg
+ end
+ @app_id if @app_id
+ end
+
def self.proxy_class(arg = nil)
if arg
@proxy_class = arg
@@ -3,7 +3,7 @@ module OpensocialWap::OAuth::Helpers
# mobage 用 oauthヘルパー.
# バッチタイプ(mobageではTrusted モデル)のリクエスト時には、xoauth_requestor_id
- # としてapp_id を渡すところ、BasicHelper と異なる.
+ # としてapp_id を渡すところが、BasicHelper と異なる.
class MobageHelper < BasicHelper
def authorization_header(api_request, options = nil)
@@ -17,14 +17,5 @@ def authorization_header(api_request, options = nil)
oauth_client_helper = ::OAuth::Client::Helper.new(api_request, opts.merge(options))
oauth_client_helper.header
end
-
- private
-
- def self.app_id(arg = nil)
- if arg
- @app_id = arg
- end
- @app_id if @app_id
- end
end
end
@@ -10,13 +10,15 @@ def gree(config, &block)
consumer_key = @consumer_key
consumer_secret = @consumer_secret
+ app_id = @app_id
container_host = @sandbox ? 'mgadget-sb.gree.jp' : "mgadget.gree.jp"
api_endpoint = @sandbox ? 'http://os-sb.gree.jp/api/rest/' : "http://os.gree.jp/api/rest/"
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key consumer_key
consumer_secret consumer_secret
api_endpoint api_endpoint
+ app_id app_id
end
@config.opensocial_wap.oauth = OpensocialWap::Config::OAuth.configure do
helper_class OpensocialWap::OAuth::Helpers::BasicHelper
@@ -10,13 +10,15 @@ def mixi(config, &block)
consumer_key = @consumer_key
consumer_secret = @consumer_secret
+ app_id = @app_id
container_host = @access_from_pc ? 'ma.test.mixi.net' : 'ma.mixi.net'
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxyForMixi
consumer_key consumer_key
consumer_secret consumer_secret
api_endpoint 'http://api.mixi-platform.com/os/0.8/'
+ app_id app_id
end
@config.opensocial_wap.oauth = OpensocialWap::Config::OAuth.configure do
helper_class OpensocialWap::OAuth::Helpers::BasicHelper
@@ -1,3 +1,3 @@
module OpensocialWap
- VERSION = "0.0.3"
+ VERSION = "0.0.4"
end
@@ -1,7 +1,7 @@
PATH
remote: ../../../
specs:
- opensocial-wap (0.0.1)
+ opensocial-wap (0.0.3)
oauth
rack (>= 1.2.1)
@@ -68,7 +68,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.16)
nokogiri (1.4.4)
- oauth (0.4.4)
+ oauth (0.4.5)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)

0 comments on commit 435699f

Please sign in to comment.