Skip to content

Commit 7761e55

Browse files
Merge branch 'master' into http-options
2 parents 3d8e960 + 22935da commit 7761e55

17 files changed

+298
-43
lines changed

Diff for: .codeclimate.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
plugins:
3+
duplication:
4+
enabled: false
5+
config:
6+
languages:
7+
- ruby
8+
fixme:
9+
enabled: false
10+
phpmd:
11+
enabled: false
12+
radon:
13+
enabled: false
14+
rubocop:
15+
enabled: true
16+
channel: rubocop-0-48

Diff for: .env_sample

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export SENDGRID_API_KEY=''

Diff for: .github/PULL_REQUEST_TEMPLATE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.
3+
4+
5+
Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
6+
e.g.
7+
Fixes #1
8+
Closes #2
9+
-->
10+
# Fixes #
11+
12+
### Checklist
13+
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
14+
- [ ] I have read the [Contribution Guide] and my PR follows them.
15+
- [ ] I updated my branch with the master branch.
16+
- [ ] I have added tests that prove my fix is effective or that my feature works
17+
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
18+
- [ ] I have added in line documentation to the code I modified
19+
20+
### Short description of what this PR does:
21+
-
22+
-
23+
24+
If you have questions, please send an email to [Sendgrid](mailto:[email protected]), or file a Github Issue in this repository.

Diff for: .travis.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1+
env:
2+
global:
3+
- CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID
4+
15
language: ruby
26
rvm:
37
- 2.2
8+
49
before_install:
510
- gem install minitest
11+
- gem install simplecov
12+
613
notifications:
714
hipchat:
815
rooms:
916
secure: S0K355wxCRxwK2cOmbcVOaQitRtIEIq0OEEW7JZp8XtooupGwpmJSm22gqeo7GR6eidqlV8Tp6SUffpLE6SvS0hed3LDbJw7oWoXA7XvRp7gh/AKvLZ0e2uz/a1WPSYy0gNS3TJ72PcyoMS6rPCKR0FyDu8mQ2sW8CpZG07NDCmJPgO+dKfnpeuEmElZoh0AZxE6u1RjvUdSzxnmCVjve621ghtMaKInd0fnNPOM6tm9L0HKSbaLI/buphYhQ/DLpO+dLvt7W2yN+9BwaGqPv7X04Sn0UVAu9+EjSouLLBVNRIsdUfgRGeooStm8/Iw0c1brY4goyYJxGs0TiPkfPeWJcNmQ68YSZLDhUGoMZWCZwGq0Lm/oThJX8K777r3qt0Td4iAXNG+bVN+1KZtZRra6B/qBKBcpTTs1p4WRfIUY9D6udwyWZMcGEOFecsyt/MRlkjdmu+zSvZsadvhvQCL+m+aUmTtlUbswXu46g5NxQrHS9UKzzPkk/3mUrO1r4HLhhuuNtn3LRMbx9WVMdidMiFaAxG99VFC0Gon//FMvpTShNrRRuNSW7EJ0V8gwpx69SticfxC88pfka/MEeY9KoZc3MJdILbpgLK5oPuFMih2F/emJP1muWnk8mjaEHqHPqnSuKRr4oqO1xbh+r2ggKW58akCe08a4TihD4rg=
1017
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>'
18+
- '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
19+
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
20+
<a href="https://github.com/sendgrid/%{repository}/commits/%{commit}">View on GitHub</a>'
1421
format: html
1522
notify: false
23+
24+
before_script:
25+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
26+
- chmod +x ./cc-test-reporter
27+
- ./cc-test-reporter before-build
28+
1629
script:
17-
- rake
30+
- rake
31+
32+
after_script:
33+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
33

44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [3.3.0] - 2017-10-30
7+
## Added
8+
- #11 fix: Allow for multiple values for a parameter
9+
- Thanks to [xiaoboa](https://github.com/xiaoboa) for the pull request!
10+
611
## [3.2.0] - 2017-09-01
712
### Added
813
- #12 Add a helper returns the response body as a hash

Diff for: CODE_OF_CONDUCT.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SendGrid Community Code of Conduct
2+
3+
The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.
4+
5+
### Be Open
6+
Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference.
7+
8+
### Be Considerate
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.
10+
11+
### Be Respectful
12+
Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.
13+
14+
## Additional Guidance
15+
16+
### Disclose Potential Conflicts of Interest
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.
18+
19+
### Interpretation
20+
This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.
21+
22+
### Enforcement
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.
24+
25+
## If you have concerns about someone’s conduct
26+
**Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code.
27+
28+
**Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first.
29+
30+
**Contact the Moderators** - You can reach the SendGrid moderators by emailing [email protected].
31+
32+
## Submission to SendGrid Repositories
33+
Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com).
34+
35+
## Attribution
36+
37+
SendGrid thanks the following, on which it draws for content and inspiration:
38+
39+
* [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
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)

Diff for: CONTRIBUTING.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
22

33
- [CLAs and CCLAs](#cla)
44
- [Roadmap & Milestones](#roadmap)
5-
- [Feature Request](#feature_request)
6-
- [Submit a Bug Report](#submit_a_bug_report)
7-
- [Improvements to the Codebase](#improvements_to_the_codebase)
8-
- [Understanding the Code Base](#understanding_the_codebase)
5+
- [Feature Request](#feature-request)
6+
- [Submit a Bug Report](#submit-a-bug-report)
7+
- [Improvements to the Codebase](#improvements-to-the-codebase)
8+
- [Understanding the Code Base](#understanding-the-codebase)
99
- [Testing](#testing)
10-
- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
11-
- [Creating a Pull Request](#creating_a_pull_request)
10+
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
11+
- [Creating a Pull Request](#creating-a-pull-request)
1212

1313
<a name="roadmap"></a>
1414
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.
@@ -26,7 +26,7 @@ When you create a Pull Request, after a few seconds, a comment will appear with
2626

2727
There are a few ways to contribute, which we'll enumerate below:
2828

29-
<a name="feature_request"></a>
29+
<a name="feature-request"></a>
3030
## Feature Request
3131

3232
If you'd like to make a feature request, please read this section.
@@ -36,7 +36,7 @@ The GitHub issue tracker is the preferred channel for library feature requests,
3636
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
3737
- Please be respectful and considerate of others when commenting on issues
3838

39-
<a name="submit_a_bug_report"></a>
39+
<a name="submit-a-bug-report"></a>
4040
## Submit a Bug Report
4141

4242
Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
@@ -53,7 +53,7 @@ Before you decide to create a new issue, please try the following:
5353

5454
In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/ruby-http-client/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
5555

56-
<a name="improvements_to_the_codebase"></a>
56+
<a name="improvements-to-the-codebase"></a>
5757
## Improvements to the Codebase
5858

5959
We welcome direct contributions to the ruby-http-client code base. Thank you!
@@ -95,7 +95,7 @@ To run the example (after updating the emails):
9595
ruby examples/example.rb
9696
```
9797

98-
<a name="understanding_the_codebase"></a>
98+
<a name="understanding-the-codebase"></a>
9999
## Understanding the Code Base
100100

101101
**/examples**
@@ -125,7 +125,7 @@ To run the tests:
125125
rake
126126
```
127127

128-
<a name="style_guidelines_and_naming_conventions"></a>
128+
<a name="style-guidelines-and-naming-conventions"></a>
129129
## Style Guidelines & Naming Conventions
130130

131131
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.
@@ -138,7 +138,7 @@ Please run your code through:
138138

139139
- [rubocop](https://github.com/bbatsov/rubocop).
140140

141-
## Creating a Pull Request<a name="creating_a_pull_request"></a>
141+
## Creating a Pull Request<a name="creating-a-pull-request"></a>
142142

143143
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
144144
and configure the remotes:
@@ -147,7 +147,7 @@ Please run your code through:
147147
# Clone your fork of the repo into the current directory
148148
git clone https://github.com/sendgrid/ruby-http-client
149149
# Navigate to the newly cloned directory
150-
cd sendgrid-python
150+
cd ruby-http-client
151151
# Assign the original repo to a remote called "upstream"
152152
git remote add upstream https://github.com/sendgrid/ruby-http-client
153153
```

Diff for: LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 SendGrid, Inc.
3+
Copyright (c) 2016-2017 SendGrid, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: PULL_REQUEST_TEMPLATE.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
(Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.)
3+
-->
4+
<!-- Add the issue number that is fixed by this PR (In the form Fixes #123) -->
5+
6+
Fixes #<!--Enter Issue number you have referenced(please refer only one issue at once)-->
7+
8+
#### Checklist
9+
<!-- Please Star this repository and follow this template for your PR to be considered-->
10+
- [ ] I have read the SendGrid Contributor License Agreement (CLA)
11+
- [ ] I have read the [Contribution Guide] and my PR follows them.
12+
- [ ] My branch is up-to-date with the master branch.
13+
- [ ] I have added tests that prove my fix is effective or that my feature works
14+
- [ ] I have added necessary documentation (if appropriate)
15+
<!-- If an existing function does not have a docstring, please add one -->
16+
- [ ] All the functions created/modified in this PR contain relevant docstrings.
17+
18+
#### Short description of what this resolves:
19+
20+
21+
#### Changes proposed in this pull request:
22+
<!--Fill These Bullet Points-->
23+
24+
25+
If you have questions, please send an email [Sendgrid](mailto:[email protected]), or file a Github Issue in this repository.

Diff for: README.md

+42-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
[![Travis Badge](https://travis-ci.org/sendgrid/ruby-http-client.svg?branch=master)](https://travis-ci.org/sendgrid/ruby-http-client)
1+
![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
2+
3+
[![BuildStatus](https://travis-ci.org/sendgrid/ruby-http-client.svg?branch=master)](https://travis-ci.org/sendgrid/ruby-http-client)
4+
[![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)
5+
[![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
6+
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
7+
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
8+
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/ruby-http-client.svg)](https://github.com/sendgrid/ruby-http-client/graphs/contributors)
29

310
**Quickly and easily access any RESTful or RESTful-like API.**
411

@@ -8,18 +15,41 @@ If you are looking for the SendGrid API client library, please see [this repo](h
815

916
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/ruby-http-client/blob/master/CHANGELOG.md).
1017

18+
# Table of Contents
19+
- [Installation](#installation)
20+
- [Quick Start](#quick-start)
21+
- [Usage](#usage)
22+
- [Roadmap](#roadmap)
23+
- [How to Contribute](#contribute)
24+
- [About](#about)
25+
- [License](#license)
26+
27+
<a name="installation"></a>
1128
# Installation
1229

1330
## Prerequisites
1431

1532
- Ruby version 2.2+
1633

34+
## Setup Environment Variables
35+
36+
### Environment Variable
37+
38+
Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
39+
40+
```bash
41+
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
42+
echo "sendgrid.env" >> .gitignore
43+
source ./sendgrid.env
44+
```
45+
1746
## Install Package
1847

1948
```bash
2049
gem install ruby_http_client
2150
```
2251

52+
<a name="quick-start"></a>
2353
# Quick Start
2454

2555
`GET /your/api/{param}/call`
@@ -51,31 +81,34 @@ puts response.body
5181
puts response.headers
5282
```
5383

84+
<a name="usage"></a>
5485
# Usage
5586

5687
- [Example Code](https://github.com/sendgrid/ruby-http-client/tree/master/examples)
5788

58-
## Roadmap
89+
<a name="roadmap"></a>
90+
# Roadmap
5991

6092
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.
6193

62-
## How to Contribute
94+
<a name="contribute"></a>
95+
# How to Contribute
6396

6497
We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md) guide for details.
6598

6699
Quick links:
67100

68-
- [Feature Request](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#feature_request)
69-
- [Bug Reports](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#submit_a_bug_report)
101+
- [Feature Request](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#feature-request)
102+
- [Bug Reports](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#submit-a-bug-report)
70103
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md)
71-
- [Improvements to the Codebase](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
72-
104+
- [Improvements to the Codebase](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#improvements-to-the-codebase)
73105

106+
<a name="about"></a>
74107
# About
75108

76109
ruby-http-client is guided and supported by the SendGrid [Developer Experience Team](mailto:[email protected]).
77110

78111
ruby-http-client is maintained and funded by SendGrid, Inc. The names and logos for ruby-http-client are trademarks of SendGrid, Inc.
79112

80-
![SendGrid Logo]
81-
(https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
113+
# License
114+
[The MIT License (MIT)](LICENSE.txt)

Diff for: Rakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Rake::TestTask.new do |t|
44
t.libs << 'test'
55
end
66

7-
desc "Run tests"
8-
task :default => :test
7+
desc 'Run tests'
8+
task default: :test

Diff for: TROUBLESHOOTING.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com).
2+
3+
If you can't find a solution below, please open an [issue](https://github.com/sendgrid/ruby-http-client/issues).
4+
5+
## Table of Contents
6+
* [Viewing the Request Body](#request-body)
7+
8+
<a name="request-body"></a>
9+
## Viewing the Request Body
10+
11+
When debugging or testing, it may be useful to exampine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
12+
13+
You can do this right before you call: `response = client.version('v3').api_keys.post(request_body: request_body)` like so:
14+
15+
```ruby
16+
puts request_body
17+
```

Diff for: examples/example.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Authorization": "Bearer ' + ENV['SENDGRID_API_KEY'] + '"
77
}
88
')
9-
host = 'https://api.sendgrid.com'
9+
host = 'https://api.sendgrid.com'
1010
client = SendGrid::Client.new(host: host, request_headers: headers)
1111

1212
# You can pass in an http_options hash to set values for NET::HTTP attributes

0 commit comments

Comments
 (0)