piplapis-ruby 5.0.0 → 5.0.1
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.
- data/lib/pipl/client.rb +1 -1
- data/lib/pipl/containers.rb +4 -1
- data/lib/pipl/fields.rb +11 -3
- data/lib/pipl/version.rb +1 -1
- metadata +2 -2
data/lib/pipl/client.rb
CHANGED
@@ -84,7 +84,7 @@ module Pipl
|
|
84
84
|
|
85
85
|
unless opts.key? :search_pointer
|
86
86
|
unless opts[:person] and opts[:person].is_searchable?
|
87
|
-
raise ArgumentError.new('
|
87
|
+
raise ArgumentError.new('No valid name/username/user_id/phone/email/address or search pointer in request')
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
data/lib/pipl/containers.rb
CHANGED
@@ -279,7 +279,10 @@ module Pipl
|
|
279
279
|
@names.any? { |f| f.is_searchable? } or
|
280
280
|
@emails.any? { |f| f.is_searchable? } or
|
281
281
|
@phones.any? { |f| f.is_searchable? } or
|
282
|
-
@usernames.any? { |f| f.is_searchable? }
|
282
|
+
@usernames.any? { |f| f.is_searchable? } or
|
283
|
+
@user_ids.any? { |f| f.is_searchable? } or
|
284
|
+
@urls.any? { |f| f.is_searchable? } or
|
285
|
+
@addresses.any? { |f| f.is_sole_searchable? }
|
283
286
|
end
|
284
287
|
|
285
288
|
def unsearchable_fields
|
data/lib/pipl/fields.rb
CHANGED
@@ -161,7 +161,11 @@ module Pipl
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def is_searchable?
|
164
|
-
[@raw, @country, @state, @city].any? {|x|
|
164
|
+
[@raw, @country, @state, @city].any? {|x| not x.to_s.empty?}
|
165
|
+
end
|
166
|
+
|
167
|
+
def is_sole_searchable?
|
168
|
+
not @raw.to_s.empty? or [@city, @street, @house].all? {|x| not x.to_s.empty?}
|
165
169
|
end
|
166
170
|
|
167
171
|
def country_full
|
@@ -424,7 +428,7 @@ module Pipl
|
|
424
428
|
end
|
425
429
|
|
426
430
|
def is_searchable?
|
427
|
-
|
431
|
+
!@content.nil? and Pipl::Utils.alnum_chars(@content).length > 3
|
428
432
|
end
|
429
433
|
|
430
434
|
end
|
@@ -433,7 +437,7 @@ module Pipl
|
|
433
437
|
class UserID < Username
|
434
438
|
|
435
439
|
def is_searchable?
|
436
|
-
|
440
|
+
not /.+@.+/.match(@content).nil?
|
437
441
|
end
|
438
442
|
|
439
443
|
end
|
@@ -554,6 +558,10 @@ module Pipl
|
|
554
558
|
[:category, :domain, :name, :sponsored, :source_id]
|
555
559
|
end
|
556
560
|
|
561
|
+
def is_searchable?
|
562
|
+
not @url.to_s.empty?
|
563
|
+
end
|
564
|
+
|
557
565
|
end
|
558
566
|
|
559
567
|
|
data/lib/pipl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piplapis-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|