From e421d1734dbb5d2e7d365633bb5a4ecd1e8dfdcd Mon Sep 17 00:00:00 2001 From: Steven Bazyl Date: Wed, 5 Sep 2012 14:05:48 -0700 Subject: [PATCH] Remove embedded version #s, use Gemfile --- Gemfile | 1 + bin/google-api | 11 ++--------- lib/compat/multi_json.rb | 1 - lib/google/api_client.rb | 5 ----- lib/google/api_client/reference.rb | 1 - spec/google/api_client/discovery_spec.rb | 4 ---- spec/google/api_client_spec.rb | 4 ---- 7 files changed, 3 insertions(+), 24 deletions(-) diff --git a/Gemfile b/Gemfile index 9f04393fc..9b0c75f25 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ gem 'autoparse', '>= 0.3.2' gem 'faraday', '~> 0.8.1' gem 'multi_json', '>= 1.0.0' gem 'extlib', '>= 0.9.15' +gem 'jwt', '~> 0.1.5' gem 'jruby-openssl', :platforms => :jruby group :development do diff --git a/bin/google-api b/bin/google-api index 136960485..f39b7908e 100755 --- a/bin/google-api +++ b/bin/google-api @@ -10,11 +10,8 @@ OAUTH_SERVER_PORT = 12736 require 'rubygems' require 'optparse' - -gem 'faraday', '~> 0.8.1' require 'faraday' require 'faraday/utils' - require 'webrick' require 'google/api_client/version' require 'google/api_client' @@ -187,7 +184,6 @@ HTML end def client - gem 'signet', '~> 0.4.0' require 'signet/oauth_1/client' require 'yaml' require 'irb' @@ -281,7 +277,6 @@ HTML ] def oauth_1_login - gem 'signet', '~> 0.4.0' require 'signet/oauth_1/client' require 'launchy' require 'yaml' @@ -349,7 +344,6 @@ HTML end def oauth_2_login - gem 'signet', '~> 0.4.0' require 'signet/oauth_2/client' require 'launchy' require 'yaml' @@ -471,9 +465,8 @@ HTML method = options[:http_method] method ||= request_body == '' ? 'GET' : 'POST' method.upcase! - request = [method, uri.to_str, headers, [request_body]] - request = client.generate_authenticated_request(:request => request) - response = client.transmit(request) + response = client.execute(:http_method => method, :uri => uri.to_str, + :headers => headers, :body => request_body) puts response.body exit(0) else diff --git a/lib/compat/multi_json.rb b/lib/compat/multi_json.rb index 7d3953ae9..f8267194e 100644 --- a/lib/compat/multi_json.rb +++ b/lib/compat/multi_json.rb @@ -1,4 +1,3 @@ -gem 'multi_json', '>= 1.0.0' require 'multi_json' if !MultiJson.respond_to?(:load) || MultiJson.method(:load).owner == Kernel diff --git a/lib/google/api_client.rb b/lib/google/api_client.rb index 35fa8d222..0a5ce0f74 100644 --- a/lib/google/api_client.rb +++ b/lib/google/api_client.rb @@ -13,7 +13,6 @@ # limitations under the License. -gem 'faraday', '~> 0.8.1' require 'faraday' require 'faraday/utils' require 'multi_json' @@ -114,7 +113,6 @@ module Google def authorization=(new_authorization) case new_authorization when :oauth_1, :oauth - gem 'signet', '~> 0.4.0' require 'signet/oauth_1/client' # NOTE: Do not rely on this default value, as it may change new_authorization = Signet::OAuth1::Client.new( @@ -128,7 +126,6 @@ module Google :client_credential_secret => 'anonymous' ) when :two_legged_oauth_1, :two_legged_oauth - gem 'signet', '~> 0.4.0' require 'signet/oauth_1/client' # NOTE: Do not rely on this default value, as it may change new_authorization = Signet::OAuth1::Client.new( @@ -137,7 +134,6 @@ module Google :two_legged => true ) when :oauth_2 - gem 'signet', '~> 0.4.0' require 'signet/oauth_2/client' # NOTE: Do not rely on this default value, as it may change new_authorization = Signet::OAuth2::Client.new( @@ -449,7 +445,6 @@ module Google # an ID token supplied by an untrusted client-side mechanism is valid. # Raises an error if the token is invalid or missing. def verify_id_token! - gem 'jwt', '~> 0.1.4' require 'jwt' require 'openssl' @certificates ||= {} diff --git a/lib/google/api_client/reference.rb b/lib/google/api_client/reference.rb index 331b49048..14ab24ca3 100644 --- a/lib/google/api_client/reference.rb +++ b/lib/google/api_client/reference.rb @@ -13,7 +13,6 @@ # limitations under the License. -gem 'faraday', '~> 0.8.1' require 'faraday' require 'faraday/utils' require 'multi_json' diff --git a/spec/google/api_client/discovery_spec.rb b/spec/google/api_client/discovery_spec.rb index ed3233fd3..9448fb181 100644 --- a/spec/google/api_client/discovery_spec.rb +++ b/spec/google/api_client/discovery_spec.rb @@ -17,15 +17,11 @@ require 'spec_helper' -gem 'faraday', '~> 0.8.1' require 'faraday' require 'faraday/utils' require 'multi_json' require 'compat/multi_json' - -gem 'signet', '~> 0.4.0' require 'signet/oauth_1/client' - require 'google/api_client' require 'google/api_client/version' diff --git a/spec/google/api_client_spec.rb b/spec/google/api_client_spec.rb index 856731254..868684cb9 100644 --- a/spec/google/api_client_spec.rb +++ b/spec/google/api_client_spec.rb @@ -14,13 +14,9 @@ require 'spec_helper' -gem 'faraday', '~> 0.8.1' require 'faraday' require 'faraday/utils' - -gem 'signet', '~> 0.4.0' require 'signet/oauth_1/client' - require 'google/api_client' require 'google/api_client/version'