Resolve merge conflict

This commit is contained in:
Steven Bazyl committed 2014-12-15 11:50:16 -08:00
commit ec670e9fa0
26 files changed
+52 -105

No files matched your search

+1 -3
View File
@@ -32,7 +32,7 @@ require 'google/api_client/service_account'
require 'google/api_client/batch'
require 'google/api_client/gzip'
require 'google/api_client/client_secrets'
require 'google/api_client/railtie' if defined?(Rails::Railtie)
require 'google/api_client/railtie' if defined?(Rails)
module Google
@@ -692,5 +692,3 @@ module Google
end
end
require 'google/api_client/version'
+1 -1
View File
@@ -42,7 +42,7 @@ module Google
##
# Attempt to read in credentials from the specified file.
def load_credentials
if File.exist? self.path
if File.exists? self.path
File.open(self.path, 'r') do |file|
cached_credentials = JSON.load(file)
@authorization = Signet::OAuth2::Client.new(cached_credentials)
+2 -3
View File
@@ -14,7 +14,7 @@
require 'addressable/uri'
require 'google/api_client/reference'
require 'uuidtools'
require 'securerandom'
module Google
class APIClient
@@ -90,8 +90,7 @@ module Google
@global_callback = block if block_given?
@last_auto_id = 0
# TODO(sgomes): Use SecureRandom.uuid, drop UUIDTools when we drop 1.8
@base_id = UUIDTools::UUID.random_create.to_s
@base_id = SecureRandom.uuid
options[:uri] ||= 'https://www.googleapis.com/batch'
options[:http_method] ||= 'POST'
+1 -2
View File
@@ -13,7 +13,6 @@
# limitations under the License.
require 'multi_json'
require 'compat/multi_json'
@@ -63,7 +62,7 @@ module Google
end
while filename == nil
search_path ||= File.expand_path('.')
if File.exist?(File.join(search_path, 'client_secrets.json'))
if File.exists?(File.join(search_path, 'client_secrets.json'))
filename = File.join(search_path, 'client_secrets.json')
elsif search_path == '/' || search_path =~ /[a-zA-Z]:[\/\\]/
raise ArgumentError,
+3 -3
View File
@@ -15,7 +15,7 @@
require 'addressable/uri'
require 'multi_json'
require 'google/inflection'
require 'active_support/inflector'
require 'google/api_client/discovery/resource'
require 'google/api_client/discovery/method'
require 'google/api_client/discovery/media'
@@ -41,13 +41,13 @@ module Google
@discovery_document = discovery_document
metaclass = (class << self; self; end)
self.discovered_resources.each do |resource|
method_name = Google::INFLECTOR.underscore(resource.name).to_sym
method_name = ActiveSupport::Inflector.underscore(resource.name).to_sym
if !self.respond_to?(method_name)
metaclass.send(:define_method, method_name) { resource }
end
end
self.discovered_methods.each do |method|
method_name = Google::INFLECTOR.underscore(method.name).to_sym
method_name = ActiveSupport::Inflector.underscore(method.name).to_sym
if !self.respond_to?(method_name)
metaclass.send(:define_method, method_name) { method }
end
+3 -3
View File
@@ -15,7 +15,7 @@
require 'addressable/uri'
require 'google/inflection'
require 'active_support/inflector'
require 'google/api_client/discovery/method'
@@ -45,13 +45,13 @@ module Google
@discovery_document = discovery_document
metaclass = (class <<self; self; end)
self.discovered_resources.each do |resource|
method_name = Google::INFLECTOR.underscore(resource.name).to_sym
method_name = ActiveSupport::Inflector.underscore(resource.name).to_sym
if !self.respond_to?(method_name)
metaclass.send(:define_method, method_name) { resource }
end
end
self.discovered_methods.each do |method|
method_name = Google::INFLECTOR.underscore(method.name).to_sym
method_name = ActiveSupport::Inflector.underscore(method.name).to_sym
if !self.respond_to?(method_name)
metaclass.send(:define_method, method_name) { method }
end
+3 -5
View File
@@ -21,7 +21,7 @@ require 'autoparse'
require 'addressable/uri'
require 'addressable/template'
require 'google/inflection'
require 'active_support/inflector'
require 'google/api_client/errors'
@@ -78,10 +78,8 @@ module Google
# puts schema_data.inspect
if schema_name
api_name_string =
Google::INFLECTOR.camelize(api.name)
api_version_string =
Google::INFLECTOR.camelize(api.version).gsub('.', '_')
api_name_string = ActiveSupport::Inflector.camelize(api.name)
api_version_string = ActiveSupport::Inflector.camelize(api.version).gsub('.', '_')
# This is for compatibility with Ruby 1.8.7.
# TODO(bobaman) Remove this when we eventually stop supporting 1.8.7.
args = []
+2 -1
View File
@@ -1,3 +1,4 @@
require 'rails/railtie'
require 'google/api_client/logging'
module Google
@@ -9,7 +10,7 @@ module Google
#
class Railtie < Rails::Railtie
initializer 'google-api-client' do |app|
Google::APIClient.logger = Rails.logger
Google::APIClient.logger = app.logger
end
end
end
-1
View File
@@ -14,7 +14,6 @@
require 'faraday'
require 'faraday/request/multipart'
require 'multi_json'
require 'compat/multi_json'
require 'addressable/uri'
require 'stringio'
+1 -1
View File
@@ -120,7 +120,7 @@ module Google
if options.include? :cache_store
@cache_store = options[:cache_store]
else
cache_exists = File.exist?(DEFAULT_CACHE_FILE)
cache_exists = File.exists?(DEFAULT_CACHE_FILE)
if (cache_exists && File.writable?(DEFAULT_CACHE_FILE)) ||
(!cache_exists && File.writable?(Dir.pwd))
@cache_store = Google::APIClient::Service::SimpleFileStore.new(
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
require 'active_support/inflector'
module Google
class APIClient
class Service
@@ -25,7 +27,7 @@ module Google
# Handle resources.
root.discovered_resources.each do |resource|
method_name = Google::INFLECTOR.underscore(resource.name).to_sym
method_name = ActiveSupport::Inflector.underscore(resource.name).to_sym
if !self.respond_to?(method_name)
metaclass.send(:define_method, method_name) do
Google::APIClient::Service::Resource.new(service, resource)
@@ -35,7 +37,7 @@ module Google
# Handle methods.
root.discovered_methods.each do |method|
method_name = Google::INFLECTOR.underscore(method.name).to_sym
method_name = ActiveSupport::Inflector.underscore(method.name).to_sym
if !self.respond_to?(method_name)
metaclass.send(:define_method, method_name) do |*args|
if args.length > 1
+8 -13
View File
@@ -13,19 +13,14 @@
# limitations under the License.
# Used to prevent the class/module from being loaded more than once
if !defined?(::Google::APIClient::VERSION)
module Google
class APIClient
module VERSION
MAJOR = 0
MINOR = 7
TINY = 1
PATCH = nil
STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
end
module Google
class APIClient
module VERSION
MAJOR = 0
MINOR = 7
TINY = 1
PATCH = nil
STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
end
end
end
-28
View File
@@ -1,28 +0,0 @@
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
module Google
if defined?(ActiveSupport::Inflector)
INFLECTOR = ActiveSupport::Inflector
else
begin
require 'extlib/inflection'
INFLECTOR = Extlib::Inflection
rescue LoadError
require 'active_support/inflector'
INFLECTOR = ActiveSupport::Inflector
end
end
end