legitbot 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d526ed7ca64658503c66d7c291c8a24f5a9f8fdecb47899eca06d4135ccf4165
4
- data.tar.gz: 9ba9bc7cebe5137e5a018366ccc63f869864f264b8a4988e4f971b0399d6bf39
3
+ metadata.gz: c83907c63ca1e3b12ebe1479a2329549d66f259912ac6f481e09c1faceba2200
4
+ data.tar.gz: f04afcf8f277cfca0be564ec4c5e26937867ea3472623953f7e67c797bd60888
5
5
  SHA512:
6
- metadata.gz: dc2814147aa8a02dc14ca39831b62ce5dab4d6506e4c7868d9b1938747858c09dd303e3ff955183dff853fdbb4d2f5e7469e6b433af71191ffb519c9cce403a9
7
- data.tar.gz: 9b523df0e7d980cc4002197e63d9b76c95b7ed06504a431b2a7dcc3a61a0d126a786996e7e4031727aec92fbba726ff7e507d4d99e8e121780ce822c12706d99
6
+ metadata.gz: b44c6c4403472ab5999c3d565cd85d9914dc61f88ec99041c8f92d41a560a4c47fa701791a2ea5d3e2444fbb3a6e5f192af771a56781567ecda540c7dbc58aa5
7
+ data.tar.gz: fbd8d5567bbaf7dbee169230727d7a100d87df92d214a12b1d5af3ab57bc2d99cf5f5e0790d40dfb02359d9cccf31268d904d86bb479074c82a63a119398dd84
@@ -19,7 +19,7 @@ module Legitbot
19
19
  }
20
20
 
21
21
  selected = bots.select { |b| b.valid? }.first if bots.size > 1
22
- selected = bots.first if selected.nil?
22
+ selected = bots.last if selected.nil?
23
23
 
24
24
  if selected && block_given?
25
25
  yield selected
@@ -1,3 +1,3 @@
1
1
  module Legitbot
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  module Legitbot
2
- # https://yandex.com/support/webmaster/robot-workings/check-yandex-robots.xml
2
+ # https://yandex.com/support/webmaster/robot-workings/check-yandex-robots.html
3
3
 
4
4
  class Yandex < BotMatch
5
5
  ValidDomains = ["yandex.ru.", "yandex.net.", "yandex.com."]
@@ -9,8 +9,9 @@ module Legitbot
9
9
  end
10
10
  end
11
11
 
12
- rule Legitbot::Yandex, %w(YandexBot YandexMobileBot YandexImages YandexVideo
12
+ rule Legitbot::Yandex, %w(YandexBot YandexAccessibilityBot YandexMobileBot
13
+ YandexDirectDyn YandexScreenshotBot YandexImages YandexVideo YandexVideoParser
13
14
  YandexMedia YandexBlogs YandexFavicons YandexWebmaster YandexPagechecker
14
- YandexImageResizer YandexSitelinks YandexMetrika YandexDirectDyn YandexRCA
15
- YaDirectFetcher YandexAntivirus YandexVertis YandexCalendar)
15
+ YandexImageResizer YaDirectFetcher YandexCalendar YandexSitelinks YandexMetrika
16
+ YandexNews YandexVertis YandexSearchShop YandexVerticals)
16
17
  end
data/test/google_test.rb CHANGED
@@ -30,8 +30,13 @@ class GoogleTest < Minitest::Test
30
30
  assert bot.valid?, msg: "Valid Googlebot"
31
31
  end
32
32
 
33
- def test_engine_name
33
+ def test_valid_name
34
34
  bot = Legitbot.bot("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", "66.249.64.141")
35
35
  assert_equal :google, bot.detected_as
36
36
  end
37
+
38
+ def test_fake_name
39
+ bot = Legitbot.bot("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", "81.1.172.108")
40
+ assert_equal :google, bot.detected_as
41
+ end
37
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legitbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Azarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-25 00:00:00.000000000 Z
11
+ date: 2018-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irrc