diff --git a/lib/base.rb b/lib/base.rb index 5ee2025..11eebe0 100644 --- a/lib/base.rb +++ b/lib/base.rb @@ -1,4 +1,6 @@ -require 'faraday_middleware' +if Gem::Version.new(Faraday::VERSION) < Gem::Version.new('2.0') + require 'faraday_middleware' +end module SendGridWebApi class Base diff --git a/sendgrid_webapi.gemspec b/sendgrid_webapi.gemspec index def8035..577456c 100644 --- a/sendgrid_webapi.gemspec +++ b/sendgrid_webapi.gemspec @@ -20,10 +20,10 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency "faraday", "~> 1.0" - s.add_dependency "faraday_middleware", "~> 1.0" + s.add_dependency "faraday" s.add_dependency "json", "~> 2.0" + s.add_development_dependency "rake" s.add_development_dependency "rspec", "~> 3.4" s.add_development_dependency "webmock", "~> 3.12" s.add_development_dependency "vcr", "~> 6.0" diff --git a/spec/cassettes/client/_modules/_block/should_get_block_emails.yml b/spec/cassettes/client/_modules/_block/should_get_block_emails.yml index 5226359..8a84654 100644 --- a/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +++ b/spec/cassettes/client/_modules/_block/should_get_block_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:37:37 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml b/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml index 8176eed..1fedc81 100644 --- a/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +++ b/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:37:40 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml b/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml index 3075885..48aed48 100644 --- a/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +++ b/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:37:38 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml b/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml index 43430bd..be255dd 100644 --- a/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +++ b/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:39:31 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml b/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml index 17a4b84..bc2134a 100644 --- a/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml +++ b/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:39:31 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml b/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml index 6552f4b..0243cfa 100644 --- a/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +++ b/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 12:25:48 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml b/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml index e7d92fa..f1bb779 100644 --- a/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +++ b/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:39:32 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml b/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml index a987207..5eecdc7 100644 --- a/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +++ b/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:39:56 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml b/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml index 1625a10..5c8162f 100644 --- a/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml +++ b/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:39:56 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml b/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml index eb81484..7a602dc 100644 --- a/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +++ b/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:39:58 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml b/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml index 7e9942c..2373f1b 100644 --- a/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +++ b/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:48:27 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml b/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml index 49c2b76..05063f9 100644 --- a/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +++ b/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:48:28 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml b/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml index 6fa2f7e..65b9cbd 100644 --- a/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +++ b/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:49:15 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml b/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml index c190b34..c4edcd0 100644 --- a/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +++ b/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:49:18 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml b/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml index b53df2a..7eac39d 100644 --- a/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +++ b/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:49:16 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: diff --git a/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml b/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml index e8f30a9..7c8c783 100644 --- a/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +++ b/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml @@ -23,7 +23,7 @@ http_interactions: Date: - Fri, 17 Jan 2014 01:49:19 GMT Content-Type: - - text/html + - application/json Transfer-Encoding: - chunked Connection: