smtpapi 0.1.7 → 0.1.11

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: f703034c8bca559b9820a2141798ab17659d5d6bebacbbd710a5e11c8c94be82
4
- data.tar.gz: '08d97aaf3b6a07da8a6f0f167e75b6dfaf23a9d7250a0cbed9753d36c1d0b5f8'
3
+ metadata.gz: d65340477a6b441a06848a2fdf69b4b7f7eeb7c639ed4aeb0ccb0a2d10f9095d
4
+ data.tar.gz: 4d04c43f80dba6ecaeefa90229fc8aa3a00523264bcf89f2411afc9784ab7a6c
5
5
  SHA512:
6
- metadata.gz: 320e0446b122b8b0b639e812d6373922c94f2c7475752797878d8252edef29eafb87ef938c33cd9efc03eca34a6561f84f83525014a8f90de8084916297bbb3f
7
- data.tar.gz: 5d068b0ff4304e658ed7090d255a6133a0a113ee09e564384ae3d564547984ec9f534c79997fa4d04778cc8b4f2491f7a18b1905433000386378de63023e6806
6
+ metadata.gz: 3cd0fa7a7dc1eede99eaf29f9f18e81e71948f2d28f1743c88aa89d48a8539a72cd8be166db335b443ea1319b889a2046699091e62d616a79cced382c535580c
7
+ data.tar.gz: f70d130dbc5a13580a343b10454844c8529e93d332994e2bedf14e56de7ce5a0b74ba2d915c221167d6dd290e4f7f4d51821ff5479ba2ed695fcc9e6813054cf
@@ -0,0 +1,10 @@
1
+ contact_links:
2
+ - name: Twilio SendGrid Support
3
+ url: https://support.sendgrid.com
4
+ about: Get Support
5
+ - name: Stack Overflow
6
+ url: https://stackoverflow.com/questions/tagged/smtpapi-ruby+or+sendgrid+ruby
7
+ about: Ask questions on Stack Overflow
8
+ - name: Documentation
9
+ url: https://sendgrid.com/docs/for-developers/
10
+ about: View Reference Documentation
@@ -0,0 +1,99 @@
1
+ name: Test and Deploy
2
+ on:
3
+ push:
4
+ branches: [ '*' ]
5
+ tags: [ '*' ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ schedule:
9
+ # Run automatically at 8AM PST Monday-Friday
10
+ - cron: '0 15 * * 1-5'
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ test:
15
+ name: Test
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 20
18
+ strategy:
19
+ matrix:
20
+ ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', 'jruby-9.2' ]
21
+ steps:
22
+ - name: Checkout smtpapi-ruby
23
+ uses: actions/checkout@v2
24
+ with:
25
+ fetch-depth: 0
26
+
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler-cache: true
32
+
33
+ - run: make install
34
+
35
+ - name: Set up linter
36
+ run: bundle add rubocop --version "~> 1.24.1" --group "development" --skip-install
37
+ if: ${{ matrix.ruby != '2.4' }}
38
+
39
+ - run: bundle install --with development && bundle exec rake install
40
+
41
+ - name: Run linter
42
+ run: bundle exec rubocop
43
+ if: ${{ matrix.ruby != '2.4' }}
44
+
45
+ - name: Run tests
46
+ run: make test
47
+
48
+ deploy:
49
+ name: Deploy
50
+ if: success() && github.ref_type == 'tag'
51
+ needs: [ test ]
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - name: Checkout smtpapi-ruby
55
+ uses: actions/checkout@v2
56
+ with:
57
+ fetch-depth: 0
58
+
59
+ - name: Set up Ruby
60
+ uses: ruby/setup-ruby@v1
61
+ with:
62
+ ruby-version: 3.1
63
+ bundler-cache: true
64
+
65
+ - run: make install
66
+
67
+ - name: Create GitHub Release
68
+ uses: sendgrid/dx-automator/actions/release@main
69
+ env:
70
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71
+
72
+ - name: Publish to Rubygems
73
+ env:
74
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
75
+ run: |
76
+ mkdir -p $HOME/.gem
77
+ touch $HOME/.gem/credentials
78
+ chmod 0600 $HOME/.gem/credentials
79
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
80
+ gem build *.gemspec
81
+ gem push *.gem
82
+
83
+ notify-on-failure:
84
+ name: Slack notify on failure
85
+ if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
86
+ needs: [ test, deploy ]
87
+ runs-on: ubuntu-latest
88
+ steps:
89
+ - uses: rtCamp/action-slack-notify@v2
90
+ env:
91
+ SLACK_COLOR: failure
92
+ SLACK_ICON_EMOJI: ':github:'
93
+ SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
94
+ SLACK_TITLE: Action Failure - ${{ github.repository }}
95
+ SLACK_USERNAME: GitHub Actions
96
+ SLACK_MSG_AUTHOR: twilio-dx
97
+ SLACK_FOOTER: Posted automatically using GitHub Actions
98
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
99
+ MSG_MINIMAL: true
data/.rubocop.yml CHANGED
@@ -1,3 +1,5 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  # Allow "set_" and "get_" for prefix of method
2
4
  AccessorMethodName:
3
5
  Enabled: false
@@ -16,17 +18,16 @@ ParameterLists:
16
18
  AbcSize:
17
19
  Max: 34
18
20
 
19
- # Increase max number of "/" in %r
20
- RegexpLiteral:
21
- MaxSlashes: 0
22
-
23
21
  # Increase the max line number of class
24
22
  ClassLength:
25
23
  Max: 250
26
24
  CountComments: true
27
25
 
28
26
  CyclomaticComplexity:
29
- Max: 11
27
+ Max: 12
30
28
 
31
29
  PerceivedComplexity:
32
- Max: 11
30
+ Max: 12
31
+
32
+ Metrics/LineLength:
33
+ Max: 100
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,94 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-01-25 23:22:53 UTC using RuboCop version 1.22.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/OrderedDependencies:
14
+ Exclude:
15
+ - 'smtpapi.gemspec'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: Include.
19
+ # Include: **/*.gemspec
20
+ Gemspec/RequiredRubyVersion:
21
+ Exclude:
22
+ - 'smtpapi.gemspec'
23
+
24
+ # Offense count: 1
25
+ # Cop supports --auto-correct.
26
+ # Configuration parameters: EnforcedStyle.
27
+ # SupportedStyles: final_newline, final_blank_line
28
+ Layout/TrailingEmptyLines:
29
+ Exclude:
30
+ - 'Gemfile'
31
+
32
+ # Offense count: 1
33
+ # Configuration parameters: IgnoredMethods.
34
+ Metrics/CyclomaticComplexity:
35
+ Max: 12
36
+
37
+ # Offense count: 1
38
+ # Configuration parameters: IgnoredMethods.
39
+ Metrics/PerceivedComplexity:
40
+ Max: 12
41
+
42
+ # Offense count: 2
43
+ # Cop supports --auto-correct.
44
+ # Configuration parameters: EnforcedStyle.
45
+ # SupportedStyles: separated, grouped
46
+ Style/AccessorGrouping:
47
+ Exclude:
48
+ - 'lib/smtpapi.rb'
49
+
50
+ # Offense count: 1
51
+ # Cop supports --auto-correct.
52
+ # Configuration parameters: EnforcedStyle.
53
+ # SupportedStyles: prefer_alias, prefer_alias_method
54
+ Style/Alias:
55
+ Exclude:
56
+ - 'lib/smtpapi.rb'
57
+
58
+ # Offense count: 8
59
+ # Cop supports --auto-correct.
60
+ # Configuration parameters: EnforcedStyle.
61
+ # SupportedStyles: always, always_true, never
62
+ Style/FrozenStringLiteralComment:
63
+ Exclude:
64
+ - 'Gemfile'
65
+ - 'Rakefile'
66
+ - 'examples/example.rb'
67
+ - 'lib/smtpapi.rb'
68
+ - 'lib/smtpapi/version.rb'
69
+ - 'smtpapi.gemspec'
70
+ - 'test/test.rb'
71
+ - 'test/test_helper.rb'
72
+
73
+ # Offense count: 1
74
+ # Cop supports --auto-correct.
75
+ # Configuration parameters: UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
76
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
77
+ Style/HashSyntax:
78
+ EnforcedStyle: hash_rockets
79
+
80
+ # Offense count: 3
81
+ # Cop supports --auto-correct.
82
+ # Configuration parameters: PreferredDelimiters.
83
+ Style/PercentLiteralDelimiters:
84
+ Exclude:
85
+ - 'examples/example.rb'
86
+ - 'test/test.rb'
87
+
88
+ # Offense count: 2
89
+ # Cop supports --auto-correct.
90
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
91
+ # SupportedStyles: single_quotes, double_quotes
92
+ Style/StringLiterals:
93
+ Exclude:
94
+ - 'Gemfile'
data/CHANGELOG.md CHANGED
@@ -3,6 +3,35 @@ 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
+ [2022-02-09] Version 0.1.11
7
+ ---------------------------
8
+ **Library - Chore**
9
+ - [PR #101](https://github.com/sendgrid/smtpapi-ruby/pull/101): upgrade supported language versions. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
10
+ - [PR #100](https://github.com/sendgrid/smtpapi-ruby/pull/100): add gh release to workflow. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
11
+ - [PR #99](https://github.com/sendgrid/smtpapi-ruby/pull/99): migrate to gh actions. Thanks to [@beebzz](https://github.com/beebzz)!
12
+
13
+
14
+ [2022-01-12] Version 0.1.10
15
+ ---------------------------
16
+ **Library - Chore**
17
+ - [PR #98](https://github.com/sendgrid/smtpapi-ruby/pull/98): update license year. Thanks to [@JenniferMah](https://github.com/JenniferMah)!
18
+
19
+
20
+ [2020-09-02] Version 0.1.9
21
+ --------------------------
22
+ **Library - Chore**
23
+ - [PR #71](https://github.com/sendgrid/smtpapi-ruby/pull/71): Conformance To Style Standards With RuboCop & TravisCI. Thanks to [@alanunruh](https://github.com/alanunruh)!
24
+
25
+
26
+ [2020-08-19] Version 0.1.8
27
+ --------------------------
28
+ **Library - Docs**
29
+ - [PR #72](https://github.com/sendgrid/smtpapi-ruby/pull/72): Update *.md files using Grammarly. Thanks to [@anatolyyyyyy](https://github.com/anatolyyyyyy)!
30
+
31
+ **Library - Chore**
32
+ - [PR #96](https://github.com/sendgrid/smtpapi-ruby/pull/96): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
33
+
34
+
6
35
  [2020-08-05] Version 0.1.7
7
36
  --------------------------
8
37
  **Library - Chore**
data/CONTRIBUTING.md CHANGED
@@ -1,4 +1,4 @@
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.
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
3
  - [Feature Request](#feature-request)
4
4
  - [Submit a Bug Report](#submit-a-bug-report)
@@ -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/smtpapi-ruby/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,7 +59,7 @@ cd smtpapi-ruby
61
59
 
62
60
  ##### Execute: #####
63
61
 
64
- See the [examples folder](https://github.com/sendgrid/smtpapi-ruby/tree/master/examples) to get started quickly.
62
+ See the [examples folder](examples) to get started quickly.
65
63
 
66
64
  To run the example:
67
65
 
@@ -89,9 +87,9 @@ Source code.
89
87
 
90
88
  All PRs require passing tests before the PR will be reviewed.
91
89
 
92
- All test files are in the [`test`](https://github.com/sendgrid/smtpapi-ruby/tree/master/test) directory.
90
+ All test files are in the [`test`](test) directory.
93
91
 
94
- For the purposes of contributing to this repo, please update the [`test.rb`](https://github.com/sendgrid/smtpapi-ruby/blob/master/test/test.rb) file with unit tests as you modify the code.
92
+ For the purposes of contributing to this repo, please update the [`test.rb`](test/test.rb) file with unit tests as you modify the code.
95
93
 
96
94
  To run the tests:
97
95
 
@@ -140,7 +138,7 @@ Please run your code through:
140
138
 
141
139
  4. Commit your changes in logical chunks. Please adhere to these [git commit
142
140
  message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
143
- or your code is unlikely be merged into the main project. Use Git's
141
+ or your code is unlikely to be merged into the main project. Use Git's
144
142
  [interactive rebase](https://help.github.com/articles/interactive-rebase)
145
143
  feature to tidy up your commits before making them public.
146
144
 
@@ -151,7 +149,7 @@ Please run your code through:
151
149
  5. Locally merge (or rebase) the upstream development branch into your topic branch:
152
150
 
153
151
  ```bash
154
- git pull [--rebase] upstream master
152
+ git pull [--rebase] upstream main
155
153
  ```
156
154
 
157
155
  6. Push your topic branch up to your fork:
@@ -161,7 +159,7 @@ Please run your code through:
161
159
  ```
162
160
 
163
161
  7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
164
- with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
162
+ with a clear title and description against the `main` branch. All tests must be passing before we will review the PR.
165
163
 
166
164
  <a name="code-reviews"></a>
167
165
  ## Code Reviews
data/FIRST_TIMERS.md ADDED
@@ -0,0 +1,79 @@
1
+ # How To Contribute to Twilio SendGrid Repositories via GitHub
2
+ Contributing to the Twilio SendGrid repositories is easy! All you need to do is find an open issue (see the bottom of this page for a list of repositories containing open issues), fix it and submit a pull request. Once you have submitted your pull request, the team can easily review it before it is merged into the repository.
3
+
4
+ To make a pull request, follow these steps:
5
+
6
+ 1. Log into GitHub. If you do not already have a GitHub account, you will have to create one in order to submit a change. Click the Sign up link in the upper right-hand corner to create an account. Enter your username, password, and email address. If you are an employee of Twilio SendGrid, please use your full name with your GitHub account and enter Twilio SendGrid as your company so we can easily identify you.
7
+
8
+ <img src="/static/img/github-sign-up.png" width="800">
9
+
10
+ 2. __[Fork](https://help.github.com/fork-a-repo/)__ the [smtpapi-php](https://github.com/sendgrid/smtpapi-php) repository:
11
+
12
+ <img src="/static/img/github-fork.png" width="800">
13
+
14
+ 3. __Clone__ your fork via the following commands:
15
+
16
+ ```bash
17
+ # Clone your fork of the repo into the current directory
18
+ git clone https://github.com/your_username/smtpapi-php
19
+ # Navigate to the newly cloned directory
20
+ cd smtpapi-php
21
+ # Assign the original repo to a remote called "upstream"
22
+ git remote add upstream https://github.com/sendgrid/smtpapi-php
23
+ ```
24
+
25
+ > Don't forget to replace *your_username* in the URL by your real GitHub username.
26
+
27
+ 4. __Create a new topic branch__ (off the main project development branch) to contain your feature, change, or fix:
28
+
29
+ ```bash
30
+ git checkout -b <topic-branch-name>
31
+ ```
32
+
33
+ 5. __Commit your changes__ in logical chunks.
34
+
35
+ Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. Probably you will also have to create tests (if needed) or create or update the example code that demonstrates the functionality of this change to the code.
36
+
37
+ 6. __Locally merge (or rebase)__ the upstream development branch into your topic branch:
38
+
39
+ ```bash
40
+ git pull [--rebase] upstream main
41
+ ```
42
+
43
+ 7. __Push__ your topic branch up to your fork:
44
+
45
+ ```bash
46
+ git push origin <topic-branch-name>
47
+ ```
48
+
49
+ 8. __[Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#changing-the-branch-range-and-destination-repository/)__ with a clear title and description against the `main` branch. All tests must be passing before we will review the PR.
50
+
51
+ ## Important notice
52
+
53
+ Before creating a pull request, make sure that you respect the repository's constraints regarding contributions. You can find them in the [CONTRIBUTING.md](CONTRIBUTING.md) file.
54
+
55
+ ## Repositories with Open, Easy, Help Wanted, Issue Filters
56
+
57
+ * [Python SDK](https://github.com/sendgrid/sendgrid-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
58
+ * [PHP SDK](https://github.com/sendgrid/sendgrid-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
59
+ * [C# SDK](https://github.com/sendgrid/sendgrid-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
60
+ * [Ruby SDK](https://github.com/sendgrid/sendgrid-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
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
+ * [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
+ * [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 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
+ * [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
+ * [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
+ * [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)
74
+ * [Java HTTP Client](https://github.com/sendgrid/java-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
75
+ * [Ruby HTTP Client](https://github.com/sendgrid/ruby-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
76
+ * [Go HTTP Client](https://github.com/sendgrid/rest/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
77
+ * [Open API Definition](https://github.com/sendgrid/sendgrid-oai/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
78
+ * [DX Automator](https://github.com/sendgrid/dx-automator/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
79
+ * [Documentation](https://github.com/sendgrid/docs/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) 2022, 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/smtpapi-ruby/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,10 +1,8 @@
1
- ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
1
+ ![SendGrid Logo](twilio_sendgrid_logo.png)
2
2
 
3
- [![Build Status](https://travis-ci.org/sendgrid/smtpapi-ruby.svg?branch=master)](https://travis-ci.org/SendGrid/smtpapi-ruby)
3
+ [![Build Status](https://github.com/sendgrid/smtpapi-ruby/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/smtpapi-ruby/actions/workflows/test-and-deploy.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/smtpapi.svg)](https://badge.fury.io/rb/smtpapi)
5
- [![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)
6
- [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
7
- [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
5
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
6
  [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
9
7
  [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/smtpapi-ruby.svg)](https://github.com/sendgrid/smtpapi-ruby/graphs/contributors)
10
8
 
@@ -13,13 +11,12 @@
13
11
  # Announcements
14
12
  **The default branch name for this repository has been changed to `main` as of 07/27/2020.**
15
13
 
16
- All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/smtpapi-ruby/blob/master/CHANGELOG.md).
14
+ All updates to this library is documented in our [CHANGELOG](CHANGELOG.md).
17
15
 
18
16
  # Table of Contents
19
17
  - [Installation](#installation)
20
18
  - [Quick Start](#quick-start)
21
19
  - [Usage](#usage)
22
- - [Roadmap](#roadmap)
23
20
  - [How to Contribute](#contribute)
24
21
  - [About](#about)
25
22
  - [License](#license)
@@ -77,24 +74,19 @@ print header.to_json
77
74
  # Usage
78
75
 
79
76
  - [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
80
- - [Example Code](https://github.com/sendgrid/smtpapi-ruby/blob/master/examples)
81
-
82
- <a name="roadmap"></a>
83
- # Roadmap
84
-
85
- If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/smtpapi-ruby/milestones). We would love to hear your feedback.
77
+ - [Example Code](examples)
86
78
 
87
79
  <a name="contribute"></a>
88
80
  # How to Contribute
89
81
 
90
- We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md) guide for details.
82
+ We encourage contribution to our libraries, please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details.
91
83
 
92
84
  Quick links:
93
85
 
94
- - [Feature Request](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#feature_request)
95
- - [Bug Reports](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#submit_a_bug_report)
96
- - [Improvements to the Codebase](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
97
- - [Review Pull Requests](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#code-reviews)
86
+ - [Feature Request](CONTRIBUTING.md#feature_request)
87
+ - [Bug Reports](CONTRIBUTING.md#submit_a_bug_report)
88
+ - [Improvements to the Codebase](CONTRIBUTING.md#improvements_to_the_codebase)
89
+ - [Review Pull Requests](CONTRIBUTING.md#code-reviews)
98
90
 
99
91
  ## Credits
100
92
 
@@ -112,4 +104,4 @@ If you've instead found a bug in the library or would like new features added, g
112
104
  <a name="license"></a>
113
105
  # License
114
106
 
115
- [The MIT License (MIT)](LICENSE.md)
107
+ [The MIT License (MIT)](LICENSE)
data/TROUBLESHOOTING.md CHANGED
@@ -8,7 +8,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
8
8
  <a name="request-header"></a>
9
9
  ## Viewing the Request Header
10
10
 
11
- When debugging or testing, it may be useful to exampine the raw request header to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
11
+ When debugging or testing, it may be useful to examine the raw request header to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
12
12
 
13
13
  You can do this like so:
14
14
 
data/USAGE.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # Usage
2
2
 
3
3
  - [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
4
- - [Example Code](https://github.com/sendgrid/smtpapi-ruby/blob/master/examples)
4
+ - [Example Code](examples)
@@ -2,5 +2,5 @@
2
2
  # SendGrid smtpapi
3
3
  #
4
4
  module Smtpapi
5
- VERSION = '0.1.7'.freeze
5
+ VERSION = '0.1.11'.freeze
6
6
  end
data/lib/smtpapi.rb CHANGED
@@ -111,6 +111,26 @@ module Smtpapi
111
111
  self
112
112
  end
113
113
 
114
+ def json_string
115
+ escape_unicode(to_array.to_json)
116
+ end
117
+ alias_method :to_json, :json_string
118
+
119
+ def escape_unicode(str)
120
+ str.unpack('U*').map do |i|
121
+ if i > 65_535
122
+ "\\u#{format('%04x', ((i - 0x10000) / 0x400 + 0xD800))}" \
123
+ "\\u#{format('%04x', ((i - 0x10000) % 0x400 + 0xDC00))}"
124
+ elsif i > 127
125
+ "\\u#{format('%04x', i)}"
126
+ else
127
+ i.chr('UTF-8')
128
+ end
129
+ end.join
130
+ end
131
+
132
+ protected
133
+
114
134
  def to_array
115
135
  data = {}
116
136
  data['to'] = @to unless @to.empty?
@@ -132,26 +152,5 @@ module Smtpapi
132
152
 
133
153
  data
134
154
  end
135
-
136
- protected :to_array
137
-
138
- def json_string
139
- escape_unicode(to_array.to_json)
140
- end
141
-
142
- alias :to_json :json_string
143
-
144
- def escape_unicode(str)
145
- str.unpack('U*').map do |i|
146
- if i > 65_535
147
- "\\u#{format('%04x', ((i - 0x10000) / 0x400 + 0xD800))}" \
148
- "\\u#{format('%04x', ((i - 0x10000) % 0x400 + 0xDC00))}"
149
- elsif i > 127
150
- "\\u#{format('%04x', i)}"
151
- else
152
- i.chr('UTF-8')
153
- end
154
- end.join
155
- end
156
155
  end
157
156
  end
data/smtpapi.gemspec CHANGED
@@ -13,12 +13,11 @@ Gem::Specification.new do |spec|
13
13
  spec.license = 'MIT'
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+ spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(/^(test|spec|features)/)
18
18
  spec.require_paths = ['lib']
19
19
 
20
20
  spec.add_development_dependency 'rake'
21
- spec.add_development_dependency('rubocop', '>=0.29.0', '<0.30.0')
22
21
  spec.add_development_dependency('test-unit', '~> 3.0')
23
- spec.add_development_dependency 'simplecov'
22
+ spec.add_development_dependency('simplecov', '~> 0.18.5')
24
23
  end
Binary file
Binary file
data/test/test.rb CHANGED
@@ -7,7 +7,7 @@ require './lib/smtpapi'
7
7
  #
8
8
  class SmtpapiTest < Test::Unit::TestCase
9
9
  def test_version
10
- assert_equal('0.1.7', Smtpapi::VERSION)
10
+ assert_equal('0.1.11', Smtpapi::VERSION)
11
11
  end
12
12
 
13
13
  def test_empty
@@ -226,12 +226,8 @@ class SmtpapiTest < Test::Unit::TestCase
226
226
  assert(File.file?('./.gitignore'))
227
227
  end
228
228
 
229
- def test_travis_exists
230
- assert(File.file?('./.travis.yml'))
231
- end
232
-
233
- def test_codeclimate_exists
234
- assert(File.file?('./.codeclimate.yml'))
229
+ def test_github_actions_exists
230
+ assert(File.file?('./.github/workflows/test-and-deploy.yml'))
235
231
  end
236
232
 
237
233
  def test_changelog_exists
@@ -251,7 +247,7 @@ class SmtpapiTest < Test::Unit::TestCase
251
247
  end
252
248
 
253
249
  def test_license_exists
254
- assert(File.file?('./LICENSE.md') || File.file?('./LICENSE.txt'))
250
+ assert(File.file?('./LICENSE'))
255
251
  end
256
252
 
257
253
  def test_pull_request_template_exists
@@ -275,7 +271,7 @@ class SmtpapiTest < Test::Unit::TestCase
275
271
  # end
276
272
 
277
273
  def test_license_date_is_updated
278
- license_year = IO.read('LICENSE.md').match(
274
+ license_year = IO.read('LICENSE').match(
279
275
  /Copyright \(C\) (\d{4}), Twilio SendGrid/
280
276
  )[1]
281
277
  current_year = Time.new.year
data/test/test_helper.rb CHANGED
@@ -1,2 +1,4 @@
1
- require 'simplecov'
2
- SimpleCov.start
1
+ if RUBY_VERSION.equal?('2.7')
2
+ require 'simplecov'
3
+ SimpleCov.start
4
+ end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smtpapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wataru Sato
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-05 00:00:00.000000000 Z
12
+ date: 2022-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -25,26 +25,6 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
- - !ruby/object:Gem::Dependency
29
- name: rubocop
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 0.29.0
35
- - - "<"
36
- - !ruby/object:Gem::Version
37
- version: 0.30.0
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: 0.29.0
45
- - - "<"
46
- - !ruby/object:Gem::Version
47
- version: 0.30.0
48
28
  - !ruby/object:Gem::Dependency
49
29
  name: test-unit
50
30
  requirement: !ruby/object:Gem::Requirement
@@ -63,16 +43,16 @@ dependencies:
63
43
  name: simplecov
64
44
  requirement: !ruby/object:Gem::Requirement
65
45
  requirements:
66
- - - ">="
46
+ - - "~>"
67
47
  - !ruby/object:Gem::Version
68
- version: '0'
48
+ version: 0.18.5
69
49
  type: :development
70
50
  prerelease: false
71
51
  version_requirements: !ruby/object:Gem::Requirement
72
52
  requirements:
73
- - - ">="
53
+ - - "~>"
74
54
  - !ruby/object:Gem::Version
75
- version: '0'
55
+ version: 0.18.5
76
56
  description: Smtpapi library for SendGrid.
77
57
  email:
78
58
  - awwa500@gmail.com
@@ -81,17 +61,19 @@ executables: []
81
61
  extensions: []
82
62
  extra_rdoc_files: []
83
63
  files:
84
- - ".codeclimate.yml"
85
64
  - ".env_sample"
65
+ - ".github/ISSUE_TEMPLATE/config.yml"
66
+ - ".github/workflows/test-and-deploy.yml"
86
67
  - ".gitignore"
87
68
  - ".rubocop.yml"
88
- - ".travis.yml"
69
+ - ".rubocop_todo.yml"
89
70
  - CHANGELOG.md
90
71
  - CODE_OF_CONDUCT.md
91
72
  - CONTRIBUTING.md
73
+ - FIRST_TIMERS.md
92
74
  - Gemfile
93
75
  - ISSUE_TEMPLATE.md
94
- - LICENSE.md
76
+ - LICENSE
95
77
  - Makefile
96
78
  - PULL_REQUEST_TEMPLATE.md
97
79
  - README.md
@@ -102,8 +84,11 @@ files:
102
84
  - lib/smtpapi.rb
103
85
  - lib/smtpapi/version.rb
104
86
  - smtpapi.gemspec
87
+ - static/img/github-fork.png
88
+ - static/img/github-sign-up.png
105
89
  - test/test.rb
106
90
  - test/test_helper.rb
91
+ - twilio_sendgrid_logo.png
107
92
  - use_cases/README.md
108
93
  homepage: https://github.com/sendgrid/smtpapi-ruby
109
94
  licenses:
@@ -124,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  requirements: []
127
- rubygems_version: 3.0.8
112
+ rubygems_version: 3.3.3
128
113
  signing_key:
129
114
  specification_version: 4
130
115
  summary: Smtpapi library for SendGrid.
data/.codeclimate.yml DELETED
@@ -1,17 +0,0 @@
1
- ---
2
- engines:
3
- duplication:
4
- enabled: true
5
- config:
6
- languages:
7
- - ruby
8
- fixme:
9
- enabled: true
10
- rubocop:
11
- enabled: true
12
- ratings:
13
- paths:
14
- - "**.rb"
15
- exclude_paths:
16
- - test/
17
- - examples/
data/.travis.yml DELETED
@@ -1,35 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - ruby-head
4
- - 2.7
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - jruby-9.2
9
- before_script:
10
- - bundle install
11
- script:
12
- - rubocop --fail-level=W
13
- - rake test
14
- matrix:
15
- allow_failures:
16
- - rvm: ruby-head
17
- fast_finish: true
18
- deploy:
19
- provider: rubygems
20
- api_key:
21
- secure: PRNz0pPyO99KdYcQ1WKkunc3TOz1N5ZmdT997KlzRYa5uos+IFqr5UsztJzOrus5iWoQdKKtLGSRYe1SFnXDkSOwK61Q5YvYdSqF3OE/QD63qHub+is4CxmfMmXg+eBGreSH+kIWlSD8N3ic2CDZR8JoQmhPcit6zCZSN3WVRfY=
22
- gem: smtpapi
23
- on:
24
- tags: true
25
- rvm: '2.4'
26
- skip_cleanup: true
27
-
28
- notifications:
29
- slack:
30
- if: branch = main
31
- on_pull_requests: false
32
- on_success: never
33
- on_failure: change
34
- rooms:
35
- - secure: kyDurUDtXcp+6SfpFeszmzRZEpl2IOFqevGelhKVfx7j+M+p1wvPCkv9vnSdpKaZbQ80EKORxS4ZsnKUL9/yOP2uF9mrzB/DCfzFynw/IVfBejM8nkbf/CmosFh0SkkLuwotaPeqMhAtg1J8Avk1HVKJmihaJfkD6kzQ3PSyKlw=