mailgun-ruby 1.1.9 → 1.1.10

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: a161608ec972823219220afcff04f3f8ddf959190ab747a03983ebe108ccaba5
4
- data.tar.gz: 21f81c2a51f0b4e2c18f7ad309cd884561cb60120787d3cbe7140962d5fc717a
3
+ metadata.gz: 2e88262b939edf330c91ac551b2f5945e4f4e5825f734bef28a7455cc2ec2dcc
4
+ data.tar.gz: 4bfffa2ae623704dcef2754a040fccc3a5efbbe8ee6e761e473215fbfcade5b8
5
5
  SHA512:
6
- metadata.gz: d24993f138c611967f0cf77498fedb464858e93afddb7d6e7e1288ca5351aee6902bd7bb4c449a738f55a775f1fd1849aec91323145a068e64b0bca79ca6db1e
7
- data.tar.gz: ea24ee662ee9c4dd91f5b73609cc4ae884c692a4876dfd96c30e4b1fdd18c213d37088db96936d3aba493e5eecf5fad66a73d1eb53fcee9831bfeeca4f6fefa0
6
+ metadata.gz: c8b5a20d3cf98827f101e5e06f563e605a80a626f2d4e5f4147f908d955e13926e3f2995db6bfbeb26b8ff343618104f2d83f298c808416362f4c0cae7a2d9ec
7
+ data.tar.gz: 7bb9a9085b738d2cb0bd8bc57f176928d7eb54bf09a190bfd6fc0d21ae526a0f72b70970c2bd19a9aa899401cc3bce1d591089a14aa7ec324b94758b2ed3caa0
data/README.md CHANGED
@@ -27,7 +27,7 @@ Usage
27
27
  Here's how to send a message using the library:
28
28
 
29
29
  ```ruby
30
- require 'mailgun'
30
+ require 'mailgun-ruby'
31
31
 
32
32
  # First, instantiate the Mailgun Client with your API key
33
33
  mg_client = Mailgun::Client.new 'your-api-key'
@@ -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[/api.mailgun.net\/v[\d]\/#{@domain}\/events\/(.+)/,1]
104
+ URI.parse(url).path[/\/v[\d]\/#{@domain}\/events\/(.+)/,1]
105
105
  rescue URI::InvalidURIError
106
106
  nil
107
107
  end
@@ -1,4 +1,4 @@
1
1
  # It's the version. Yeay!
2
2
  module Mailgun
3
- VERSION = '1.1.9'
3
+ VERSION = '1.1.10'
4
4
  end
@@ -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.9
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-02-09 00:00:00.000000000 Z
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.5
247
+ rubygems_version: 2.7.7
249
248
  signing_key:
250
249
  specification_version: 4
251
250
  summary: Mailgun's Official Ruby SDK
@@ -1 +0,0 @@
1
- 2.0.0-p0