mailerlite 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2566cc48dc509e5ae5b9984347813da13573ab846edb846e498d54188fb92b3e
4
- data.tar.gz: 7a7006913f5787884709151a9f32fcd9b9ffc5463951e132a8aa074e6d32da40
3
+ metadata.gz: 04f57fa638110e54a96f4c7a0cf9f9027736d3237663074ededcd614fd86af81
4
+ data.tar.gz: 5562645c220260c6b5350bcfdca83595d6cbb6f7559cb4a69da75c09f6e6cc25
5
5
  SHA512:
6
- metadata.gz: 32ed1cef86c7256be4d286199ef4e0bd76e48664866189bdab9e08338ebf86bc4fc0726453b866ae913719072560582d1993f27699f2920ef30adc37acc1a229
7
- data.tar.gz: aad3f7cd3244010bd9bd2826e7ff8743fee62d97252572b605ccc9e58384f43f994317a7c68f013c03c5ccd96727ce04d4cbc9b34794790139736ccde057dbfa
6
+ metadata.gz: d0c1f531cd080e115e341609764ed7192e3ca9cdebcb1fa4e0088e465388f73502dde00103443d3dbbea8553edfc2fc543fcd2041c103c8de6296f31f1c18882
7
+ data.tar.gz: d3e3f86c1a70719330ff1e9cacaa53180522c58ff7a95eb636df51c1b7b27ad14ad2b83a7443756a435e54d5b093f5100accb2baf402798cc55df77a766897bb
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.5
3
+ NewCops: enable
3
4
 
4
5
  Layout/ParameterAlignment:
5
6
  Enabled: true
data/README.md CHANGED
@@ -64,8 +64,9 @@ implementations:
64
64
  * Ruby 2.6.0
65
65
  * Ruby 2.7.0
66
66
 
67
- ## Copyright
68
- Copyright (c) 2020 Justas Palumickas. See [LICENSE][github_actions] for details.
67
+ ## License
68
+
69
+ The package is available as open source under the terms of the [MIT License][license].
69
70
 
70
71
  [rubygems]: https://rubygems.org/gems/mailerlite
71
72
  [codecov]: https://codecov.io/gh/jpalumickas/mailerlite-ruby
@@ -37,15 +37,9 @@ module MailerLite
37
37
  private
38
38
 
39
39
  def request(method, path, query_params = {}, body_params = {})
40
- response = connection.send(method) do |request|
41
- request.url(path, query_params)
42
- request.headers['Content-Type'] = 'application/json'
43
-
44
- if client.config.api_key
45
- request.headers['X-MailerLite-ApiKey'] = client.config.api_key
46
- end
47
-
48
- request.body = body_params.to_json
40
+ response = connection.send(method, path) do |request|
41
+ request.params = query_params unless query_params.empty?
42
+ request.body = body_params.to_json unless body_params.empty?
49
43
  end
50
44
 
51
45
  response
@@ -53,9 +47,9 @@ module MailerLite
53
47
 
54
48
  def connection
55
49
  conn_opts = {
56
- headers: { user_agent: client.config.user_agent },
57
50
  url: client.config.url,
58
- builder: middleware
51
+ builder: middleware,
52
+ headers: headers
59
53
  }
60
54
  timeout = client.config.timeout
61
55
  conn_opts[:request] = { timeout: timeout } unless timeout.nil?
@@ -63,6 +57,17 @@ module MailerLite
63
57
  Faraday.new(conn_opts)
64
58
  end
65
59
 
60
+ def headers
61
+ headers = {
62
+ 'User-Agent' => client.config.user_agent,
63
+ 'Content-Type' => 'application/json'
64
+ }
65
+
66
+ headers['X-MailerLite-ApiKey'] = client.config.api_key if client.config.api_key
67
+
68
+ headers
69
+ end
70
+
66
71
  def middleware
67
72
  @middleware ||= Faraday::RackBuilder.new do |builder|
68
73
  builder.request :json
@@ -2,5 +2,5 @@
2
2
 
3
3
  module MailerLite
4
4
  # @return [String] Version number.
5
- VERSION = '1.11.0'
5
+ VERSION = '1.12.0'
6
6
  end
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'pry', '~> 0.13'
41
41
  spec.add_development_dependency 'rake', '~> 13.0'
42
42
  spec.add_development_dependency 'rspec', '~> 3.9'
43
- spec.add_development_dependency 'rubocop', '~> 0.82'
43
+ spec.add_development_dependency 'rubocop', '~> 0.86'
44
44
  spec.add_development_dependency 'simplecov', '~> 0.18'
45
45
  spec.add_development_dependency 'webmock', '~> 3.8'
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.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justas Palumickas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-23 00:00:00.000000000 Z
11
+ date: 2020-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0.82'
123
+ version: '0.86'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '0.82'
130
+ version: '0.86'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: simplecov
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -213,7 +213,7 @@ metadata:
213
213
  changelog_uri: https://github.com/jpalumickas/mailerlite-ruby/releases
214
214
  documentation_uri: https://github.com/jpalumickas/mailerlite-ruby/tree/master/examples
215
215
  source_code_uri: https://github.com/jpalumickas/mailerlite-ruby
216
- post_install_message:
216
+ post_install_message:
217
217
  rdoc_options: []
218
218
  require_paths:
219
219
  - lib
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  requirements: []
231
231
  rubygems_version: 3.1.2
232
- signing_key:
232
+ signing_key:
233
233
  specification_version: 4
234
234
  summary: Ruby wrapper for MailerLite API v2
235
235
  test_files: []