Removed unneeded code.
authorbobaman@google.com <bobaman@google.com@c1d61fac-ed7f-fcc1-18f7-ff78120a04ef>
Mon, 13 Sep 2010 21:54:35 +0000 (21:54 +0000)
committerbobaman@google.com <bobaman@google.com@c1d61fac-ed7f-fcc1-18f7-ff78120a04ef>
Mon, 13 Sep 2010 21:54:35 +0000 (21:54 +0000)
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@30 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef

lib/oauth/request_proxy/simple_request.rb [deleted file]

diff --git a/lib/oauth/request_proxy/simple_request.rb b/lib/oauth/request_proxy/simple_request.rb
deleted file mode 100644 (file)
index f797866..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-require 'oauth/request_proxy/base'
-require 'addressable/uri'
-
-module OAuth
-  module RequestProxy
-    class SimpleRequest < OAuth::RequestProxy::Base
-      proxies Array
-
-      def method
-        return @request[0]
-      end
-
-      def uri
-        return @request[1]
-      end
-
-      def headers
-        @headers ||= (begin
-          headers_hash = {}
-          @request[2].each do |key, value|
-            headers_hash[key] = value
-          end
-          headers_hash
-        end)
-        return @headers
-      end
-
-      def body
-        @body ||= (begin
-          body_string = ""
-          @request[3].each do |chunk|
-            body_string += chunk
-          end
-          body_string
-        end)
-        return @body
-      end
-
-      def parameters
-        @parameters ||= (begin
-          self.query_parameters.merge(
-            self.post_parameters
-          )
-        end)
-        return @parameters
-      end
-
-      def query_parameters
-        @query_parameters ||= (begin
-          Addressable::URI.parse(self.uri).normalize.query_values || {}
-        end)
-        return @query_parameters
-      end
-
-      def post_parameters
-        @post_parameters ||= (begin
-          # We could be more liberal here and aggressively downcase,
-          # but it's cleaner if we force the usage of the canonical form,
-          # and we're just going to replace this eventually anyways.
-          if self.method == 'POST' && self.headers['Content-Type'] == 
-              'application/x-www-form-urlencoded'
-            # Even though an Array would be better here, we're stuck using a
-            # Hash because that's what the 'oauth' gem expects.
-            parameter_hash = {}
-            for key, value in Addressable::URI.form_unencode(self.body)
-              parameter_hash[key] = value
-            end
-            parameter_hash
-          else
-            {}
-          end
-        end)
-        return @post_parameters
-      end
-      
-      def normalized_uri
-        @normalized_uri ||= Addressable::URI.parse(self.uri).normalize.to_str
-        return @normalized_uri
-      end
-    end
-  end
-end