mailgun-ruby 1.1.9 → 1.1.10
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 +4 -4
- data/README.md +1 -1
- data/lib/mailgun/events/events.rb +1 -1
- data/lib/mailgun/version.rb +1 -1
- data/spec/unit/events/events_spec.rb +19 -0
- metadata +3 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e88262b939edf330c91ac551b2f5945e4f4e5825f734bef28a7455cc2ec2dcc
|
4
|
+
data.tar.gz: 4bfffa2ae623704dcef2754a040fccc3a5efbbe8ee6e761e473215fbfcade5b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b5a20d3cf98827f101e5e06f563e605a80a626f2d4e5f4147f908d955e13926e3f2995db6bfbeb26b8ff343618104f2d83f298c808416362f4c0cae7a2d9ec
|
7
|
+
data.tar.gz: 7bb9a9085b738d2cb0bd8bc57f176928d7eb54bf09a190bfd6fc0d21ae526a0f72b70970c2bd19a9aa899401cc3bce1d591089a14aa7ec324b94758b2ed3caa0
|
data/README.md
CHANGED
@@ -101,7 +101,7 @@ module Mailgun
|
|
101
101
|
# Returns a String of the partial URI if the given url follows the regular API format
|
102
102
|
# Returns nil in other cases (e.g. when given nil, or an irrelevant url)
|
103
103
|
def extract_endpoint_from(url = nil)
|
104
|
-
URI.parse(url).path[
|
104
|
+
URI.parse(url).path[/\/v[\d]\/#{@domain}\/events\/(.+)/,1]
|
105
105
|
rescue URI::InvalidURIError
|
106
106
|
nil
|
107
107
|
end
|
data/lib/mailgun/version.rb
CHANGED
@@ -11,6 +11,25 @@ describe 'The method get' do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
describe 'Pagination' do
|
15
|
+
it 'should return a proper hash of log data.' do
|
16
|
+
@mg_obj = Mailgun::UnitClient.new('events')
|
17
|
+
events = Mailgun::Events.new(@mg_obj, "samples.mailgun.org")
|
18
|
+
result = events.get()
|
19
|
+
|
20
|
+
json = JSON.parse(result.body)
|
21
|
+
expect(json).to include("paging")
|
22
|
+
expect(json["paging"]).to include("next")
|
23
|
+
expect(json["paging"]).to include{"previous"}
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should calculate proper next-page url' do
|
27
|
+
events = Mailgun::Events.new(@mg_obj, "samples.mailgun.org")
|
28
|
+
output = events.send(:extract_endpoint_from, '/v3/samples.mailgun.org/events/W3siYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIHsiYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIFsiZiJdLCBudWxsLCBbWyJhY2NvdW50LmlkIiwgIjU4MDUyMTg2NzhmYTE2MTNjNzkwYjUwZiJdLCBbImRvbWFpbi5uYW1lIiwgInNhbmRib3gyOTcwMTUyYWYzZDM0NTU5YmZjN2U3MTcwM2E2Y2YyNC5tYWlsZ3VuLm9yZyJdXSwgMTAwLCBudWxsXQ==')
|
29
|
+
|
30
|
+
expect(output).to eq 'W3siYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIHsiYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIFsiZiJdLCBudWxsLCBbWyJhY2NvdW50LmlkIiwgIjU4MDUyMTg2NzhmYTE2MTNjNzkwYjUwZiJdLCBbImRvbWFpbi5uYW1lIiwgInNhbmRib3gyOTcwMTUyYWYzZDM0NTU5YmZjN2U3MTcwM2E2Y2YyNC5tYWlsZ3VuLm9yZyJdXSwgMTAwLCBudWxsXQ=='
|
31
|
+
end
|
32
|
+
end
|
14
33
|
|
15
34
|
describe 'The method next' do
|
16
35
|
it 'should return the next series of data.' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailgun-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailgun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-06-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -147,7 +147,6 @@ files:
|
|
147
147
|
- ".rubocop.yml"
|
148
148
|
- ".rubocop_todo.yml"
|
149
149
|
- ".ruby-env.yml.example"
|
150
|
-
- ".ruby-version"
|
151
150
|
- ".travis.yml"
|
152
151
|
- Gemfile
|
153
152
|
- LICENSE
|
@@ -245,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
244
|
version: '0'
|
246
245
|
requirements: []
|
247
246
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.7.
|
247
|
+
rubygems_version: 2.7.7
|
249
248
|
signing_key:
|
250
249
|
specification_version: 4
|
251
250
|
summary: Mailgun's Official Ruby SDK
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0-p0
|