ids_please 1.0.5 → 1.0.6

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: d90a0c1c1f2b84eca4ea8e301db99aba0e552cda
4
- data.tar.gz: 667625ed05e41665519c369c5f807d0e4ecff5bf
3
+ metadata.gz: 71c43f0f021c3e31d48e900162f1cdbb0bcb0591
4
+ data.tar.gz: 7feef5dcfdf2a0ff1a5076b5802a1ffcb85bf4fa
5
5
  SHA512:
6
- metadata.gz: f6206c2a0c1346c60ec05a4c71a4724c4b64365aff5b948ff3e619bd0f4e6ae4f581cfc78638aa2dd2c7cd7aa20755eb39af6259c7e25935f9e07f31f1f50342
7
- data.tar.gz: 59f5d650e8d5d7ee31a5e53c56170d3a21e9a7ae98735c431df777456cf2e29fc60156698a00a278845a855fb83cbabc317a9a41b4497240e83cedc579428195
6
+ metadata.gz: 0606463138c74600656f3402032d7322f49ed838eb5e7ecd95345284f72e5f8b6b3595e887b549d5a05deb507bbfe22f658c2916a94560dbb7728f71237ff0ec
7
+ data.tar.gz: 2dc7643226c2792d33a094c165b4101298ce04d23955a353f94c5e7e46ed83754a19bacd79894df0108b09bd7c7123830b7965b847408becb3b14e1f217cc9e8
@@ -8,7 +8,7 @@ class IdsPlease
8
8
  def self.parse(links)
9
9
  links.map do |l|
10
10
  id = parse_link(l)
11
- matched_id = id.match(valid_id_regex)
11
+ matched_id = id.match(valid_id_regex) if id
12
12
  matched_id[1] if matched_id
13
13
  end.compact
14
14
  end
data/lib/ids_please.rb CHANGED
@@ -14,7 +14,7 @@ require_relative 'ids_please/odnoklassniki'
14
14
 
15
15
  class IdsPlease
16
16
 
17
- VERSION = '1.0.5'
17
+ VERSION = '1.0.6'
18
18
 
19
19
  attr_accessor :original, :recognized, :unrecognized, :parsed
20
20
 
@@ -24,12 +24,24 @@ describe IdsPlease do
24
24
  http://vka.com/not_recognized
25
25
  )
26
26
 
27
+ not_parseble_links = %w(
28
+ http://vk.com
29
+ http://soundcloud.com
30
+ )
31
+
27
32
  it 'not recognizes wrong links' do
28
33
  recognizer = IdsPlease.new(*not_recognazible_links)
29
34
  recognizer.recognize
30
35
  expect(recognizer.recognized.values.flatten.count).to eq(0)
31
36
  end
32
37
 
38
+ it 'not parse wrong links' do
39
+ @recognizer = IdsPlease.new(*not_parseble_links)
40
+ @recognizer.parse
41
+ expect(@recognizer.parsed[:vkontakte]).to eq([])
42
+ expect(@recognizer.parsed[:soundcloud]).to eq([])
43
+ end
44
+
33
45
  context 'recognize social networks properly' do
34
46
  before :each do
35
47
  @recognizer = IdsPlease.new(*recognazible_links)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ids_please
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - gazay