mailosaur 7.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -10
- data/lib/Mailosaur/messages.rb +1 -1
- data/lib/Mailosaur/models/search_criteria.rb +11 -0
- data/lib/Mailosaur/version.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: b6e3bc63d01ecbecc505562a188a9b7c122b812d12a9b1e3437ace3b5348f6f5
|
4
|
+
data.tar.gz: be81cb74fddd57bbc539d4fb9c3723436e2b5af60d695413785d2f7c7ea6892e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '058e76420f70a2525437f99b37e2ee0c9ebbb67330b1c3a9be36f5d650fb51e1839929be54f765719b7df71e002624b4223f949c5762452429ceb5f968f96dc3'
|
7
|
+
data.tar.gz: a176041bec46bec551bcaff33d9b01213aa5652d223629fa7028d9f73807c132d8770bba10b3b6a34af78600e4db9a34f7a6df8964a08f59b5690bf0834d00f6
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Mailosaur Ruby Client Library
|
2
2
|
|
3
|
-
[Mailosaur](https://mailosaur.com)
|
3
|
+
[Mailosaur](https://mailosaur.com) lets you automate email and SMS tests, like account verification and password resets, and integrate these into your CI/CD pipeline.
|
4
4
|
|
5
5
|
[![](https://github.com/mailosaur/mailosaur-ruby/workflows/CI/badge.svg)](https://github.com/mailosaur/mailosaur-ruby/actions)
|
6
6
|
|
@@ -10,29 +10,52 @@
|
|
10
10
|
gem install mailosaur
|
11
11
|
```
|
12
12
|
|
13
|
-
## Documentation
|
13
|
+
## Documentation
|
14
14
|
|
15
|
-
[
|
15
|
+
Please see the [Ruby client reference](https://mailosaur.com/docs/email-testing/ruby/client-reference/) for the most up-to-date documentation.
|
16
16
|
|
17
|
-
##
|
17
|
+
## Usage
|
18
18
|
|
19
|
-
|
19
|
+
example.rb
|
20
20
|
|
21
|
+
```ruby
|
22
|
+
require "mailosaur"
|
23
|
+
mailosaur = Mailosaur::MailosaurClient.new("YOUR_API_KEY")
|
24
|
+
|
25
|
+
result = mailosaur.servers.list()
|
26
|
+
|
27
|
+
print("You have a server called: " + result.items[0].name)
|
21
28
|
```
|
29
|
+
|
30
|
+
## Development
|
31
|
+
|
32
|
+
You must have the following prerequisites installed:
|
33
|
+
|
34
|
+
* [Bundler](https://bundler.io/)
|
35
|
+
|
36
|
+
Install all development dependencies:
|
37
|
+
|
38
|
+
```sh
|
22
39
|
bundle install
|
40
|
+
```
|
41
|
+
|
42
|
+
The test suite requires the following environment variables to be set:
|
23
43
|
|
44
|
+
```sh
|
45
|
+
export MAILOSAUR_BASE_URL=https://mailosaur.com/
|
24
46
|
export MAILOSAUR_API_KEY=your_api_key
|
25
47
|
export MAILOSAUR_SERVER=server_id
|
48
|
+
```
|
49
|
+
|
50
|
+
Run all tests:
|
26
51
|
|
52
|
+
```sh
|
27
53
|
bundle exec rake test
|
28
54
|
```
|
29
55
|
|
30
|
-
|
56
|
+
Lint code (via Rubocop):
|
31
57
|
|
32
|
-
|
33
|
-
|
34
|
-
```
|
35
|
-
bundle install
|
58
|
+
```sh
|
36
59
|
bundle exec rubocop
|
37
60
|
```
|
38
61
|
|
data/lib/Mailosaur/messages.rb
CHANGED
@@ -34,7 +34,7 @@ module Mailosaur
|
|
34
34
|
# Defaults timeout to 10s, receivedAfter to 1h
|
35
35
|
raise Mailosaur::MailosaurError.new('Must provide a valid Server ID.', 'invalid_request') if server.length != 8
|
36
36
|
|
37
|
-
result = search(server, criteria, timeout: timeout, received_after: received_after)
|
37
|
+
result = search(server, criteria, page: 0, items_per_page: 1, timeout: timeout, received_after: received_after)
|
38
38
|
get_by_id(result.items[0].id)
|
39
39
|
end
|
40
40
|
|
@@ -2,11 +2,17 @@ module Mailosaur
|
|
2
2
|
module Models
|
3
3
|
class SearchCriteria < BaseModel
|
4
4
|
def initialize(data = {})
|
5
|
+
@sent_from = data['sentFrom']
|
5
6
|
@sent_to = data['sentTo']
|
6
7
|
@subject = data['subject']
|
7
8
|
@body = data['body']
|
9
|
+
@match = data['match'] || 'ALL'
|
8
10
|
end
|
9
11
|
|
12
|
+
# @return [String] The full email address from which the target email was
|
13
|
+
# sent.
|
14
|
+
attr_accessor :sent_from
|
15
|
+
|
10
16
|
# @return [String] The full email address to which the target email was
|
11
17
|
# sent.
|
12
18
|
attr_accessor :sent_to
|
@@ -18,6 +24,11 @@ module Mailosaur
|
|
18
24
|
# @return [String] The value to seek within the target email's HTML or
|
19
25
|
# text body.
|
20
26
|
attr_accessor :body
|
27
|
+
|
28
|
+
# @return [String] If set to ALL (default), then only results that match all
|
29
|
+
# specified criteria will be returned. If set to ANY, results that match any of the
|
30
|
+
# specified criteria will be returned.
|
31
|
+
attr_accessor :match
|
21
32
|
end
|
22
33
|
end
|
23
34
|
end
|
data/lib/Mailosaur/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailosaur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailosaur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|