legitbot 0.2.3 → 0.2.4

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: c83907c63ca1e3b12ebe1479a2329549d66f259912ac6f481e09c1faceba2200
4
- data.tar.gz: f04afcf8f277cfca0be564ec4c5e26937867ea3472623953f7e67c797bd60888
3
+ metadata.gz: bd30bde22fd8379ba4f81c816b37dc6b1ba428e65a4d559df5c930cbb464f582
4
+ data.tar.gz: f82f9f393980056a5c3a022f63b48a7344183307d7c7fb0fe5b89ad0e12ca135
5
5
  SHA512:
6
- metadata.gz: b44c6c4403472ab5999c3d565cd85d9914dc61f88ec99041c8f92d41a560a4c47fa701791a2ea5d3e2444fbb3a6e5f192af771a56781567ecda540c7dbc58aa5
7
- data.tar.gz: fbd8d5567bbaf7dbee169230727d7a100d87df92d214a12b1d5af3ab57bc2d99cf5f5e0790d40dfb02359d9cccf31268d904d86bb479074c82a63a119398dd84
6
+ metadata.gz: 2964ab88011ea1daac0c1b656d6e4d50ca9a91f927bb7ce8255c6db873f5db193ff797764b81d695df5dcdd11ad3b2785ef9ec746fbb1475300bc68aed0270cc
7
+ data.tar.gz: 20efd5d2e5f062ab1f4afd0844aa9713a5bb28afaea3647c299b8ae3bce1e0b89fe4e8450157ff1dc259cc1a6e4e86d9a8028a6dd2a0059ea3ddffd8ccd13186
@@ -36,5 +36,5 @@ module Legitbot
36
36
  end
37
37
  end
38
38
 
39
- rule Legitbot::Facebook, %w(facebookhit facebookexternalhit)
39
+ rule Legitbot::Facebook, %w(Facebot facebookexternalhit/1.1)
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Legitbot
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
@@ -15,8 +15,19 @@ class FacebookTest < Minitest::Test
15
15
  end
16
16
 
17
17
  def test_user_agent
18
- bot = Legitbot.bot("facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)", "31.13.76.56")
19
- assert_equal :facebook, bot.detected_as
20
- assert bot.valid?, msg: "A valid Facebook User-agent and IP"
18
+ Legitbot.bot("facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)", "31.13.76.56") do |bot|
19
+ assert_equal :facebook, bot.detected_as
20
+ assert bot.valid?, msg: "true Facebook"
21
+ end
22
+
23
+ Legitbot.bot("facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)", "173.252.87.8") do |bot|
24
+ assert_equal :facebook, bot.detected_as
25
+ assert bot.valid?, msg: "true Facebook"
26
+ end
27
+
28
+ Legitbot.bot("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0", "92.243.181.7") do |bot|
29
+ assert_equal :facebook, bot.detected_as
30
+ assert bot.fake?, msg: "fake Facebook"
31
+ end
21
32
  end
22
33
  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.3
4
+ version: 0.2.4
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-26 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irrc