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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ded354d904892b5edb18803695bda97a368a55bcf8bee8f1b3f7cc3d54223a8
4
- data.tar.gz: 5e7e2e660129a7c4067d1ef74075f3f1be5e2ca8a78411199acb77b3c6b2352d
3
+ metadata.gz: b6e3bc63d01ecbecc505562a188a9b7c122b812d12a9b1e3437ace3b5348f6f5
4
+ data.tar.gz: be81cb74fddd57bbc539d4fb9c3723436e2b5af60d695413785d2f7c7ea6892e
5
5
  SHA512:
6
- metadata.gz: c2217d5763f88bc5c4d8a5f769ab327c0a31e1e781300a8cff5fb264297568c05e664c4d431359b49cc401e1756b9a52e070d71a87489822da0069aaf3bf8d9c
7
- data.tar.gz: a489db754706165b9c1a5637d73bd5fd5ab236c3fdfa81f6fe25e36d534b789425290e1c63d33107c0a79bc177e1eb20ee93101b3ab0dc8a18d7b99a6814b465
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) allows you to automate tests involving email. Allowing you to perform end-to-end automated and functional email testing.
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 and usage examples
13
+ ## Documentation
14
14
 
15
- [Mailosaur's documentation](https://mailosaur.com/docs) includes all the information and usage examples you'll need.
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
- ## Running tests
17
+ ## Usage
18
18
 
19
- Once you've cloned this repository locally, you can simply run:
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
- ## Linting code
56
+ Lint code (via Rubocop):
31
57
 
32
- Simply run Rubocop:
33
-
34
- ```
35
- bundle install
58
+ ```sh
36
59
  bundle exec rubocop
37
60
  ```
38
61
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Mailosaur
2
- VERSION = '7.0.0'.freeze
2
+ VERSION = '7.0.1'.freeze
3
3
  end
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.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-15 00:00:00.000000000 Z
11
+ date: 2020-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday