smtpapi 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -4
- data/.travis.yml +1 -7
- data/CHANGELOG.md +6 -0
- data/CONTRIBUTING.md +0 -2
- data/Makefile +1 -0
- data/README.md +0 -6
- data/lib/smtpapi.rb +20 -21
- data/lib/smtpapi/version.rb +1 -1
- data/smtpapi.gemspec +2 -2
- data/test/test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ea33650a2c95f7382b2803af80c12b1da1a20d33e11e8b118fb417687375c25
|
4
|
+
data.tar.gz: 5ec8b658a270602e58f7637e798f575cae607e1a5355b505e73f651923a0a403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02946689ed0272f288e96d3b38df12ed1dedda00b917aead376b3337cdcc90ebbd967a2735d67c8e7682b21aa42ad7e659f45ff8788e87a788e66b34db7c43b4'
|
7
|
+
data.tar.gz: a6aa16767d179f639dbfcce93e8b8bc0ade6c3c643d512456de1dfa47a8e4cd3b345b1d8c53e293621b303e72656b8956d35198bc511a69cf687732cf3b945f1
|
data/.rubocop.yml
CHANGED
@@ -16,10 +16,6 @@ ParameterLists:
|
|
16
16
|
AbcSize:
|
17
17
|
Max: 34
|
18
18
|
|
19
|
-
# Increase max number of "/" in %r
|
20
|
-
RegexpLiteral:
|
21
|
-
MaxSlashes: 0
|
22
|
-
|
23
19
|
# Increase the max line number of class
|
24
20
|
ClassLength:
|
25
21
|
Max: 250
|
@@ -30,3 +26,6 @@ CyclomaticComplexity:
|
|
30
26
|
|
31
27
|
PerceivedComplexity:
|
32
28
|
Max: 11
|
29
|
+
|
30
|
+
Metrics/LineLength:
|
31
|
+
Max: 100
|
data/.travis.yml
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- ruby-head
|
4
3
|
- 2.7
|
5
4
|
- 2.6
|
6
5
|
- 2.5
|
@@ -10,14 +9,9 @@ before_script:
|
|
10
9
|
- make install
|
11
10
|
script:
|
12
11
|
- make test
|
13
|
-
matrix:
|
14
|
-
allow_failures:
|
15
|
-
- rvm: ruby-head
|
16
|
-
fast_finish: true
|
17
12
|
deploy:
|
18
13
|
provider: rubygems
|
19
|
-
api_key:
|
20
|
-
secure: PRNz0pPyO99KdYcQ1WKkunc3TOz1N5ZmdT997KlzRYa5uos+IFqr5UsztJzOrus5iWoQdKKtLGSRYe1SFnXDkSOwK61Q5YvYdSqF3OE/QD63qHub+is4CxmfMmXg+eBGreSH+kIWlSD8N3ic2CDZR8JoQmhPcit6zCZSN3WVRfY=
|
14
|
+
api_key: $RUBYGEMS_API_KEY
|
21
15
|
gem: smtpapi
|
22
16
|
on:
|
23
17
|
tags: true
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
[2020-09-02] Version 0.1.9
|
7
|
+
--------------------------
|
8
|
+
**Library - Chore**
|
9
|
+
- [PR #71](https://github.com/sendgrid/smtpapi-ruby/pull/71): Conformance To Style Standards With RuboCop & TravisCI. Thanks to [@alanunruh](https://github.com/alanunruh)!
|
10
|
+
|
11
|
+
|
6
12
|
[2020-08-19] Version 0.1.8
|
7
13
|
--------------------------
|
8
14
|
**Library - Docs**
|
data/CONTRIBUTING.md
CHANGED
@@ -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
|
|
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -19,7 +19,6 @@ All updates to this library is documented in our [CHANGELOG](CHANGELOG.md).
|
|
19
19
|
- [Installation](#installation)
|
20
20
|
- [Quick Start](#quick-start)
|
21
21
|
- [Usage](#usage)
|
22
|
-
- [Roadmap](#roadmap)
|
23
22
|
- [How to Contribute](#contribute)
|
24
23
|
- [About](#about)
|
25
24
|
- [License](#license)
|
@@ -79,11 +78,6 @@ print header.to_json
|
|
79
78
|
- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
|
80
79
|
- [Example Code](examples)
|
81
80
|
|
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.
|
86
|
-
|
87
81
|
<a name="contribute"></a>
|
88
82
|
# How to Contribute
|
89
83
|
|
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/lib/smtpapi/version.rb
CHANGED
data/smtpapi.gemspec
CHANGED
@@ -13,8 +13,8 @@ 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(
|
17
|
-
spec.test_files = spec.files.grep(
|
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'
|
data/test/test.rb
CHANGED
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.
|
4
|
+
version: 0.1.9
|
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-
|
12
|
+
date: 2020-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|