maropost 0.8.2 → 0.10.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
- SHA1:
3
- metadata.gz: ab774a3e10205f14b11eb4d32cd6a0f6f90fd47e
4
- data.tar.gz: b4141781b430fe4b4d2549db902c87d41de05d5c
2
+ SHA256:
3
+ metadata.gz: 6b2354f0a99b9630405778192ebfd5bb8dac0b0acacb7559ac452537acc25224
4
+ data.tar.gz: e213f5a6fcb929019bb953e38823da3f7399b7acbcdbabacba5ad1f744dac3fd
5
5
  SHA512:
6
- metadata.gz: 0364c6faffd676812f234bc804537969a9f975e8a4fbe9de74f635268f670ec93b7343f2ae149f057f8a80e2dcb5f37925193c7bc4178f9f90b43f0a6f3d192c
7
- data.tar.gz: 0d72e7397284499d31c21c99ab640b14f70a0e83e1f079b013c50f86541788ad8db5fe0813bcf6ebe71e808e1aea066202fb9722d3824115ec21de0ee20922b8
6
+ metadata.gz: e368a1232f8cd0afabc049d8a02eb33ee72baac6fee2241b5302dea01e8325f08b3e28eb087b5cba56bc4f0d99245667c14eafabbab8dbf3e8fc8e1647afb263
7
+ data.tar.gz: 82a35bc3c2864eb8b67fb47f28e49d82a616ef12a105ff56e8d1600b1633292064bf20b1833ceb93e1e5d6ef15839b72d854ae0c1d6e46026457698b7d35f586
@@ -0,0 +1,17 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
17
+ - run: bundle exec rake
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.7.5
data/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @amaabca/red
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Maropost [![Build Status](https://travis-ci.org/amaabca/maropost.svg)](https://travis-ci.org/amaabca/maropost)
1
+ # [![Maropost - CI](https://github.com/amaabca/maropost/actions/workflows/ci.yml/badge.svg)](https://github.com/amaabca/maropost/actions/workflows/ci.yml)
2
2
 
3
3
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/maropost`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
data/lib/maropost/api.rb CHANGED
@@ -15,7 +15,7 @@ module Maropost
15
15
  )
16
16
  response = JSON.parse(service.execute!.body)
17
17
  Maropost::Contact.new(response)
18
- rescue RestClient::ResourceNotFound
18
+ rescue RestClient::Exception
19
19
  nil
20
20
  end
21
21
 
@@ -35,7 +35,7 @@ module Maropost
35
35
  )
36
36
  response = JSON.parse(service.execute!.body)
37
37
  Maropost::Contact.new(response)
38
- rescue RestClient::UnprocessableEntity, RestClient::BadRequest
38
+ rescue RestClient::Exception
39
39
  contact.errors << 'Unable to create or update contact'
40
40
  contact
41
41
  end
@@ -48,7 +48,7 @@ module Maropost
48
48
  )
49
49
  response = JSON.parse(service.execute!.body)
50
50
  Maropost::Contact.new(response)
51
- rescue RestClient::UnprocessableEntity, RestClient::BadRequest
51
+ rescue RestClient::Exception
52
52
  contact.errors << 'Unable to update contact'
53
53
  contact
54
54
  end
@@ -84,6 +84,13 @@ module Maropost
84
84
  end
85
85
 
86
86
  def create_or_update_payload(contact)
87
+ payload(contact).tap do |p|
88
+ p[:contact][:first_name] = contact.try(:first_name) if contact.try(:first_name)
89
+ p[:contact][:last_name] = contact.try(:last_name) if contact.try(:last_name)
90
+ end
91
+ end
92
+
93
+ def payload(contact)
87
94
  {
88
95
  contact: {
89
96
  email: contact.email,
@@ -7,6 +7,8 @@ module Maropost
7
7
  id
8
8
  email
9
9
  phone_number
10
+ first_name
11
+ last_name
10
12
  cell_phone_number
11
13
  lists
12
14
  errors
@@ -34,6 +36,8 @@ module Maropost
34
36
  self.id = data[:id]
35
37
  self.email = data[:email]
36
38
  self.phone_number = data[:phone]
39
+ self.first_name = data[:first_name]
40
+ self.last_name = data[:last_name]
37
41
  self.cell_phone_number = data[:cell_phone_number]
38
42
  self.allow_emails = data.fetch(:allow_emails) { !DoNotMailList.exists?(self) }
39
43
  self.errors = []
@@ -14,7 +14,7 @@ module Maropost
14
14
  )
15
15
  response = JSON.parse(service.execute!.body)
16
16
  response['id'].present?
17
- rescue RestClient::ResourceNotFound, RestClient::BadRequest
17
+ rescue RestClient::Exception
18
18
  false
19
19
  end
20
20
 
@@ -26,7 +26,7 @@ module Maropost
26
26
  payload: payload
27
27
  )
28
28
  service.execute!
29
- rescue RestClient::UnprocessableEntity, RestClient::BadRequest
29
+ rescue RestClient::Exception
30
30
  false
31
31
  end
32
32
 
@@ -39,7 +39,7 @@ module Maropost
39
39
  }
40
40
  )
41
41
  service.execute!
42
- rescue RestClient::UnprocessableEntity, RestClient::BadRequest
42
+ rescue RestClient::Exception
43
43
  false
44
44
  end
45
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Maropost
4
- VERSION = '0.8.2'
4
+ VERSION = '0.10.0'
5
5
  end
data/maropost.gemspec CHANGED
@@ -11,30 +11,26 @@ Gem::Specification.new do |spec|
11
11
  spec.authors = [
12
12
  'Michael van den Beuken',
13
13
  'Ruben Estevez',
14
- 'Jordan Babe',
15
- 'Ryan Jones',
16
14
  'Darko Dosenovic',
17
- 'Jonathan Weyermann',
18
- 'Kayt Campbell',
19
- 'Jesse Doyle',
20
15
  'Zoie Carnegie',
21
16
  'Sinead Errity',
22
- 'Serene Yew',
23
- 'Martin Echtner'
17
+ 'David Dowie',
18
+ 'Anneliese Ansorger',
19
+ 'Barb Smerekova',
20
+ 'Volodymyr Rykhliuk',
21
+ 'Winnie Ho'
24
22
  ]
25
23
  spec.email = [
26
24
  'michael.beuken@gmail.com',
27
25
  'ruben.a.estevez@gmail.com',
28
- 'jorbabe@gmail.com',
29
- 'ryan.michael.jones@gmail.com',
30
26
  'darko.dosenovic@ama.ab.ca',
31
- 'jonathan.weyermann@ama.ab.ca',
32
- 'kayt.campbell@ama.ab.ca',
33
- 'jdoyle@ualberta.ca',
34
27
  'zoie.carnegie@ama.ab.ca',
35
28
  'sinead.errity@ama.ab.ca',
36
- 'serene.yew@ama.ab.ca',
37
- 'martin.echtner@ama.ab.ca'
29
+ 'david.dowie@ama.ab.ca',
30
+ 'anneliese.ansorger@ama.ab.ca',
31
+ 'barb.smerekova@ama.ab.ca',
32
+ 'volodymyr.rykhliuk@ama.ab.ca',
33
+ 'winnie.ho@ama.ab.ca'
38
34
  ]
39
35
  spec.summary = 'Interact with the Maropost API'
40
36
  spec.description = 'Interact with the Maropost API'
metadata CHANGED
@@ -1,25 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maropost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
8
8
  - Ruben Estevez
9
- - Jordan Babe
10
- - Ryan Jones
11
9
  - Darko Dosenovic
12
- - Jonathan Weyermann
13
- - Kayt Campbell
14
- - Jesse Doyle
15
10
  - Zoie Carnegie
16
11
  - Sinead Errity
17
- - Serene Yew
18
- - Martin Echtner
19
- autorequire:
12
+ - David Dowie
13
+ - Anneliese Ansorger
14
+ - Barb Smerekova
15
+ - Volodymyr Rykhliuk
16
+ - Winnie Ho
17
+ autorequire:
20
18
  bindir: bin
21
19
  cert_chain: []
22
- date: 2017-11-15 00:00:00.000000000 Z
20
+ date: 2023-11-02 00:00:00.000000000 Z
23
21
  dependencies:
24
22
  - !ruby/object:Gem::Dependency
25
23
  name: rest-client
@@ -165,26 +163,25 @@ description: Interact with the Maropost API
165
163
  email:
166
164
  - michael.beuken@gmail.com
167
165
  - ruben.a.estevez@gmail.com
168
- - jorbabe@gmail.com
169
- - ryan.michael.jones@gmail.com
170
166
  - darko.dosenovic@ama.ab.ca
171
- - jonathan.weyermann@ama.ab.ca
172
- - kayt.campbell@ama.ab.ca
173
- - jdoyle@ualberta.ca
174
167
  - zoie.carnegie@ama.ab.ca
175
168
  - sinead.errity@ama.ab.ca
176
- - serene.yew@ama.ab.ca
177
- - martin.echtner@ama.ab.ca
169
+ - david.dowie@ama.ab.ca
170
+ - anneliese.ansorger@ama.ab.ca
171
+ - barb.smerekova@ama.ab.ca
172
+ - volodymyr.rykhliuk@ama.ab.ca
173
+ - winnie.ho@ama.ab.ca
178
174
  executables: []
179
175
  extensions: []
180
176
  extra_rdoc_files: []
181
177
  files:
178
+ - ".github/workflows/ci.yml"
182
179
  - ".gitignore"
183
180
  - ".rspec"
184
181
  - ".rubocop.yml"
185
182
  - ".ruby-version"
186
183
  - ".simplecov"
187
- - ".travis.yml"
184
+ - CODEOWNERS
188
185
  - Gemfile
189
186
  - LICENSE.txt
190
187
  - README.md
@@ -203,7 +200,7 @@ homepage: https://github.com/amaabca/maropost
203
200
  licenses:
204
201
  - MIT
205
202
  metadata: {}
206
- post_install_message:
203
+ post_install_message:
207
204
  rdoc_options: []
208
205
  require_paths:
209
206
  - lib
@@ -219,9 +216,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
216
  - !ruby/object:Gem::Version
220
217
  version: '0'
221
218
  requirements: []
222
- rubyforge_project:
223
- rubygems_version: 2.6.8
224
- signing_key:
219
+ rubygems_version: 3.1.6
220
+ signing_key:
225
221
  specification_version: 4
226
222
  summary: Interact with the Maropost API
227
223
  test_files: []
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- sudo: false
4
- rvm:
5
- - 2.4.0
6
- - 2.3.1
7
- - 2.2.2