From 11155d3c39e34f1be62beca84eed6cbe2b75e8b4 Mon Sep 17 00:00:00 2001 From: Bob Aman Date: Thu, 30 Aug 2012 12:15:59 +0300 Subject: [PATCH] Backwards compatibility for MultiJson. --- CHANGELOG.md | 4 ++++ google-api-client.gemspec | 6 +++--- lib/compat/multi_json.rb | 17 +++++++++++++++++ lib/google/api_client.rb | 1 + lib/google/api_client/client_secrets.rb | 1 + lib/google/api_client/discovery/schema.rb | 1 + lib/google/api_client/reference.rb | 1 + lib/google/api_client/version.rb | 2 +- spec/google/api_client/discovery_spec.rb | 1 + 9 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 lib/compat/multi_json.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index adc8a6d27..888c7dd61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.6 + +* Backwards compatibility for MultiJson + # 0.4.5 * Updated Launchy dependency diff --git a/google-api-client.gemspec b/google-api-client.gemspec index 459342bec..1c3fb7eba 100644 --- a/google-api-client.gemspec +++ b/google-api-client.gemspec @@ -2,16 +2,16 @@ Gem::Specification.new do |s| s.name = "google-api-client" - s.version = "0.4.5" + s.version = "0.4.6" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Bob Aman"] - s.date = "2012-07-31" + s.date = "2012-08-30" s.description = "The Google API Ruby Client makes it trivial to discover and access supported\nAPIs.\n" s.email = "bobaman@google.com" s.executables = ["google-api"] s.extra_rdoc_files = ["README.md"] - s.files = ["lib/google", "lib/google/api_client", "lib/google/api_client/batch.rb", "lib/google/api_client/client_secrets.rb", "lib/google/api_client/discovery", "lib/google/api_client/discovery/api.rb", "lib/google/api_client/discovery/media.rb", "lib/google/api_client/discovery/method.rb", "lib/google/api_client/discovery/resource.rb", "lib/google/api_client/discovery/schema.rb", "lib/google/api_client/discovery.rb", "lib/google/api_client/environment.rb", "lib/google/api_client/errors.rb", "lib/google/api_client/media.rb", "lib/google/api_client/reference.rb", "lib/google/api_client/result.rb", "lib/google/api_client/service_account.rb", "lib/google/api_client/version.rb", "lib/google/api_client.rb", "lib/google/inflection.rb", "spec/fixtures", "spec/fixtures/files", "spec/fixtures/files/sample.txt", "spec/google", "spec/google/api_client", "spec/google/api_client/batch_spec.rb", "spec/google/api_client/discovery_spec.rb", "spec/google/api_client/media_spec.rb", "spec/google/api_client/result_spec.rb", "spec/google/api_client/service_account_spec.rb", "spec/google/api_client_spec.rb", "spec/spec_helper.rb", "tasks/gem.rake", "tasks/git.rake", "tasks/metrics.rake", "tasks/spec.rake", "tasks/wiki.rake", "tasks/yard.rake", "CHANGELOG.md", "Gemfile", "Gemfile.lock", "LICENSE", "Rakefile", "README.md", "bin/google-api"] + s.files = ["lib/compat", "lib/compat/multi_json.rb", "lib/google", "lib/google/api_client", "lib/google/api_client/batch.rb", "lib/google/api_client/client_secrets.rb", "lib/google/api_client/discovery", "lib/google/api_client/discovery/api.rb", "lib/google/api_client/discovery/media.rb", "lib/google/api_client/discovery/method.rb", "lib/google/api_client/discovery/resource.rb", "lib/google/api_client/discovery/schema.rb", "lib/google/api_client/discovery.rb", "lib/google/api_client/environment.rb", "lib/google/api_client/errors.rb", "lib/google/api_client/media.rb", "lib/google/api_client/reference.rb", "lib/google/api_client/result.rb", "lib/google/api_client/service_account.rb", "lib/google/api_client/version.rb", "lib/google/api_client.rb", "lib/google/inflection.rb", "spec/fixtures", "spec/fixtures/files", "spec/fixtures/files/sample.txt", "spec/google", "spec/google/api_client", "spec/google/api_client/batch_spec.rb", "spec/google/api_client/discovery_spec.rb", "spec/google/api_client/media_spec.rb", "spec/google/api_client/result_spec.rb", "spec/google/api_client/service_account_spec.rb", "spec/google/api_client_spec.rb", "spec/spec_helper.rb", "tasks/gem.rake", "tasks/git.rake", "tasks/metrics.rake", "tasks/spec.rake", "tasks/wiki.rake", "tasks/yard.rake", "CHANGELOG.md", "Gemfile", "Gemfile.lock", "LICENSE", "Rakefile", "README.md", "bin/google-api"] s.homepage = "http://code.google.com/p/google-api-ruby-client/" s.rdoc_options = ["--main", "README.md"] s.require_paths = ["lib"] diff --git a/lib/compat/multi_json.rb b/lib/compat/multi_json.rb new file mode 100644 index 000000000..673245446 --- /dev/null +++ b/lib/compat/multi_json.rb @@ -0,0 +1,17 @@ +gem 'multi_json', '>= 1.0.0' +require 'multi_json' + +unless MultiJson.respond_to?(:load) + module MultiJson + class < 0.8.1' require 'faraday' require 'faraday/utils' require 'multi_json' +require 'compat/multi_json' require 'stringio' require 'google/api_client/version' diff --git a/lib/google/api_client/client_secrets.rb b/lib/google/api_client/client_secrets.rb index 3a4916030..27b71087c 100644 --- a/lib/google/api_client/client_secrets.rb +++ b/lib/google/api_client/client_secrets.rb @@ -14,6 +14,7 @@ require 'multi_json' +require 'compat/multi_json' module Google diff --git a/lib/google/api_client/discovery/schema.rb b/lib/google/api_client/discovery/schema.rb index eebf7dddb..a62e6f4d6 100644 --- a/lib/google/api_client/discovery/schema.rb +++ b/lib/google/api_client/discovery/schema.rb @@ -15,6 +15,7 @@ require 'time' require 'multi_json' +require 'compat/multi_json' require 'base64' require 'autoparse' require 'addressable/uri' diff --git a/lib/google/api_client/reference.rb b/lib/google/api_client/reference.rb index f7d71062e..389dcbac7 100644 --- a/lib/google/api_client/reference.rb +++ b/lib/google/api_client/reference.rb @@ -17,6 +17,7 @@ gem 'faraday', '~> 0.8.1' require 'faraday' require 'faraday/utils' require 'multi_json' +require 'compat/multi_json' require 'addressable/uri' require 'stringio' require 'google/api_client/discovery' diff --git a/lib/google/api_client/version.rb b/lib/google/api_client/version.rb index da7e6b1c1..18c602143 100644 --- a/lib/google/api_client/version.rb +++ b/lib/google/api_client/version.rb @@ -22,7 +22,7 @@ if !defined?(::Google::APIClient::VERSION) module VERSION MAJOR = 0 MINOR = 4 - TINY = 5 + TINY = 6 STRING = [MAJOR, MINOR, TINY].join('.') end diff --git a/spec/google/api_client/discovery_spec.rb b/spec/google/api_client/discovery_spec.rb index e196b0f53..4ddaded32 100644 --- a/spec/google/api_client/discovery_spec.rb +++ b/spec/google/api_client/discovery_spec.rb @@ -21,6 +21,7 @@ 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'