Skip to content

Commit 89df34c

Browse files
Updating to comply to SendGrid's Open Source policies
1 parent b4a582c commit 89df34c

File tree

5 files changed

+86
-141
lines changed

5 files changed

+86
-141
lines changed

.env_sample

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
3+
34
This project adheres to [Semantic Versioning](http://semver.org/).
45

56
## [1.1.0] - 2016-03-17

CONTRIBUTING.md

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
Hello! Thank you for choosing to help contribute to the ruby-http-client. There are many ways you can contribute and help is always welcome.
2-
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+
3+
- [CLAs and CCLAs](#cla)
4+
- [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)
9+
- [Testing](#testing)
10+
- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
11+
- [Creating a Pull Request](#creating_a_pull_request)
12+
13+
<a name="roadmap"></a>
314
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.
415

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)
9-
* [Testing](#testing)
10-
* [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
11-
* [Creating a Pull Request](#creating_a_pull_request)
16+
<a name="cla"></a>
17+
## CLAs and CCLAs
18+
19+
Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) or a SendGrid Company Contributor Licensing Agreement (CCLA) be filled out by every contributor to a SendGrid open source project.
20+
21+
Our goal with the CLA and CCLA 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 and CCLA encourage broad participation by our open source community and help 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 (or CCLA). Copies of the CLA and CCLA are available [here](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view).
24+
25+
You may submit your completed [CLA or CCLA](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view) to SendGrid at [dx@sendgrid.com](mailto:dx@sendgrid.com). SendGrid will then confirm you are ready to begin making contributions.
1226

1327
There are a few ways to contribute, which we'll enumerate below:
1428

@@ -37,58 +51,50 @@ Before you decide to create a new issue, please try the following:
3751

3852
### Please use our Bug Report Template
3953

40-
In order to make the process easier, we've included a sample bug report 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.
41-
42-
```
43-
Short and descriptive example bug report title
44-
45-
#### Issue Summary
46-
47-
A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, code examples.
48-
49-
50-
#### Steps to Reproduce
51-
52-
1. This is the first step
53-
2. This is the second step
54-
3. Further steps, etc.
55-
56-
Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?
57-
58-
#### Technical details:
59-
60-
* ruby-http-client Version: master (latest commit: 2cb34372ef0f31352f7c90015a45e1200cb849da)
61-
* Ruby Version: 2.2
62-
```
54+
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.
6355

6456
<a name="improvements_to_the_codebase"></a>
6557
## Improvements to the Codebase
6658

67-
We welcome direct contributions to the python-http-client code base. Thank you!
59+
We welcome direct contributions to the ruby-http-client code base. Thank you!
6860

6961
### Development Environment ###
7062

71-
#### Install and run locally ####
63+
#### Install and Run Locally ####
7264

7365
##### Prerequisites #####
7466

75-
* Ruby 2.2
76-
* There are no external dependencies
67+
- Ruby 2.2 or higher
7768

7869
##### Initial setup: #####
7970

80-
```
71+
```bash
8172
git clone https://github.com/sendgrid/ruby-http-client.git
8273
cd ruby-http-client
83-
cp .env_sample .env
8474
```
8575

86-
Update your settings in `.env`
87-
8876
##### Execute: #####
8977

9078
See the [examples folder](https://github.com/sendgrid/ruby-http-client/tree/master/examples) to get started quickly.
9179

80+
To try the SendGrid example:
81+
82+
First, get your free SendGrid account [here](https://sendgrid.com/free?source=ruby-http-client).
83+
84+
Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
85+
86+
```bash
87+
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
88+
echo "sendgrid.env" >> .gitignore
89+
source ./sendgrid.env
90+
```
91+
92+
To run the example (after updating the emails):
93+
94+
```bash
95+
ruby examples/example.rb
96+
```
97+
9298
<a name="understanding_the_codebase"></a>
9399
## Understanding the Code Base
94100

@@ -109,30 +115,28 @@ This allows for the following mapping from a URL to a method chain:
109115

110116
All PRs require passing tests before the PR will be reviewed.
111117

112-
All test files are in the `[test](https://github.com/sendgrid/ruby-http-client/tree/master/test)` directory.
118+
All test files are in the [`test`](https://github.com/sendgrid/ruby-http-client/tree/master/test) directory.
113119

114120
For the purposes of contributing to this repo, please update the [`test_ruby_http_client.rb`](https://github.com/sendgrid/ruby-http-client/blob/master/test/test_ruby_http_client.rb) file with unit tests as you modify the code.
115121

116122
To run the tests:
117123

118-
`rake`
119-
120-
All PRs require passing tests before the PR will be reviewed.
124+
```bash
125+
rake
126+
```
121127

122128
<a name="style_guidelines_and_naming_conventions"></a>
123129
## Style Guidelines & Naming Conventions
124130

125131
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.
126132

127-
* [Community Driven Style Guide](https://github.com/bbatsov/ruby-style-guide)
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.
128134

129-
Please run your code through [rubocop](https://github.com/bbatsov/rubocop).
135+
- [Community Driven Style Guide](https://github.com/bbatsov/ruby-style-guide)
130136

131-
### Directory Structure
137+
Please run your code through:
132138

133-
* `examples` for example calls
134-
* `test`, for all tests
135-
* `libs`, for the client library
139+
- [rubocop](https://github.com/bbatsov/rubocop).
136140

137141
## Creating a Pull Request<a name="creating_a_pull_request"></a>
138142

@@ -143,7 +147,7 @@ Please run your code through [rubocop](https://github.com/bbatsov/rubocop).
143147
# Clone your fork of the repo into the current directory
144148
git clone https://github.com/sendgrid/ruby-http-client
145149
# Navigate to the newly cloned directory
146-
cd ruby-http-client
150+
cd sendgrid-python
147151
# Assign the original repo to a remote called "upstream"
148152
git remote add upstream https://github.com/sendgrid/ruby-http-client
149153
```
@@ -187,4 +191,4 @@ Please run your code through [rubocop](https://github.com/bbatsov/rubocop).
187191
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
188192
with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
189193

190-
If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo.
194+
If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo.

LICENSE renamed to LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 SendGrid
3+
Copyright (c) 2016 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

README.md

Lines changed: 28 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@
22

33
**Quickly and easily access any REST or REST-like API.**
44

5-
Here is a quick example:
5+
# Announcements
6+
7+
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/ruby-http-client/blob/master/CHANGELOG.md).
8+
9+
# Installation
10+
11+
```bash
12+
gem install ruby_http_client
13+
```
14+
15+
## Dependencies
16+
17+
- Ruby 2.2 or higher
18+
19+
# Quick Start
620

721
`GET /your/api/{param}/call`
822

@@ -33,101 +47,31 @@ puts response.response_body
3347
puts response.response_headers
3448
```
3549

36-
# Installation
37-
38-
`gem install ruby_http_client`
39-
40-
## Usage ##
41-
42-
Following is an example using SendGrid. You can get your free account [here](https://sendgrid.com/free?source=python-http-client).
43-
44-
First, update your .env with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) and HOST. For this example HOST=https://api.sendgrid.com.
45-
46-
Following is an abridged example, here is the [full working code](https://github.com/sendgrid/ruby-http-client/tree/master/examples).
47-
48-
```ruby
49-
require 'ruby_http_client'
50-
51-
SendGrid::Config.new
52-
headers = JSON.parse('
53-
{
54-
"Authorization": "Bearer ' + ENV['SENDGRID_API_KEY'] + '",
55-
"Content-Type": "application/json"
56-
}
57-
')
58-
host = ENV['LOCAL_HOST']
59-
client = SendGrid::Client.new(host: host, request_headers: headers)
60-
61-
# GET Collection
62-
query_params = { 'limit' => 100, 'offset' => 0 }
63-
response = client.version('v3').api_keys.get(query_params: query_params)
64-
65-
# POST
66-
request_body = JSON.parse('
67-
{
68-
"name": "My API Key Ruby Test",
69-
"scopes": [
70-
"mail.send",
71-
"alerts.create",
72-
"alerts.read"
73-
]
74-
}
75-
')
76-
response = client.version('v3').api_keys.post(request_body: request_body)
77-
api_key_id = JSON.parse(response.response_body)['api_key_id']
78-
79-
# GET Single
80-
response = client.version('v3').api_keys._(api_key_id).get
81-
82-
# PATCH
83-
request_body = JSON.parse('
84-
{
85-
"name": "A New Hope"
86-
}
87-
')
88-
response = client.api_keys._(api_key_id).patch(request_body: request_body)
89-
90-
# PUT
91-
request_body = JSON.parse('
92-
{
93-
"name": "A New Hope",
94-
"scopes": [
95-
"user.profile.read",
96-
"user.profile.update"
97-
]
98-
}
99-
')
100-
response = client.api_keys._(api_key_id).put(request_body: request_body)
101-
102-
# DELETE
103-
response = client.api_keys._(api_key_id).delete
104-
```
105-
106-
# Announcements
50+
# Usage
10751

108-
[2016.03.17] - We hit version 1!
52+
- [Example Code](https://github.com/sendgrid/ruby-http-client/tree/master/examples)
10953

110-
# Roadmap
54+
## Roadmap
11155

112-
[Milestones](https://github.com/sendgrid/ruby-http-client/milestones)
56+
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.
11357

114-
# How to Contribute
58+
## How to Contribute
11559

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

118-
* [Feature Request](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#feature_request)
119-
* [Bug Reports](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#submit_a_bug_report)
120-
* [Improvements to the Codebase](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
62+
Quick links:
12163

122-
# Thanks
64+
- [Feature Request](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#feature_request)
65+
- [Bug Reports](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#submit_a_bug_report)
66+
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md)
67+
- [Improvements to the Codebase](https://github.com/sendgrid/ruby-http-client/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
12368

124-
We were inspired by the work done on [birdy](https://github.com/inueni/birdy) and [universalclient](https://github.com/dgreisen/universalclient).
12569

12670
# About
12771

128-
![SendGrid Logo]
129-
(https://assets3.sendgrid.com/mkt/assets/logos_brands/small/sglogo_2015_blue-9c87423c2ff2ff393ebce1ab3bd018a4.png)
130-
13172
ruby-http-client is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com).
13273

13374
ruby-http-client is maintained and funded by SendGrid, Inc. The names and logos for ruby-http-client are trademarks of SendGrid, Inc.
75+
76+
![SendGrid Logo]
77+
(https://assets3.sendgrid.com/mkt/assets/logos_brands/small/sglogo_2015_blue-9c87423c2ff2ff393ebce1ab3bd018a4.png)

0 commit comments

Comments
 (0)