ruby_http_client 3.3.0 → 3.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.env_sample +1 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +47 -0
- data/.travis.yml +32 -13
- data/CHANGELOG.md +89 -1
- data/CODE_OF_CONDUCT.md +57 -25
- data/CONTRIBUTING.md +21 -37
- data/FIRST_TIMERS.md +79 -0
- data/Gemfile +3 -0
- data/ISSUE_TEMPLATE.md +30 -0
- data/{LICENSE.txt → LICENSE} +8 -8
- data/Makefile +7 -0
- data/PULL_REQUEST_TEMPLATE.md +31 -0
- data/README.md +32 -23
- data/Rakefile +25 -2
- data/TROUBLESHOOTING.md +1 -1
- data/USAGE.md +108 -0
- data/examples/example.rb +29 -1
- data/lib/ruby_http_client.rb +134 -21
- data/ruby_http_client.gemspec +16 -13
- data/static/img/github-fork.png +0 -0
- data/static/img/github-sign-up.png +0 -0
- data/test/test_helper.rb +7 -0
- data/test/test_ruby_http_client.rb +242 -8
- data/twilio_sendgrid_logo.png +0 -0
- data/use_cases/README.md +3 -0
- metadata +77 -10
- data/.github/ISSUE_TEMPLATE +0 -17
- data/.github/PULL_REQUEST_TEMPLATE +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f5ddac43b435a931ecdc7996fa4473bb172fe730d5b6bfc8f47f0071d3485208
|
4
|
+
data.tar.gz: f2b598204b33f063f35678f9c0d51e71629a8bc059f74836465ea98605b50560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2030bd99a48a48c624a71b6f646ea239b035f9d9d1b35a581e98cc0d6287088ead7c379bfb57a87aff8b71525264bfe2398927d8802b3131efd47633551c1f5a
|
7
|
+
data.tar.gz: 1d0e877d3f459680c006196214ecdd589ba633ba2d586a39635b158655a70fb9288215c6b3f65854a23bcfd992d70a2c3e7b01f5aca157581cf09e167a215169
|
data/.env_sample
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export SENDGRID_API_KEY=''
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- bin/**/*
|
4
|
+
- script/**/*
|
5
|
+
- vendor/**/*
|
6
|
+
- cookbooks/**/*
|
7
|
+
|
8
|
+
ClassLength:
|
9
|
+
Enabled: false
|
10
|
+
CyclomaticComplexity:
|
11
|
+
Enabled: false
|
12
|
+
Documentation:
|
13
|
+
Enabled: false
|
14
|
+
Encoding:
|
15
|
+
Enabled: false
|
16
|
+
Layout/EmptyLinesAroundBlockBody:
|
17
|
+
Enabled: true
|
18
|
+
Layout/ExtraSpacing:
|
19
|
+
Enabled: true
|
20
|
+
AllowForAlignment: false
|
21
|
+
ForceEqualSignAlignment: false
|
22
|
+
Layout/SpaceBeforeFirstArg:
|
23
|
+
Enabled: true
|
24
|
+
LineLength:
|
25
|
+
Enabled: false
|
26
|
+
MethodLength:
|
27
|
+
Enabled: false
|
28
|
+
Metrics/AbcSize:
|
29
|
+
Enabled: false
|
30
|
+
Metrics/BlockLength:
|
31
|
+
Enabled: false
|
32
|
+
Metrics/ModuleLength:
|
33
|
+
Enabled: false
|
34
|
+
Naming/FileName:
|
35
|
+
Enabled: true
|
36
|
+
PerceivedComplexity:
|
37
|
+
Enabled: false
|
38
|
+
Style/ClassAndModuleChildren:
|
39
|
+
Enabled: false
|
40
|
+
Style/RescueModifier:
|
41
|
+
Enabled: true
|
42
|
+
Style/StringLiterals:
|
43
|
+
Enabled: true
|
44
|
+
Style/NumericLiterals:
|
45
|
+
Enabled: false
|
46
|
+
Style/FrozenStringLiteralComment:
|
47
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,17 +1,36 @@
|
|
1
|
+
env:
|
2
|
+
global:
|
3
|
+
- CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID
|
1
4
|
language: ruby
|
2
5
|
rvm:
|
3
|
-
- 2.
|
4
|
-
|
5
|
-
-
|
6
|
+
- 2.7
|
7
|
+
- 2.6
|
8
|
+
- 2.5
|
9
|
+
- 2.4
|
10
|
+
- jruby-9.2
|
11
|
+
before_script:
|
12
|
+
- make install
|
13
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
14
|
+
- chmod +x ./cc-test-reporter
|
15
|
+
- "./cc-test-reporter before-build"
|
16
|
+
script:
|
17
|
+
- make test
|
18
|
+
after_script:
|
19
|
+
- "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
|
20
|
+
deploy:
|
21
|
+
provider: rubygems
|
22
|
+
api_key: $RUBYGEMS_API_KEY
|
23
|
+
gem: ruby_http_client
|
24
|
+
on:
|
25
|
+
tags: true
|
26
|
+
rvm: '2.4'
|
27
|
+
skip_cleanup: true
|
28
|
+
|
6
29
|
notifications:
|
7
|
-
|
30
|
+
slack:
|
31
|
+
if: branch = main
|
32
|
+
on_pull_requests: false
|
33
|
+
on_success: never
|
34
|
+
on_failure: change
|
8
35
|
rooms:
|
9
|
-
secure:
|
10
|
-
template:
|
11
|
-
- '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
|
12
|
-
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
|
13
|
-
<a href="https://github.com/sendgrid/%{repository}/commits/%{commit}">View on GitHub</a>'
|
14
|
-
format: html
|
15
|
-
notify: false
|
16
|
-
script:
|
17
|
-
- rake
|
36
|
+
- secure: k9NxCTK/mvoRHWJ6QQ5ErM/+T7yy6KcUjNtb5WgsiA+OyjRgQb5qcm83pYXstDRP6JyEGmuLs4GLIQYSTte1yBvXzM2EqneltNZL2sc+r24zWFcVu6KZb/eq1+diJes+76W4tXT0w+uyyZc9sudFND32RUvcKr31jNvlHDpaII9sose9qC23YKf2u4PlxH8l7wRd3k58XeL9TaQ40xt+NiIrv1R+4QT1GnuYr9cqXrCbTNsZidrdnLmqHybsoJsHjqq7PRDi92CZBQitwzGDnyiOr40CBsqs0VoiUttsKxrG6WCglEDd2wlhYha8ti7z6GxshQHRk2bOePi2Z2YHLJXJcrkLxukCUcf/5GPu+M0vdVj+wWfrlIRa5yPW9dpEgain6Av8c/zc9GOMvTNKNlnxreh3710pQh6b9+C0PfKmsIR3kTqwrDFZxu63IHy8S/CfyFQqHAo2X1TMnJLvvWzXnxAu/qB729YGwuJX57qjk56pvun+pZXGiRsk2okjPcz1zlcoyQOd/a8WqUNN5FEIvHd+cNeDFnYm0QwqBoMTurNc+LyvlB61BNcdq+J2GdtGjAksIc55adFkeOnVGMioW349lGt0LkuhI5um7O3J8b3Y7WPOt1tcR9o44G6t2aZOnnVNZVV04/A3XjlZSJAmG26K6HoBBl3o9uL8aWk=
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,95 @@ 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
|
-
|
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
|
+
|
12
|
+
[2020-08-19] Version 3.5.1
|
13
|
+
--------------------------
|
14
|
+
**Library - Chore**
|
15
|
+
- [PR #120](https://github.com/sendgrid/ruby-http-client/pull/120): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
16
|
+
|
17
|
+
|
18
|
+
[2020-03-04] Version 3.5.0
|
19
|
+
--------------------------
|
20
|
+
**Library - Fix**
|
21
|
+
- [PR #118](https://github.com/sendgrid/ruby-http-client/pull/118): JSON-encode array request bodies. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
22
|
+
- [PR #67](https://github.com/sendgrid/ruby-http-client/pull/67): Split up the build_request function to logical component functions to reduce method complexity. Thanks to [@sony-mathew](https://github.com/sony-mathew)!
|
23
|
+
- [PR #115](https://github.com/sendgrid/ruby-http-client/pull/115): update incorrect gem name. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
24
|
+
|
25
|
+
**Library - Chore**
|
26
|
+
- [PR #116](https://github.com/sendgrid/ruby-http-client/pull/116): add Ruby 2.7 to Travis. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
27
|
+
- [PR #92](https://github.com/sendgrid/ruby-http-client/pull/92): Add CodeCov support to .travis.yml. Thanks to [@jamietanna](https://github.com/jamietanna)!
|
28
|
+
|
29
|
+
**Library - Feature**
|
30
|
+
- [PR #68](https://github.com/sendgrid/ruby-http-client/pull/68): add ratelimit support. Thanks to [@awj](https://github.com/awj)!
|
31
|
+
|
32
|
+
**Library - Test**
|
33
|
+
- [PR #98](https://github.com/sendgrid/ruby-http-client/pull/98): Fix rubocop.yml formatting warnings. Thanks to [@RolandBurrows](https://github.com/RolandBurrows)!
|
34
|
+
|
35
|
+
**Library - Docs**
|
36
|
+
- [PR #100](https://github.com/sendgrid/ruby-http-client/pull/100): adding code review section under contributing.md. Thanks to [@prathamsharma92](https://github.com/prathamsharma92)!
|
37
|
+
- [PR #101](https://github.com/sendgrid/ruby-http-client/pull/101): Grammerly checks on *.md files. Thanks to [@prathamsharma92](https://github.com/prathamsharma92)!
|
38
|
+
- [PR #84](https://github.com/sendgrid/ruby-http-client/pull/84): Corrected *.md files using Grammarly. Thanks to [@pushkyn](https://github.com/pushkyn)!
|
39
|
+
|
40
|
+
|
41
|
+
[2020-02-19] Version 3.4.3
|
42
|
+
--------------------------
|
43
|
+
**Library - Fix**
|
44
|
+
- [PR #95](https://github.com/sendgrid/ruby-http-client/pull/95): JSON body reencoding and Rubocop configuration. Thanks to [@guillemm](https://github.com/guillemm)!
|
45
|
+
|
46
|
+
|
47
|
+
[2020-01-22] Version 3.4.2
|
48
|
+
--------------------------
|
49
|
+
**Library - Fix**
|
50
|
+
- [PR #114](https://github.com/sendgrid/ruby-http-client/pull/114): add skip_cleanup flag to fix travis deploy. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
51
|
+
|
52
|
+
|
53
|
+
[2020-01-22] Version 3.4.1
|
54
|
+
--------------------------
|
55
|
+
**Library - Docs**
|
56
|
+
- [PR #113](https://github.com/sendgrid/ruby-http-client/pull/113): baseline all the templated markdown docs. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
57
|
+
|
58
|
+
|
59
|
+
[2020-01-09] Version 3.4.0
|
60
|
+
--------------------------
|
61
|
+
**Library - Fix**
|
62
|
+
- [PR #108](https://github.com/sendgrid/ruby-http-client/pull/108): Avoid mutating @url_path to avoid unexpected side effects. Thanks to [@tachyons](https://github.com/tachyons)!
|
63
|
+
- [PR #49](https://github.com/sendgrid/ruby-http-client/pull/49): change year for the license file. Thanks to [@luiscobits](https://github.com/luiscobits)!
|
64
|
+
- [PR #48](https://github.com/sendgrid/ruby-http-client/pull/48): update LICENSE - fix year. Thanks to [@pushkyn](https://github.com/pushkyn)!
|
65
|
+
|
66
|
+
**Library - Docs**
|
67
|
+
- [PR #105](https://github.com/sendgrid/ruby-http-client/pull/105): Add our Developer Experience Engineer career opportunity to the READM…. Thanks to [@mptap](https://github.com/mptap)!
|
68
|
+
- [PR #61](https://github.com/sendgrid/ruby-http-client/pull/61): update CONTRIBUTING.md. Thanks to [@thepriefy](https://github.com/thepriefy)!
|
69
|
+
- [PR #86](https://github.com/sendgrid/ruby-http-client/pull/86): Add first time contributor documentation. Thanks to [@eyewritecode](https://github.com/eyewritecode)!
|
70
|
+
- [PR #91](https://github.com/sendgrid/ruby-http-client/pull/91): update contribution to branch off development. Thanks to [@vikasnautiyal](https://github.com/vikasnautiyal)!
|
71
|
+
- [PR #72](https://github.com/sendgrid/ruby-http-client/pull/72): Add USAGE.md. Thanks to [@ProZsolt](https://github.com/ProZsolt)!
|
72
|
+
- [PR #73](https://github.com/sendgrid/ruby-http-client/pull/73): Create a Use Cases Directory. Thanks to [@ProZsolt](https://github.com/ProZsolt)!
|
73
|
+
- [PR #41](https://github.com/sendgrid/ruby-http-client/pull/41): Create PULL_REQUEST_TEMPLATE.md. Thanks to [@flaredragon](https://github.com/flaredragon)!
|
74
|
+
|
75
|
+
**Library - Chore**
|
76
|
+
- [PR #80](https://github.com/sendgrid/ruby-http-client/pull/80): Missing Dev Dependencies + rubocop #79. Thanks to [@kplimack](https://github.com/kplimack)!
|
77
|
+
- [PR #66](https://github.com/sendgrid/ruby-http-client/pull/66): delete PULL_REQUEST_TEMPLATE.md. Thanks to [@thepriefy](https://github.com/thepriefy)!
|
78
|
+
- [PR #76](https://github.com/sendgrid/ruby-http-client/pull/76): Add Gemfile. Thanks to [@kplimack](https://github.com/kplimack)!
|
79
|
+
- [PR #58](https://github.com/sendgrid/ruby-http-client/pull/58): [Closes #55] Add code coverage reporting to CC. Thanks to [@lauratpa](https://github.com/lauratpa)!
|
80
|
+
- [PR #57](https://github.com/sendgrid/ruby-http-client/pull/57): [Closes #56] Fix some rubocop issues. Thanks to [@lauratpa](https://github.com/lauratpa)!
|
81
|
+
- [PR #50](https://github.com/sendgrid/ruby-http-client/pull/50): Added unittest to check for specific repo files. Thanks to [@mptap](https://github.com/mptap)!
|
82
|
+
- [PR #51](https://github.com/sendgrid/ruby-http-client/pull/51): Add License end year test. Thanks to [@diegous](https://github.com/diegous)!
|
83
|
+
- [PR #39](https://github.com/sendgrid/ruby-http-client/pull/39): Add a .env_sample file. Thanks to [@thepriefy](https://github.com/thepriefy)!
|
84
|
+
- [PR #112](https://github.com/sendgrid/ruby-http-client/pull/112): Auto-deploy upon successful tagged commit. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
85
|
+
- [PR #111](https://github.com/sendgrid/ruby-http-client/pull/111): Update CHANGELOG heading format for automation. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
86
|
+
- [PR #110](https://github.com/sendgrid/ruby-http-client/pull/110): Add Makefile for Librarian automation. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
87
|
+
|
88
|
+
**Library - Feature**
|
89
|
+
- [PR #75](https://github.com/sendgrid/ruby-http-client/pull/75): Add ability to set proxy. Thanks to [@eitoball](https://github.com/eitoball)!
|
90
|
+
- [PR #20](https://github.com/sendgrid/ruby-http-client/pull/20): Add option to set http attributes when creating an instance of Client. Thanks to [@jrectenwald](https://github.com/jrectenwald)!
|
91
|
+
|
92
|
+
|
93
|
+
[2017-10-30] Version 3.3.0
|
94
|
+
--------------------------
|
7
95
|
## Added
|
8
96
|
- #11 fix: Allow for multiple values for a parameter
|
9
97
|
- Thanks to [xiaoboa](https://github.com/xiaoboa) for the pull request!
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,41 +1,73 @@
|
|
1
|
-
#
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
3
|
+
## Our Pledge
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
7
11
|
|
8
|
-
|
9
|
-
Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
|
12
|
+
## Our Standards
|
10
13
|
|
11
|
-
|
12
|
-
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
13
16
|
|
14
|
-
|
17
|
+
- Using welcoming and inclusive language
|
18
|
+
- Being respectful of differing viewpoints and experiences
|
19
|
+
- Gracefully accepting constructive criticism
|
20
|
+
- Focusing on what is best for the community
|
21
|
+
- Showing empathy towards other community members
|
15
22
|
|
16
|
-
|
17
|
-
Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another.
|
23
|
+
Examples of unacceptable behavior by participants include:
|
18
24
|
|
19
|
-
|
20
|
-
|
25
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
- Public or private harassment
|
29
|
+
- Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
21
33
|
|
22
|
-
|
23
|
-
Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors.
|
34
|
+
## Our Responsibilities
|
24
35
|
|
25
|
-
|
26
|
-
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
27
39
|
|
28
|
-
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
29
45
|
|
30
|
-
|
46
|
+
## Scope
|
31
47
|
|
32
|
-
|
33
|
-
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at open-source@twilio.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
34
67
|
|
35
68
|
## Attribution
|
36
69
|
|
37
|
-
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
38
72
|
|
39
|
-
|
40
|
-
* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
|
41
|
-
* [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
data/CONTRIBUTING.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome.
|
1
|
+
Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
|
2
2
|
|
3
|
-
- [CLAs and CCLAs](#cla)
|
4
|
-
- [Roadmap & Milestones](#roadmap)
|
5
3
|
- [Feature Request](#feature-request)
|
6
4
|
- [Submit a Bug Report](#submit-a-bug-report)
|
7
5
|
- [Improvements to the Codebase](#improvements-to-the-codebase)
|
@@ -9,22 +7,7 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
|
|
9
7
|
- [Testing](#testing)
|
10
8
|
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
|
11
9
|
- [Creating a Pull Request](#creating-a-pull-request)
|
12
|
-
|
13
|
-
<a name="roadmap"></a>
|
14
|
-
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.
|
15
|
-
|
16
|
-
<a name="cla"></a>
|
17
|
-
## CLAs and CCLAs
|
18
|
-
|
19
|
-
Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) be filled out by every contributor to a SendGrid open source project.
|
20
|
-
|
21
|
-
Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution.
|
22
|
-
|
23
|
-
SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA. Copies of the CLA are available [here](https://gist.github.com/SendGridDX/98b42c0a5d500058357b80278fde3be8#file-sendgrid_cla).
|
24
|
-
|
25
|
-
When you create a Pull Request, after a few seconds, a comment will appear with a link to the CLA. Click the link and fill out the brief form and then click the "I agree" button and you are all set. You will not be asked to re-sign the CLA unless we make a change.
|
26
|
-
|
27
|
-
There are a few ways to contribute, which we'll enumerate below:
|
10
|
+
- [Code Reviews](#code-reviews)
|
28
11
|
|
29
12
|
<a name="feature-request"></a>
|
30
13
|
## Feature Request
|
@@ -46,12 +29,12 @@ A software bug is a demonstrable issue in the code base. In order for us to diag
|
|
46
29
|
Before you decide to create a new issue, please try the following:
|
47
30
|
|
48
31
|
1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post.
|
49
|
-
2. Update to the latest version of this code and check if issue has already been fixed
|
32
|
+
2. Update to the latest version of this code and check if the issue has already been fixed
|
50
33
|
3. Copy and fill in the Bug Report Template we have provided below
|
51
34
|
|
52
35
|
### Please use our Bug Report Template
|
53
36
|
|
54
|
-
In order to make the process easier, we've included a [sample bug report template](
|
37
|
+
In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md).
|
55
38
|
|
56
39
|
<a name="improvements-to-the-codebase"></a>
|
57
40
|
## Improvements to the Codebase
|
@@ -73,11 +56,7 @@ git clone https://github.com/sendgrid/ruby-http-client.git
|
|
73
56
|
cd ruby-http-client
|
74
57
|
```
|
75
58
|
|
76
|
-
|
77
|
-
|
78
|
-
See the [examples folder](https://github.com/sendgrid/ruby-http-client/tree/master/examples) to get started quickly.
|
79
|
-
|
80
|
-
To try the SendGrid example:
|
59
|
+
### Environment Variables
|
81
60
|
|
82
61
|
First, get your free SendGrid account [here](https://sendgrid.com/free?source=ruby-http-client).
|
83
62
|
|
@@ -89,6 +68,10 @@ echo "sendgrid.env" >> .gitignore
|
|
89
68
|
source ./sendgrid.env
|
90
69
|
```
|
91
70
|
|
71
|
+
##### Execute: #####
|
72
|
+
|
73
|
+
See the [examples folder](examples) to get started quickly.
|
74
|
+
|
92
75
|
To run the example (after updating the emails):
|
93
76
|
|
94
77
|
```bash
|
@@ -104,20 +87,20 @@ Working examples that demonstrate usage.
|
|
104
87
|
|
105
88
|
**ruby_http_client.rb**
|
106
89
|
|
107
|
-
An HTTP client with a fluent interface using method chaining and reflection. By returning self on [method_missing](
|
90
|
+
An HTTP client with a fluent interface using method chaining and reflection. By returning self on [method_missing](lib/ruby_http_client.rb#L209) and [_()](lib/ruby_http_client.rb#L194), we can dynamically build the URL using method chaining and [method_missing](lib/ruby_http_client.rb#L209) allows us to dynamically receive the method calls to achieve reflection.
|
108
91
|
|
109
92
|
This allows for the following mapping from a URL to a method chain:
|
110
93
|
|
111
|
-
`/api_client/{api_key_id}/version` maps to `client.api_client._(api_key_id).version.<method>()` where <method> is a [HTTP verb](
|
94
|
+
`/api_client/{api_key_id}/version` maps to `client.api_client._(api_key_id).version.<method>()` where <method> is a [HTTP verb](lib/ruby_http_client.rb#L38).
|
112
95
|
|
113
96
|
<a name="testing"></a>
|
114
97
|
## Testing
|
115
98
|
|
116
99
|
All PRs require passing tests before the PR will be reviewed.
|
117
100
|
|
118
|
-
All test files are in the [`test`](
|
101
|
+
All test files are in the [`test`](test) directory.
|
119
102
|
|
120
|
-
For the purposes of contributing to this repo, please update the [`test_ruby_http_client.rb`](
|
103
|
+
For the purposes of contributing to this repo, please update the [`test_ruby_http_client.rb`](test/test_ruby_http_client.rb) file with unit tests as you modify the code.
|
121
104
|
|
122
105
|
To run the tests:
|
123
106
|
|
@@ -130,8 +113,6 @@ rake
|
|
130
113
|
|
131
114
|
Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
|
132
115
|
|
133
|
-
Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
|
134
|
-
|
135
116
|
- [Community Driven Style Guide](https://github.com/bbatsov/ruby-style-guide)
|
136
117
|
|
137
118
|
Please run your code through:
|
@@ -159,7 +140,7 @@ Please run your code through:
|
|
159
140
|
git pull upstream <dev-branch>
|
160
141
|
```
|
161
142
|
|
162
|
-
3. Create a new topic branch
|
143
|
+
3. Create a new topic branch off the `development` branch to
|
163
144
|
contain your feature, change, or fix:
|
164
145
|
|
165
146
|
```bash
|
@@ -168,7 +149,7 @@ Please run your code through:
|
|
168
149
|
|
169
150
|
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
170
151
|
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
171
|
-
or your code is unlikely be merged into the main project. Use Git's
|
152
|
+
or your code is unlikely to be merged into the main project. Use Git's
|
172
153
|
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
173
154
|
feature to tidy up your commits before making them public.
|
174
155
|
|
@@ -179,7 +160,7 @@ Please run your code through:
|
|
179
160
|
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
180
161
|
|
181
162
|
```bash
|
182
|
-
git pull [--rebase] upstream
|
163
|
+
git pull [--rebase] upstream development
|
183
164
|
```
|
184
165
|
|
185
166
|
6. Push your topic branch up to your fork:
|
@@ -189,6 +170,9 @@ Please run your code through:
|
|
189
170
|
```
|
190
171
|
|
191
172
|
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
192
|
-
with a clear title and description against the `
|
173
|
+
with a clear title and description against the `development` branch. All tests must be passing before we will review the PR.
|
174
|
+
|
175
|
+
<a name="code-reviews"></a>
|
176
|
+
## Code Reviews
|
193
177
|
|
194
|
-
If you
|
178
|
+
If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, Github has some great <a href="https://help.github.com/articles/about-pull-request-reviews/">information on how to review a Pull Request.</a>
|