ruby_http_client 3.5.1 → 3.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0319ff91ddd522b5dd70bd67121289331e678d194f600d37c9fcf821d717203
4
- data.tar.gz: cc2d4d5d4f5b913ad2c5130febd6def93d61788f2b905dd7098532c4bde02968
3
+ metadata.gz: f5ddac43b435a931ecdc7996fa4473bb172fe730d5b6bfc8f47f0071d3485208
4
+ data.tar.gz: f2b598204b33f063f35678f9c0d51e71629a8bc059f74836465ea98605b50560
5
5
  SHA512:
6
- metadata.gz: 80c39d7776bb3302b28ac3177f6e67f1e44547246319d3314e1e67f2fcd972aca77e639f96eef0725f317bf8fd1bfa8cd69daf07c7e0db67be78f5dc9b30ba96
7
- data.tar.gz: fd255039aee276fb40bda796c8c13629adf400dbbe5fe3a7d5fcc42fbddcc98ec8c6b75852ffa67db4c9df2c572b7e3e279a36bcc6304424b1f6a2a5574ba710
6
+ metadata.gz: 2030bd99a48a48c624a71b6f646ea239b035f9d9d1b35a581e98cc0d6287088ead7c379bfb57a87aff8b71525264bfe2398927d8802b3131efd47633551c1f5a
7
+ data.tar.gz: 1d0e877d3f459680c006196214ecdd589ba633ba2d586a39635b158655a70fb9288215c6b3f65854a23bcfd992d70a2c3e7b01f5aca157581cf09e167a215169
@@ -3,7 +3,6 @@ env:
3
3
  - CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID
4
4
  language: ruby
5
5
  rvm:
6
- - ruby-head
7
6
  - 2.7
8
7
  - 2.6
9
8
  - 2.5
@@ -20,8 +19,7 @@ after_script:
20
19
  - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
21
20
  deploy:
22
21
  provider: rubygems
23
- api_key:
24
- secure: ubaCqrwnHN4TzLhFyM7/2WPicNya2FSeKbZiG9zqGGTklTNi3T/pP1BUDdVQGNSOsvBl/s20P6M+aKL6KTH9t4JpS4laFgI3iwBWyg4Q4fcchDMOrtMaChR7FvIfvOOFcCQYvvMB/U+Mr9GSnKkVHmcu2JQgZM/kBSst3FymAQeRa8+64IKg2s/DjPejT4aTvyuqJ75xN+pkCbv36KHic1jrKZgpSdWZ7UaOZfBJ7xdReCXYXignKFJs1240O1yfIyikFrgTs75Ch7/OmI792CaFIKIvODg97wYlCnu0FYCOxNfZw2JVwp+oYqXRkI5l2ljXWFvjPxdckGSP7rM4lL9GxSgVqgqBd1orXyab2Ad+POlbx97wEmoYLbIF4BHGoe7nXV7BXquQDWIm2o5vx5RxenTnWMOZNLbRBVUAdRbxrxW8iQhTRs+jjeJu3Cj9alWd7UPB/t2v8/c9MpOCNdH+QyAJW6dvZrKTyy75CofGAYbzezp2DA91IXAELiFQaPhCXXzkOTVHCh9+mBYG7b0t1iXQoN+MMcyQ3q89coZDxI1l77keNPbj8GcQQ35fRxRhmgsID+mQfuYXgkx8aTs5MYwJWy+sxyOrEBMAyehDhdk0JZjJdYhgsh+zIqfpy9meZIxNxNQ7+s1EGoFW4RggKark2t9Y8NML7hX+xIc=
22
+ api_key: $RUBYGEMS_API_KEY
25
23
  gem: ruby_http_client
26
24
  on:
27
25
  tags: true
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ [2021-01-13] Version 3.5.2
7
+ --------------------------
8
+ **Library - Fix**
9
+ - [PR #124](https://github.com/sendgrid/ruby-http-client/pull/124): Mistake on setup http_options for Net::HTTP object when build http. Thanks to [@hoangtuanictvn](https://github.com/hoangtuanictvn)!
10
+
11
+
6
12
  [2020-08-19] Version 3.5.1
7
13
  --------------------------
8
14
  **Library - Chore**
@@ -9,8 +9,6 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
9
9
  - [Creating a Pull Request](#creating-a-pull-request)
10
10
  - [Code Reviews](#code-reviews)
11
11
 
12
- We use [Milestones](https://github.com/sendgrid/ruby-http-client/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions, and additional PRs are welcomed and encouraged.
13
-
14
12
  <a name="feature-request"></a>
15
13
  ## Feature Request
16
14
 
@@ -61,13 +61,13 @@ Before creating a pull request, make sure that you respect the repository's cons
61
61
  * [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
62
62
  * [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
63
63
  * [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
64
- * [Python STMPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
65
- * [PHP STMPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
66
- * [C# STMPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
67
- * [Ruby STMPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
68
- * [Node.js STMPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
69
- * [Java STMPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
70
- * [Go STMPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
64
+ * [Python SMTPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
65
+ * [PHP SMTPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
66
+ * [C# SMTPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
67
+ * [Ruby SMTPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
68
+ * [Node.js SMTPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
69
+ * [Java SMTPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
70
+ * [Go SMTPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
71
71
  * [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
72
72
  * [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
73
73
  * [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (C) 2020, Twilio SendGrid, Inc. <help@twilio.com>
3
+ Copyright (C) 2021, Twilio SendGrid, Inc. <help@twilio.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
@@ -19,13 +19,13 @@ Closes #2
19
19
  A short description of what this PR does.
20
20
 
21
21
  ### Checklist
22
- - [ ] I acknowledge that all my contributions will be made under the project's license
22
+ - [x] I acknowledge that all my contributions will be made under the project's license
23
23
  - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
24
- - [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them
24
+ - [ ] I have read the [Contribution Guidelines](https://github.com/sendgrid/ruby-http-client/blob/main/CONTRIBUTING.md) and my PR follows them
25
25
  - [ ] I have titled the PR appropriately
26
26
  - [ ] I have updated my branch with the main branch
27
27
  - [ ] I have added tests that prove my fix is effective or that my feature works
28
- - [ ] I have added necessary documentation about the functionality in the appropriate .md file
28
+ - [ ] I have added the necessary documentation about the functionality in the appropriate .md file
29
29
  - [ ] I have added inline documentation to the code I modified
30
30
 
31
- If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository.
31
+ If you have questions, please file a [support ticket](https://support.sendgrid.com), or create a GitHub Issue in this repository.
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ![SendGrid Logo](twilio_sendgrid_logo.png)
2
2
 
3
- [![BuildStatus](https://travis-ci.org/sendgrid/ruby-http-client.svg?branch=main)](https://travis-ci.org/sendgrid/ruby-http-client)
3
+ [![BuildStatus](https://travis-ci.com/sendgrid/ruby-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/ruby-http-client)
4
4
  [![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)
5
5
  [![Gem Version](https://badge.fury.io/rb/ruby_http_client.svg)](https://badge.fury.io/rb/ruby_http_client)
6
- [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
6
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
7
  [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
8
8
  [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/ruby-http-client.svg)](https://github.com/sendgrid/ruby-http-client/graphs/contributors)
9
9
 
@@ -20,7 +20,6 @@ All updates to this library are documented in our [CHANGELOG](CHANGELOG.md).
20
20
  - [Installation](#installation)
21
21
  - [Quick Start](#quick-start)
22
22
  - [Usage](#usage)
23
- - [Roadmap](#roadmap)
24
23
  - [How to Contribute](#contribute)
25
24
  - [About](#about)
26
25
  - [License](#license)
@@ -87,11 +86,6 @@ puts response.headers
87
86
 
88
87
  - [Example Code](examples)
89
88
 
90
- <a name="roadmap"></a>
91
- # Roadmap
92
-
93
- If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/ruby-http-client/milestones). We would love to hear your feedback.
94
-
95
89
  <a name="contribute"></a>
96
90
  # How to Contribute
97
91
 
@@ -114,4 +108,4 @@ If you need help installing or using the library, please check the [Twilio SendG
114
108
  If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
115
109
 
116
110
  # License
117
- [The MIT License (MIT)](LICENSE.md)
111
+ [The MIT License (MIT)](LICENSE)
@@ -227,7 +227,9 @@ module SendGrid
227
227
  def build_http(host, port)
228
228
  params = [host, port]
229
229
  params += @proxy_options.values_at(:host, :port, :user, :pass) unless @proxy_options.empty?
230
- add_ssl(Net::HTTP.new(*params))
230
+ http = add_ssl(Net::HTTP.new(*params))
231
+ http = add_http_options(http) unless @http_options.empty?
232
+ http
231
233
  end
232
234
 
233
235
  # Allow for https calls
@@ -245,6 +247,20 @@ module SendGrid
245
247
  http
246
248
  end
247
249
 
250
+ # Add others http options to http object
251
+ #
252
+ # * *Args* :
253
+ # - +http+ -> HTTP::NET object
254
+ # * *Returns* :
255
+ # - HTTP::NET object
256
+ #
257
+ def add_http_options(http)
258
+ @http_options.each do |attribute, value|
259
+ http.send("#{attribute}=", value)
260
+ end
261
+ http
262
+ end
263
+
248
264
  # Add variable values to the url.
249
265
  # (e.g. /your/api/{variable_value}/call)
250
266
  # Another example: if you have a ruby reserved word, such as true,
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'ruby_http_client'
6
- spec.version = '3.5.1'
6
+ spec.version = '3.5.2'
7
7
  spec.authors = ['Elmer Thomas']
8
8
  spec.email = 'help@twilio.com'
9
9
  spec.summary = 'A simple REST client'
@@ -253,6 +253,14 @@ class TestClient < Minitest::Test
253
253
  assert_equal(http.verify_mode, OpenSSL::SSL::VERIFY_PEER)
254
254
  end
255
255
 
256
+ def test_add_http_options
257
+ uri = URI.parse('https://localhost:4010')
258
+ http = Net::HTTP.new(uri.host, uri.port)
259
+ http = @client_with_options.add_http_options(http)
260
+ assert_equal(http.open_timeout, 60)
261
+ assert_equal(http.read_timeout, 60)
262
+ end
263
+
256
264
  def test__
257
265
  url1 = @client._('test')
258
266
  assert_equal(['test'], url1.url_path)
@@ -373,7 +381,7 @@ class TestClient < Minitest::Test
373
381
  end
374
382
 
375
383
  def test_license_exists
376
- assert(File.file?('./LICENSE.md') || File.file?('./LICENSE.txt'))
384
+ assert(File.file?('./LICENSE'))
377
385
  end
378
386
 
379
387
  def test_pull_request_template_exists
@@ -393,7 +401,7 @@ class TestClient < Minitest::Test
393
401
  end
394
402
 
395
403
  def test_license_date_is_updated
396
- license_end_year = IO.read('LICENSE.md').match(/Copyright \(C\) (\d{4}), Twilio SendGrid/)[1].to_i
404
+ license_end_year = IO.read('LICENSE').match(/Copyright \(C\) (\d{4}), Twilio SendGrid/)[1].to_i
397
405
  current_year = Time.new.year
398
406
  assert_equal(current_year, license_end_year)
399
407
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elmer Thomas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-19 00:00:00.000000000 Z
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codecov
@@ -97,7 +97,7 @@ files:
97
97
  - FIRST_TIMERS.md
98
98
  - Gemfile
99
99
  - ISSUE_TEMPLATE.md
100
- - LICENSE.md
100
+ - LICENSE
101
101
  - Makefile
102
102
  - PULL_REQUEST_TEMPLATE.md
103
103
  - README.md