Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove untested gateway middleware

TODO: Allow modifications to middleware stack for people who want to
continue using the library to talk to gateways.
  • Loading branch information...
commit 7e501a99fe15ba9be69d2b791fc1d99c1904542b 1 parent 24ee20c
@sferik authored
View
5 lib/twitter/config.rb
@@ -25,9 +25,6 @@ module Config
# @see http://developer.typepad.com/typepad-twitter-api/twitter-api.html
DEFAULT_ENDPOINT = 'https://api.twitter.com'
- # The gateway server if none is set
- DEFAULT_GATEWAY = nil
-
# This endpoint will be used by default when updating statuses with media
DEFAULT_MEDIA_ENDPOINT = 'https://upload.twitter.com'
@@ -56,7 +53,6 @@ module Config
:consumer_key,
:consumer_secret,
:endpoint,
- :gateway,
:oauth_token,
:oauth_token_secret,
:proxy,
@@ -92,7 +88,6 @@ def reset
self.consumer_key = DEFAULT_CONSUMER_KEY
self.consumer_secret = DEFAULT_CONSUMER_SECRET
self.endpoint = DEFAULT_ENDPOINT
- self.gateway = DEFAULT_GATEWAY
self.media_endpoint = DEFAULT_MEDIA_ENDPOINT
self.oauth_token = DEFAULT_OAUTH_TOKEN
self.oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET
View
4 lib/twitter/connection.rb
@@ -1,6 +1,5 @@
require 'faraday'
require 'twitter/core_ext/hash'
-require 'twitter/request/gateway'
require 'twitter/request/multipart_with_file'
require 'twitter/request/oauth'
require 'twitter/response/parse_json'
@@ -32,11 +31,10 @@ def connection
builder.use Twitter::Request::OAuth, credentials if credentials?
builder.use Faraday::Request::Multipart
builder.use Faraday::Request::UrlEncoded
- builder.use Twitter::Request::Gateway, gateway if gateway
builder.use Twitter::Response::RaiseClientError
builder.use Twitter::Response::ParseJson
builder.use Twitter::Response::RaiseServerError
- builder.adapter(adapter)
+ builder.adapter adapter
end
end
View
20 lib/twitter/request/gateway.rb
@@ -1,20 +0,0 @@
-require 'faraday'
-
-module Twitter
- module Request
- class Gateway < Faraday::Middleware
-
- def call(env)
- url = env[:url].dup
- url.host = @gateway
- env[:url] = url
- @app.call(env)
- end
-
- def initialize(app, gateway)
- @app, @gateway = app, gateway
- end
-
- end
- end
-end
View
1  spec/twitter/client_spec.rb
@@ -36,7 +36,6 @@
:oauth_token_secret => 'OS',
:adapter => :typhoeus,
:endpoint => 'http://tumblr.com/',
- :gateway => 'gateway.example.com',
:proxy => 'http://erik:sekret@proxy.example.com:8080',
:search_endpoint => 'http://google.com/',
:media_endpoint => 'https://upload.twitter.com/',
Please sign in to comment.
Something went wrong with that request. Please try again.