emailhunter 0.1.1 → 0.2.0
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/lib/email_hunter/exist.rb +2 -2
 - data/lib/email_hunter/search.rb +5 -5
 - data/lib/email_hunter/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0723ebdc178f2687eee958b64351bc18873f1117
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: deafc609522733f41b57f6439114c12040193335
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: aa49216254af99f397d0a3270f92972ba77788dce568a6f643d519c1c8f25bc0283ef01ae9a2b176cff0791efa1e82da7ecd323be186fa66c9734e840fe18108
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 696e95c127acf06c427f9f3088828393e383cb4c1e0b25cf58d24a42807845103be077734147b891cd83168b9a0bf9fe80f809c0e37a307a52b80c048a9f3c43
         
     | 
    
        data/lib/email_hunter/exist.rb
    CHANGED
    
    | 
         @@ -15,7 +15,7 @@ module EmailHunter 
     | 
|
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                def hunt
         
     | 
| 
       17 
17 
     | 
    
         
             
                  response = apiresponse
         
     | 
| 
       18 
     | 
    
         
            -
                   
     | 
| 
      
 18 
     | 
    
         
            +
                  Struct.new(*response.keys).new(*response.values) unless response.empty?
         
     | 
| 
       19 
19 
     | 
    
         
             
                end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                private
         
     | 
| 
         @@ -23,7 +23,7 @@ module EmailHunter 
     | 
|
| 
       23 
23 
     | 
    
         
             
                def apiresponse
         
     | 
| 
       24 
24 
     | 
    
         
             
                  url = "#{API_EXISTS_URL}email=#{@email}&api_key=#{@key}"
         
     | 
| 
       25 
25 
     | 
    
         
             
                  response = Faraday.get(URI.parse(URI.encode(url)))
         
     | 
| 
       26 
     | 
    
         
            -
                  response.success? ? JSON.parse(response.body) : []
         
     | 
| 
      
 26 
     | 
    
         
            +
                  response.success? ? JSON.parse(response.body, {:symbolize_names => true}) : []
         
     | 
| 
       27 
27 
     | 
    
         
             
                end
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         
             
            end
         
     | 
    
        data/lib/email_hunter/search.rb
    CHANGED
    
    | 
         @@ -8,14 +8,14 @@ module EmailHunter 
     | 
|
| 
       8 
8 
     | 
    
         
             
              class Search
         
     | 
| 
       9 
9 
     | 
    
         
             
                attr_reader :status, :results, :emails
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 11 
     | 
    
         
            +
                def initialize(domain, key)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  @domain = domain
         
     | 
| 
       13 
13 
     | 
    
         
             
                  @key = key
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                def hunt
         
     | 
| 
       17 
17 
     | 
    
         
             
                  response = apiresponse
         
     | 
| 
       18 
     | 
    
         
            -
                   
     | 
| 
      
 18 
     | 
    
         
            +
                  Struct.new(*response.keys).new(*response.values) unless response.empty?
         
     | 
| 
       19 
19 
     | 
    
         
             
                end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                private
         
     | 
| 
         @@ -23,7 +23,7 @@ module EmailHunter 
     | 
|
| 
       23 
23 
     | 
    
         
             
                def apiresponse
         
     | 
| 
       24 
24 
     | 
    
         
             
                  url = "#{API_SEARCH_URL}domain=#{@domain}&api_key=#{@key}"
         
     | 
| 
       25 
25 
     | 
    
         
             
                  response = Faraday.get(URI.parse(URI.encode(url)))
         
     | 
| 
       26 
     | 
    
         
            -
                  response.success? ? JSON.parse(response.body) : []
         
     | 
| 
      
 26 
     | 
    
         
            +
                  response.success? ? JSON.parse(response.body, {:symbolize_names => true}) : []
         
     | 
| 
       27 
27 
     | 
    
         
             
                end
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         
             
            end
         
     | 
    
        data/lib/email_hunter/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: emailhunter
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Davide Santangelo
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015-04 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-05-04 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |