mailerlite 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/test.yml +10 -10
- data/.rubocop.yml +6 -0
- data/README.md +3 -1
- data/examples/subscribers.md +1 -1
- data/lib/mailerlite/connection.rb +1 -3
- data/lib/mailerlite/middleware/fix_unparsed_json.rb +3 -3
- data/lib/mailerlite/middleware/raise_error.rb +0 -2
- data/lib/mailerlite/middleware/underscore_keys.rb +2 -2
- data/lib/mailerlite/version.rb +1 -1
- data/mailerlite.gemspec +6 -6
- metadata +15 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 359210ce363c788f0ad34e533a7d50a9a919f19da5bad287e6515257cad743b2
|
4
|
+
data.tar.gz: 1ce825edb310b2c63fa9c7d764c15ddfdf6996d344fafdc618af2c036ca1510d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8e88a6dcd36f6bd11c64fd3fadf3ca20a19408097a9ecb860d94645d0cc804cfd434768bf31ec000333407118b2a59da5032d01cabbaa7ccaa6703121898c90
|
7
|
+
data.tar.gz: f33f19f0b3bab8bba2dd540ba29000e6c34119e20aca63ea088b17f7cfc9bc3624117440435eba5d56c0c82d057b64ee2502b3831eb640f3af3d6020c279e2c8
|
data/.github/workflows/test.yml
CHANGED
@@ -7,20 +7,18 @@ jobs:
|
|
7
7
|
name: Test
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: [2.5, 2.6, 2.7]
|
10
|
+
ruby: [2.5, 2.6, 2.7, '3.0', head, truffleruby]
|
11
11
|
|
12
12
|
runs-on: ubuntu-latest
|
13
13
|
|
14
14
|
steps:
|
15
|
-
- uses: actions/checkout@
|
15
|
+
- uses: actions/checkout@v2
|
16
16
|
- name: Set up Ruby ${{ matrix.ruby }}
|
17
|
-
uses:
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
18
|
with:
|
19
19
|
ruby-version: ${{ matrix.ruby }}
|
20
|
-
|
21
|
-
|
22
|
-
gem install bundler
|
23
|
-
bundle install --jobs 4 --retry 3
|
20
|
+
bundler-cache: true
|
21
|
+
|
24
22
|
- name: RSpec
|
25
23
|
env:
|
26
24
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
@@ -32,11 +30,13 @@ jobs:
|
|
32
30
|
runs-on: ubuntu-latest
|
33
31
|
|
34
32
|
steps:
|
35
|
-
- uses: actions/checkout@
|
33
|
+
- uses: actions/checkout@v2.3.4
|
36
34
|
- name: Set up Ruby
|
37
|
-
uses:
|
35
|
+
uses: ruby/setup-ruby@v1
|
38
36
|
with:
|
39
|
-
ruby-version:
|
37
|
+
ruby-version: '3.0'
|
38
|
+
bundler-cache: true
|
39
|
+
|
40
40
|
- name: Install dependencies
|
41
41
|
run: |
|
42
42
|
gem install bundler
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -63,10 +63,12 @@ implementations:
|
|
63
63
|
* Ruby 2.5.0
|
64
64
|
* Ruby 2.6.0
|
65
65
|
* Ruby 2.7.0
|
66
|
+
* Ruby 3.0.0
|
67
|
+
* Truffleruby
|
66
68
|
|
67
69
|
## License
|
68
70
|
|
69
|
-
The
|
71
|
+
The gem is available as open source under the terms of the [MIT License][license].
|
70
72
|
|
71
73
|
[rubygems]: https://rubygems.org/gems/mailerlite
|
72
74
|
[codecov]: https://codecov.io/gh/jpalumickas/mailerlite-ruby
|
data/examples/subscribers.md
CHANGED
@@ -37,12 +37,10 @@ module MailerLite
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def request(method, path, query_params = {}, body_params = {})
|
40
|
-
|
40
|
+
connection.send(method, path) do |request|
|
41
41
|
request.params = query_params unless query_params.empty?
|
42
42
|
request.body = body_params.to_json unless body_params.empty?
|
43
43
|
end
|
44
|
-
|
45
|
-
response
|
46
44
|
end
|
47
45
|
|
48
46
|
def connection
|
@@ -4,10 +4,10 @@ module MailerLite
|
|
4
4
|
module Middleware
|
5
5
|
# This middleware will convert empty response to {}
|
6
6
|
class FixUnparsedJson < Faraday::Response::Middleware
|
7
|
-
|
7
|
+
def parse(body)
|
8
|
+
return '{}' if body == ''
|
8
9
|
|
9
|
-
|
10
|
-
response[:body] = {} if response[:body] == ''
|
10
|
+
body
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -6,8 +6,6 @@ module MailerLite
|
|
6
6
|
# This class raises an exception based HTTP status codes returned
|
7
7
|
# by the API.
|
8
8
|
class RaiseError < Faraday::Response::Middleware
|
9
|
-
private
|
10
|
-
|
11
9
|
def on_complete(response)
|
12
10
|
error = MailerLite::Error.from_response(response)
|
13
11
|
raise error if error
|
@@ -4,12 +4,12 @@ module MailerLite
|
|
4
4
|
module Middleware
|
5
5
|
# This class will underscore all response keys from CamelCase.
|
6
6
|
class UnderscoreKeys < Faraday::Response::Middleware
|
7
|
-
private
|
8
|
-
|
9
7
|
def on_complete(response)
|
10
8
|
response[:body] = updated_response(response[:body])
|
11
9
|
end
|
12
10
|
|
11
|
+
private
|
12
|
+
|
13
13
|
def updated_response(response)
|
14
14
|
if response.is_a?(Hash)
|
15
15
|
underscore_hash_keys(response)
|
data/lib/mailerlite/version.rb
CHANGED
data/mailerlite.gemspec
CHANGED
@@ -34,13 +34,13 @@ Gem::Specification.new do |spec|
|
|
34
34
|
|
35
35
|
spec.add_dependency 'faraday', '~> 1.0', '>= 1.0.1'
|
36
36
|
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
37
|
-
spec.add_dependency 'hashie', '
|
37
|
+
spec.add_dependency 'hashie', '~> 4.0'
|
38
38
|
|
39
|
-
spec.add_development_dependency 'codecov', '~> 0.
|
39
|
+
# spec.add_development_dependency 'codecov', '~> 0.2', '>= 0.2.12'
|
40
40
|
spec.add_development_dependency 'pry', '~> 0.13'
|
41
41
|
spec.add_development_dependency 'rake', '~> 13.0'
|
42
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
43
|
-
spec.add_development_dependency 'rubocop', '~>
|
44
|
-
spec.add_development_dependency 'simplecov', '~> 0.
|
45
|
-
spec.add_development_dependency 'webmock', '~> 3.
|
42
|
+
spec.add_development_dependency 'rspec', '~> 3.10'
|
43
|
+
spec.add_development_dependency 'rubocop', '~> 1.8'
|
44
|
+
spec.add_development_dependency 'simplecov', '~> 0.20'
|
45
|
+
spec.add_development_dependency 'webmock', '~> 3.11'
|
46
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailerlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justas Palumickas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -46,32 +46,18 @@ dependencies:
|
|
46
46
|
version: '1.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: hashie
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 3.5.5
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 3.5.5
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: codecov
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
64
50
|
requirements:
|
65
51
|
- - "~>"
|
66
52
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0
|
68
|
-
type: :
|
53
|
+
version: '4.0'
|
54
|
+
type: :runtime
|
69
55
|
prerelease: false
|
70
56
|
version_requirements: !ruby/object:Gem::Requirement
|
71
57
|
requirements:
|
72
58
|
- - "~>"
|
73
59
|
- !ruby/object:Gem::Version
|
74
|
-
version: '0
|
60
|
+
version: '4.0'
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: pry
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,56 +92,56 @@ dependencies:
|
|
106
92
|
requirements:
|
107
93
|
- - "~>"
|
108
94
|
- !ruby/object:Gem::Version
|
109
|
-
version: '3.
|
95
|
+
version: '3.10'
|
110
96
|
type: :development
|
111
97
|
prerelease: false
|
112
98
|
version_requirements: !ruby/object:Gem::Requirement
|
113
99
|
requirements:
|
114
100
|
- - "~>"
|
115
101
|
- !ruby/object:Gem::Version
|
116
|
-
version: '3.
|
102
|
+
version: '3.10'
|
117
103
|
- !ruby/object:Gem::Dependency
|
118
104
|
name: rubocop
|
119
105
|
requirement: !ruby/object:Gem::Requirement
|
120
106
|
requirements:
|
121
107
|
- - "~>"
|
122
108
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
109
|
+
version: '1.8'
|
124
110
|
type: :development
|
125
111
|
prerelease: false
|
126
112
|
version_requirements: !ruby/object:Gem::Requirement
|
127
113
|
requirements:
|
128
114
|
- - "~>"
|
129
115
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
116
|
+
version: '1.8'
|
131
117
|
- !ruby/object:Gem::Dependency
|
132
118
|
name: simplecov
|
133
119
|
requirement: !ruby/object:Gem::Requirement
|
134
120
|
requirements:
|
135
121
|
- - "~>"
|
136
122
|
- !ruby/object:Gem::Version
|
137
|
-
version: '0.
|
123
|
+
version: '0.20'
|
138
124
|
type: :development
|
139
125
|
prerelease: false
|
140
126
|
version_requirements: !ruby/object:Gem::Requirement
|
141
127
|
requirements:
|
142
128
|
- - "~>"
|
143
129
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0.
|
130
|
+
version: '0.20'
|
145
131
|
- !ruby/object:Gem::Dependency
|
146
132
|
name: webmock
|
147
133
|
requirement: !ruby/object:Gem::Requirement
|
148
134
|
requirements:
|
149
135
|
- - "~>"
|
150
136
|
- !ruby/object:Gem::Version
|
151
|
-
version: '3.
|
137
|
+
version: '3.11'
|
152
138
|
type: :development
|
153
139
|
prerelease: false
|
154
140
|
version_requirements: !ruby/object:Gem::Requirement
|
155
141
|
requirements:
|
156
142
|
- - "~>"
|
157
143
|
- !ruby/object:Gem::Version
|
158
|
-
version: '3.
|
144
|
+
version: '3.11'
|
159
145
|
description: Ruby gem for MailerLite API v2
|
160
146
|
email:
|
161
147
|
- jpalumickas@gmail.com
|
@@ -163,6 +149,7 @@ executables: []
|
|
163
149
|
extensions: []
|
164
150
|
extra_rdoc_files: []
|
165
151
|
files:
|
152
|
+
- ".github/dependabot.yml"
|
166
153
|
- ".github/workflows/test.yml"
|
167
154
|
- ".gitignore"
|
168
155
|
- ".hound.yml"
|
@@ -228,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
215
|
- !ruby/object:Gem::Version
|
229
216
|
version: '0'
|
230
217
|
requirements: []
|
231
|
-
rubygems_version: 3.
|
218
|
+
rubygems_version: 3.2.5
|
232
219
|
signing_key:
|
233
220
|
specification_version: 4
|
234
221
|
summary: Ruby wrapper for MailerLite API v2
|