possible_email 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: e7c59b28497e97a707ccef97030b2ba5c71f5902
4
- data.tar.gz: 7545a313b3364563cbad881f5bc3620ecaaccb7c
3
+ metadata.gz: bc5af4d8fea319c631c48a70eabb832ccab5e925
4
+ data.tar.gz: ab381913a95f1c02a7fb5b356301a82efad60c12
5
5
  SHA512:
6
- metadata.gz: d4a1ecc7e3e67f6ffa3b35a2b424319877a61e9bfde31b3907769a860412f2de3f4a12065be4e952b9fb26a4bbfc5524a1e8301a4b22ae14459adfea05145d1a
7
- data.tar.gz: 2c4657ce20186cf5d03416e02347257af0b127b2d49aa5015280233c65a4c9dedd8bffc420ddf7638bc21e2b746058810929834f37a6ce7991f48d2231e23d11
6
+ metadata.gz: 9473bfab7f5c60a28eb333988a5f08c90be350e8b7f088de7f39d2b3637aae8c69220a1b3c5cc181050f6c3b4a293cb0a3653ffc125be90a7c96d13c78c46d1c
7
+ data.tar.gz: 3bd64db4e1d5658c6c16f9305571f9b122816e0e6c3d131a0b3a1f1f539c2555a9b31167ed8849d318eeb7641acee4611c30c61b4bc4bbc88fd3c4a8e0530ea7
@@ -4,8 +4,6 @@ require 'possible_email/profile/image'
4
4
  require 'possible_email/profile/phone'
5
5
 
6
6
  module PossibleEmail
7
- class NoDataError < ArgumentError; end
8
-
9
7
  class Profile
10
8
  attr_reader :data, :email, :name, :first_name, :last_name, :friendly_name,
11
9
  :location, :headline, :success, :occupations, :memberships,
@@ -14,8 +12,6 @@ module PossibleEmail
14
12
  def initialize(data)
15
13
  @data = data
16
14
 
17
- fail NoDataError, 'Data given was empty' if @data.empty?
18
-
19
15
  retrieve_attribute
20
16
  retrieve_attribute_collection
21
17
  end
@@ -43,7 +43,7 @@ module PossibleEmail
43
43
  end
44
44
 
45
45
  def useful_response?(response)
46
- response['success'] != 'nothing_useful'
46
+ response['contact'] && response['success'] != 'nothing_useful' && response['status'] != 403
47
47
  end
48
48
  end
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module PossibleEmail
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -4,10 +4,6 @@ describe PossibleEmail::Profile do
4
4
  let(:data) { JSON.parse(File.read(File.expand_path('spec/fixtures/rapportive_example_data.json'))) }
5
5
  let(:profile) { PossibleEmail::Profile.new(data) }
6
6
 
7
- it 'returns an error if no data is given' do
8
- expect { PossibleEmail::Profile.new({}) }.to raise_error(PossibleEmail::NoDataError)
9
- end
10
-
11
7
  describe '#attributes' do
12
8
  it 'returns a list of available' do
13
9
  expect(profile.attributes).to eq(["email", "name", "first_name", "last_name", "friendly_name", "location", "headline", "success", "occupations", "memberships", "images", "phones"])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: possible_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Perey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-16 00:00:00.000000000 Z
11
+ date: 2014-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpi