trumail 1.0.0 → 2.0.0

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: 5ea910267c19a5d195fa269fdf4df36df2ede91e893d96084f66b02c237f54f8
4
- data.tar.gz: d1daf5f157d96a9639ef5fddf52f61c356c536c445dd2dc48cebdc557fc4cda4
3
+ metadata.gz: bc7bb7a2b7c657af3c267c2988b8846a73f4f4304727322f6c00a259861f88eb
4
+ data.tar.gz: e1215fdc190b1fc949ee59a4089d1d92a051e86ee946d0486907c38090175d3f
5
5
  SHA512:
6
- metadata.gz: c8015857d5bbe7bfd787625b045cc6db8e183f8fe32cc0cf41120cc8732ad10a0e36605913c868d4b24e0e061d1038de6f1904177845c52337c6821b3ee8b296
7
- data.tar.gz: d9bba6b44ec6ffa79b38f5a388d9fbe10f2cd9ca364e3278eb47103d50b98a8708dbfb1895a38247cc1c02a7947a33f1af34133b5a6f93d9e4360dd4a09116d1
6
+ metadata.gz: 84d1c76e6601452c0ec763a9768ed64caec5361e04f950db2d72d6a20e3ca24f684234290eaa06245c8f98f358e28d20a2800769d31ba6ef0a88c600b77fa3c0
7
+ data.tar.gz: d789e279171104499f720bf09ad6463c9fdd3865516cc8cb07c96dcd85af607305c986a22c6d44ec49b332dadd359011f7ed6560d1dfe7a5b4b14739cd947658
data/README.md CHANGED
@@ -31,26 +31,30 @@ lookup = Trumail::Lookup.new('test@email.com').verify
31
31
  lookup = Trumail::Lookup.verify('test@email.com')
32
32
 
33
33
  # Custom Host
34
- lookup = Trumail::Lookup.verify('test@email.com', host: 'https://verifier.com',
35
- format: :xml)
34
+ lookup = Trumail::Lookup.verify('test@email.com', host: 'https://verifier.com', format: :xml)
36
35
  ```
37
36
 
38
37
  ### Lookup Methods
39
38
 
40
39
  ```ruby
41
- lookup.url => 'https://trumail.io/json/test@email.com'
42
- lookup.hash => { 'address' => 'test@email.com', 'catchAll' => true, ... }
40
+ lookup.url => 'https://api.trumail.io/v2/lookup/json?email=test@email.com'
41
+ lookup.hash => { 'address' => 'test@email.com', 'catchAll' => true, ... }
43
42
 
44
43
  # Data Methods
45
- lookup.address => 'test@email.com'
46
- lookup.username => 'test'
47
- lookup.domain => 'email.com'
48
- lookup.catch_all? => true
49
- lookup.deliverable? => false
50
- lookup.disposable? => true
51
- lookup.full_inbox? => false
52
- lookup.gravatar? => true
53
- lookup.host_exists? => false
44
+ lookup.address => 'test@email.com'
45
+ lookup.username => 'test'
46
+ lookup.domain => 'email.com'
47
+ lookup.md5_hash => '0065537cb732045561c0d23e859710f4'
48
+ lookup.suggestion => ''
49
+ lookup.catch_all? => true
50
+ lookup.deliverable? => false
51
+ lookup.disposable? => true
52
+ lookup.free? => true
53
+ lookup.full_inbox? => false
54
+ lookup.gravatar? => true
55
+ lookup.host_exists? => false
56
+ lookup.role? => false
57
+ lookup.valid_format? => true
54
58
  ```
55
59
 
56
60
  ## Contributing
@@ -6,7 +6,7 @@ require 'user_agent_db'
6
6
  module Trumail
7
7
  class Lookup
8
8
 
9
- DEFAULT_HOST ||= 'https://trumail.io'
9
+ DEFAULT_HOST ||= 'https://api.trumail.io'
10
10
  DEFAULT_FORMAT ||= :json
11
11
 
12
12
  attr_reader :email, :hash, :host, :format, :response
@@ -35,7 +35,7 @@ module Trumail
35
35
  end
36
36
 
37
37
  def url
38
- "#{@host}/#{@format}/#{@email}"
38
+ "#{@host}/v2/lookups/#{@format}?email=#{@email}"
39
39
  end
40
40
 
41
41
  def address
@@ -58,6 +58,10 @@ module Trumail
58
58
  @hash['domain']
59
59
  end
60
60
 
61
+ def free?
62
+ @hash['free']
63
+ end
64
+
61
65
  def full_inbox?
62
66
  @hash['fullInbox']
63
67
  end
@@ -70,10 +74,26 @@ module Trumail
70
74
  @hash['hostExists']
71
75
  end
72
76
 
77
+ def md5_hash
78
+ @hash['md5Hash']
79
+ end
80
+
81
+ def role?
82
+ @hash['role']
83
+ end
84
+
85
+ def suggestion
86
+ @hash['suggestion']
87
+ end
88
+
73
89
  def username
74
90
  @hash['username']
75
91
  end
76
92
 
93
+ def valid_format?
94
+ @hash['validFormat']
95
+ end
96
+
77
97
  private
78
98
 
79
99
  def parse_by_format
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Trumail
4
- VERSION ||= '1.0.0'
4
+ VERSION ||= '2.0.0'
5
5
  end
@@ -32,4 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'fasterer'
33
33
  spec.add_development_dependency 'reek'
34
34
  spec.add_development_dependency 'rubocop'
35
+ spec.add_development_dependency 'vcr'
36
+ spec.add_development_dependency 'webmock'
35
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trumail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2018-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ox
@@ -136,6 +136,34 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: vcr
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: webmock
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
139
167
  description: Trumail Ruby SDK for interacting with the Trumail API.
140
168
  email:
141
169
  - j.gomez@drexed.com
@@ -184,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
212
  version: '0'
185
213
  requirements: []
186
214
  rubyforge_project:
187
- rubygems_version: 2.7.2
215
+ rubygems_version: 2.7.7
188
216
  signing_key:
189
217
  specification_version: 4
190
218
  summary: Trumail Ruby SDK.