browser 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -3
- data/CHANGELOG.md +22 -5
- data/Rakefile +0 -1
- data/bots.yml +18 -0
- data/gemfiles/rails5.gemfile +4 -0
- data/lib/browser/accept_language.rb +8 -2
- data/lib/browser/rails.rb +7 -3
- data/lib/browser/version.rb +1 -1
- data/test/ua_bots.yml +18 -0
- data/test/unit/accept_language_test.rb +8 -0
- data/test/unit/bots_test.rb +9 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 293548a9eea57000babf98f31dd4fbb5652886d9af4d0fea9be163e58d041c10
|
4
|
+
data.tar.gz: 0e5c8ae27a8b45b751c1b8c2a40aa0daf37a6a7c6547621a2dee348a6f207216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 708cd426295863ce846e4b7934ac6fa7d2716c3a0e2bf136dab0f4f79dde7648a3a41ad2dca3565bde09abe0658b08e2b5dce184d371a449f9ecbceb7a152629
|
7
|
+
data.tar.gz: 2d6c9699c81fe9bd5be50089682524c12076b3962bcc2936d9592fd93d5c4cb467dcd8ece8c78cd9252bc3395884b8b3bace3daedfdfa8742a74c51b2b280a92
|
data/.travis.yml
CHANGED
@@ -2,12 +2,12 @@ language: ruby
|
|
2
2
|
sudo: false
|
3
3
|
cache: bundler
|
4
4
|
rvm:
|
5
|
-
- '2.4.
|
6
|
-
- '2.3.
|
7
|
-
- '2.2.7'
|
5
|
+
- '2.4.2'
|
6
|
+
- '2.3.5'
|
8
7
|
gemfile:
|
9
8
|
- Gemfile
|
10
9
|
- gemfiles/rails4.gemfile
|
10
|
+
- gemfiles/rails5.gemfile
|
11
11
|
script: bundle exec rake
|
12
12
|
notifications:
|
13
13
|
email: false
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,31 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v2.5.3
|
4
|
+
|
5
|
+
- Add Google Site Verification to the bot list.
|
6
|
+
- Handle invalid quality values that look like numbers.
|
7
|
+
- Add Barkrowler bot.
|
8
|
+
- Add AlwaysOnline bot: CloudFlare.
|
9
|
+
- Add News aggregator crawler: AndersPink, BuzzBot.
|
10
|
+
- Add Domain crawler: CipaCrawler.
|
11
|
+
- Add Job bot: JobSeeker's.
|
12
|
+
- Add Apparel crawler: TeeRaid.
|
13
|
+
- Add Search engine crawler: SemanticBot, Mappy.
|
14
|
+
- Add Copyright crawler: Copypants' BotPants.
|
15
|
+
- Add SEO bots: SEOdiver, SeoAudit, WebCeo.
|
16
|
+
- Add Woriobot from Zite.
|
17
|
+
- Add BUbiNG bot.
|
18
|
+
- Add Paessler bot.
|
19
|
+
|
3
20
|
## v2.5.2
|
4
21
|
|
5
|
-
- Add COMODO SSL Checker bot
|
6
|
-
- Add Swiftype bot
|
7
|
-
- Add WhatsApp detection
|
22
|
+
- Add COMODO SSL Checker bot.
|
23
|
+
- Add Swiftype bot.
|
24
|
+
- Add WhatsApp detection.
|
8
25
|
|
9
26
|
## v2.5.1
|
10
27
|
|
11
|
-
- Add Android Oreo detection
|
28
|
+
- Add Android Oreo detection.
|
12
29
|
|
13
30
|
## v2.5.0
|
14
31
|
|
@@ -74,4 +91,4 @@
|
|
74
91
|
- `Browser#bot` now returns a `Browser::Bot` instance.
|
75
92
|
- Safari running as web app mode is not recognized as Safari anymore.
|
76
93
|
- ruby-2.3+ will always activate frozen strings.
|
77
|
-
- [List of all commits since last release](https://github.com/fnando/browser/compare/v1.1.0...v2.0.0)
|
94
|
+
- [List of all commits since last release](https://github.com/fnando/browser/compare/v1.1.0...v2.0.0).
|
data/Rakefile
CHANGED
data/bots.yml
CHANGED
@@ -8,6 +8,7 @@ adsbot-google: "Google Adwords"
|
|
8
8
|
advbot: "AdvBot"
|
9
9
|
ahrefsbot: "Ahrefs backlinks research tool"
|
10
10
|
alexa: "Alexa Crawler"
|
11
|
+
anderspink: "AndersPinkBot"
|
11
12
|
apache-httpclient: "Java http library"
|
12
13
|
apachebench: "ApacheBench (ab)"
|
13
14
|
apis-google: APIs-Google
|
@@ -18,6 +19,7 @@ ask jeeves: "Ask Jeeves"
|
|
18
19
|
asynchttpclient: "Java http and WebSocket client library"
|
19
20
|
awe.sm: "Awe.sm URL expander"
|
20
21
|
baidu: "Baidu"
|
22
|
+
barkrowler: "Barkrowler"
|
21
23
|
bdcbot: "Big Data Corp"
|
22
24
|
bingbot: "Microsoft Bing"
|
23
25
|
bingpreview: "Microsoft Bing preview"
|
@@ -25,18 +27,23 @@ bitlybot: "bit.ly bot"
|
|
25
27
|
blekkobot: "Blekkobot"
|
26
28
|
blexbot: "BLEXBot (webmeup)"
|
27
29
|
bot@linkfluence.net: "Linkfluence bot"
|
30
|
+
bubing: "BUbiNG"
|
28
31
|
bufferbot: "BufferBot"
|
29
32
|
buibui-checkbot: "buibui"
|
30
33
|
butterfly: "Topsy Labs"
|
34
|
+
buzzbot: "Buzzbot"
|
31
35
|
buzztalk: "buzztalk"
|
32
36
|
catchbot: "CatchBot (catchbot.com)"
|
33
37
|
check_http: "Nagios monitor"
|
38
|
+
cipacrawler: "CipaCrawler"
|
34
39
|
cliqzbot: "Cliqzbot"
|
40
|
+
cloudflare: "CloudFlare-AlwaysOnline"
|
35
41
|
cmradar/0.1: "CMRadar/0.1"
|
36
42
|
coldfusion: "ColdFusion http library"
|
37
43
|
commoncrawl: "CCBot"
|
38
44
|
comodo ssl checker: 'COMODO SSL Checker'
|
39
45
|
comodo-webinspector-crawler: "Comodo"
|
46
|
+
copypants: "BotPants"
|
40
47
|
crowsnest: "Crowsnest"
|
41
48
|
curabot: "cura.yt"
|
42
49
|
curl: "curl unix CLI http client"
|
@@ -74,6 +81,7 @@ gimmeusabot: "Gimme60 (gimme60.com)"
|
|
74
81
|
go http package: "Go http library"
|
75
82
|
google page speed insights: "Google Page Speed Insights"
|
76
83
|
google Web Preview: "Google Instant Previews crawler"
|
84
|
+
google-site-verification: Google-Site-Verification
|
77
85
|
google-structured-data-testing-tool: "Google-StructuredDataTestingTool"
|
78
86
|
google-structureddatatestingtool: "Google-StructuredDataTestingTool"
|
79
87
|
googlebot: "Google Bot"
|
@@ -99,6 +107,7 @@ jack: "jack"
|
|
99
107
|
jakarta commons: "Jakarta Commons HttpClient"
|
100
108
|
java: "Generic Java http library"
|
101
109
|
jetslide: "Jetslide"
|
110
|
+
jobseeker: "jobseeker.com.au/bot.html"
|
102
111
|
js-kit: "URL resolver"
|
103
112
|
kemvibot: "Kemvi"
|
104
113
|
kimengi: "Kimengi Bot"
|
@@ -122,6 +131,7 @@ lumibot: "Lumibot"
|
|
122
131
|
lwp-trivial: "Another Perl library"
|
123
132
|
magpie-crawler: "magpie-crawler"
|
124
133
|
mail.ru_bot: "Mail.ru Bot"
|
134
|
+
mappydata: "Mappy"
|
125
135
|
meanpathbot: "meanpath"
|
126
136
|
mediapartners-google: "Google Adsense bot"
|
127
137
|
megaindex.ru: "MegaIndex"
|
@@ -148,6 +158,7 @@ ning: "NING - Yet Another Twitter Swarmer"
|
|
148
158
|
nutch: "Apache search spider"
|
149
159
|
openhosebot: "OpenHoseBot"
|
150
160
|
orangebot: "OrangeBot"
|
161
|
+
paessler: "paessler.com - PRTG Network Monitor"
|
151
162
|
pagesinventory: "pagesinventory.com"
|
152
163
|
panopta: "Monitoring service"
|
153
164
|
paperlibot: "PaperLi"
|
@@ -180,7 +191,10 @@ ruby: "Ruby"
|
|
180
191
|
scrapy: "Scrapy"
|
181
192
|
screaming frog seo spider: Screaming Frog SEO Spider
|
182
193
|
searchmetricsbot: "SearchmetricsBot"
|
194
|
+
semanticbot: "Semanticbot"
|
183
195
|
semrushbot: "SEO analysis bot"
|
196
|
+
seo-audit: "seo-audit-check-bot"
|
197
|
+
seodiver: "SEOdiver"
|
184
198
|
seokicks: "SEOKicks"
|
185
199
|
seznambot: "SeznamBot"
|
186
200
|
shopwiki: "ShopWiki"
|
@@ -203,6 +217,7 @@ squider: "Squider"
|
|
203
217
|
statuscake: "StatusCake"
|
204
218
|
stripe: "Stripe"
|
205
219
|
swiftbot: "Swiftype Bot"
|
220
|
+
teeraid: "TeeRaidBot"
|
206
221
|
test certificate info: "C http library?"
|
207
222
|
tineye: "TinEye Bot"
|
208
223
|
traackr: "Traackr Bot"
|
@@ -228,11 +243,13 @@ vrcrawler: "Venture Radar"
|
|
228
243
|
wasalive-bot: "Wasalive Bots"
|
229
244
|
watchsumo: "WatchSumo"
|
230
245
|
wbsearchbot: "Ware Bay Best Buys"
|
246
|
+
webceo: "online-webceo-bot"
|
231
247
|
webscout: "Webscout"
|
232
248
|
wesee: "WeSEE"
|
233
249
|
wget: "wget unix CLI http client"
|
234
250
|
whatsapp: "WhatsApp"
|
235
251
|
wordpress: "WordPress spider"
|
252
|
+
woriobot: "woriobot"
|
236
253
|
wormly: "WormlyBot"
|
237
254
|
wotbox: "Wotbox"
|
238
255
|
xenu link sleuth: "Xenu Link Sleuth"
|
@@ -241,6 +258,7 @@ xovibot: "XoviBot"
|
|
241
258
|
yacybot: "YaCy"
|
242
259
|
yahoo-ad-monitoring: "Yahoo Ad monitoring"
|
243
260
|
yandex: "Yandex"
|
261
|
+
yanga: "Yanga WorldSearch Bot"
|
244
262
|
yeti: "Naver Corp"
|
245
263
|
yourls: "YOURLS"
|
246
264
|
zelist.ro: "feed parser"
|
@@ -47,14 +47,20 @@ module Browser
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def quality
|
50
|
-
@quality ||=
|
50
|
+
@quality ||= begin
|
51
|
+
Float(quality_value || 1.0)
|
52
|
+
rescue ArgumentError
|
53
|
+
0.1
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
57
|
private
|
54
58
|
|
55
59
|
def quality_value
|
56
60
|
qvalue = part[/;q=([\d.]+)/, 1]
|
57
|
-
qvalue =~ /\A0\.0?\z/ ? "0.0" : qvalue
|
61
|
+
qvalue = qvalue =~ /\A0\.0?\z/ ? "0.0" : qvalue
|
62
|
+
qvalue = qvalue.gsub(/\.+/, ".") if qvalue
|
63
|
+
qvalue
|
58
64
|
end
|
59
65
|
end
|
60
66
|
end
|
data/lib/browser/rails.rb
CHANGED
@@ -9,9 +9,13 @@ module Browser
|
|
9
9
|
config.browser = ActiveSupport::OrderedOptions.new
|
10
10
|
|
11
11
|
initializer "browser" do
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
ActiveSupport.on_load(:action_controller) do
|
13
|
+
::ActionController::Base.send :include, Browser::ActionController
|
14
|
+
Browser::Middleware::Context.send(
|
15
|
+
:include,
|
16
|
+
Browser::Middleware::Context::Additions
|
17
|
+
)
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
data/lib/browser/version.rb
CHANGED
data/test/ua_bots.yml
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
ADLXBOT: 'Mozilla/5.0 (compatible; adidxbot/2.0; +http://www.bing.com/bingbot.htm)'
|
2
|
+
ANDERSPINK: 'Mozilla/5.0 (compatible; AndersPinkBot/1.0; +http://anderspink.com/bot.html)'
|
2
3
|
APIS_GOOGLE: 'APIs-Google; (+https://developers.google.com/webmasters/APIs-Google.html)'
|
3
4
|
APPLE_BOT: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 (Applebot/0.1)'
|
4
5
|
ASK: 'Mozilla/2.0 (compatible; Ask Jeeves/Teoma; +http://sp.ask.com/docs/about/tech_crawling.html)'
|
5
6
|
AWS_ELB: ELB-HealthChecker/1.0
|
6
7
|
BAIDU: 'Baiduspider+(+http://www.baidu.com/search/spider.htm)'
|
8
|
+
BARKROWLER: 'Barkrowler/0.7 (+http://www.exensa.com/crawl)'
|
7
9
|
BINGBOT: 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'
|
8
10
|
BINGPREVIEW: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko) BingPreview/1.0b'
|
11
|
+
BUBING: 'BUbiNG (+http://law.di.unimi.it/BUbiNG.html)'
|
12
|
+
BUZZBOT: 'Buzzbot/1.0 (Buzzbot; http://www.buzzstream.com; buzzbot@buzzstream.com)'
|
13
|
+
CIPACRAWLER: 'CipaCrawler/3.0 (info@domaincrawler.com; http://www.domaincrawler.com/www.example.com)'
|
14
|
+
CLOUDFLARE: "Mozilla/5.0 (compatible; CloudFlare-AlwaysOnline/1.0; +http://www.cloudflare.com/always-online) AppleWebKit/534.34"
|
9
15
|
COMMONCRAWL: 'CCBot/2.0 (http://commoncrawl.org/faq/)'
|
10
16
|
COMODO_SSL_CHECKER: 'COMODO SSL Checker'
|
17
|
+
COPYPANTS: 'Mozilla/5.0 (compatible; BotPants/1.0; Linux; +info@copypants.com) KHTML/3.5.5 (like Gecko)'
|
11
18
|
DAUMOA: Mozilla/5.0 (compatible; MSIE or Firefox mutant; not on Windows server;) Daumoa 4.0
|
12
19
|
DOMAINAREANIMATOR: 'Domain Re-Animator Bot (http://domainreanimator.com) - support@domainreanimator.com'
|
13
20
|
DOT_BOT: 'Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)'
|
@@ -15,14 +22,17 @@ DUCKDUCKGO: 'DuckDuckBot/1.0; (+http://duckduckgo.com/duckduckbot.html)'
|
|
15
22
|
FACEBOOK_BOT: 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)'
|
16
23
|
GOOGLE_BOT: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
|
17
24
|
GOOGLE_PAGE_SPEED_INSIGHTS: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko; Google Page Speed Insights) Chrome/22.0.1229 Safari/537.4'
|
25
|
+
GOOGLE_SITE_VERIFICATION: Mozilla/5.0 (compatible; Google-Site-Verification/1.0)
|
18
26
|
GOOGLE_STACKDRIVER_UPTIME_CHECKS: 'GoogleStackdriverMonitoring-UptimeChecks'
|
19
27
|
GOOGLE_STRUCTURED_DATA_TESTING_TOOL2: 'Mozilla/5.0 (compatible; Google-Structured-Data-Testing-Tool +http://developers.google.com/structured-data/testing-tool/)'
|
20
28
|
GOOGLE_STRUCTURED_DATA_TESTING_TOOL: 'Mozilla/5.0 (compatible; X11; Linux x86_64; Google-StructuredDataTestingTool; +http://www.google.com/webmasters/tools/richsnippets)'
|
21
29
|
GRAPESHOT: 'Mozilla/5.0 (compatible; GrapeshotCrawler/2.0; +http://www.grapeshot.co.uk/crawler.php)'
|
30
|
+
JOBSEEKER: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) JobBot/5.0 (compatible; +http://www.jobseeker.com.au/bot.html) Safari/538.1'
|
22
31
|
LINKDEXBOT: 'Mozilla/5.0 (compatible; linkdexbot/2.0; +http://www.linkdex.com/bots/)'
|
23
32
|
LOAD_TIME_BOT: 'Mozilla/5.0 (compatible; LoadTimeBot/0.9; +http://www.loadtime.net/bot.html)'
|
24
33
|
LTX71: 'ltx71 - (http://ltx71.com/)'
|
25
34
|
MAIL_RU: 'Mozilla/5.0 (compatible; Linux x86_64; Mail.RU_Bot/2.0; +http://go.mail.ru/help/robots)'
|
35
|
+
MAPPYDATA: 'Mozilla/5.0 (compatible; Mappy/1.0; +http://mappydata.net/bot/)'
|
26
36
|
MEGAINDEX_RU: 'Mozilla/5.0 (compatible; MegaIndex.ru/2.0; +https://www.megaindex.ru/?tab=linkAnalyze)'
|
27
37
|
MRCHROME: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.107 Amigo/45.0.2454.107 MRCHROME SOC Safari/537.36'
|
28
38
|
MSNBOT: 'msnbot/2.0b (+http://search.msn.com/msnbot.htm)'
|
@@ -30,21 +40,29 @@ MSNBOT_MEDIA: 'msnbot-media/1.1 (+http://search.msn.com/msnbot.htm)'
|
|
30
40
|
NETCRAFT2: Netcraft SSL Server Survey - contact info@netcraft.com
|
31
41
|
NETCRAFT: Mozilla/5.0 (compatible; NetcraftSurveyAgent/1.0; +info@netcraft.com)
|
32
42
|
NEWRELICPINGER: NewRelicPinger/1.0 (12345)
|
43
|
+
PAESSLER: Mozilla/5.0 (compatible; PRTG Network Monitor (www.paessler.com); Windows)
|
33
44
|
PRIVACYAWAREBOT: 'Mozilla/5.0 (compatible; PrivacyAwareBot/1.1; +http://www.privacyaware.org)'
|
34
45
|
PROXIMIC: 'Mozilla/5.0 (compatible; proximic; +http://www.proximic.com/info/spider.php)'
|
35
46
|
QUERYSEEKER: 'QuerySeekerSpider ( http://queryseeker.com/bot.html )'
|
36
47
|
SCRAPY: 'Scrapy/0.18.4 (+http://scrapy.org)'
|
48
|
+
SEMANTICBOT: 'Mozilla/5.0 (compatible; Semanticbot/1.0; +http://sempi.tech/bot.html)'
|
49
|
+
SEO_AUDIT: 'Mozilla/5.0 (compatible; seo-audit-check-bot/1.0)'
|
50
|
+
SEODIVER: 'Mozilla/5.0 (compatible; SEOdiver/1.0; +http://www.seodiver.com/bot)'
|
37
51
|
SEOKICKS: 'Mozilla/5.0 (compatible; SEOkicks-Robot; +http://www.seokicks.de/robot.html)'
|
38
52
|
SISTRIX: 'Mozilla/5.0 (compatible; SISTRIX Crawler; http://crawler.sistrix.net/)'
|
39
53
|
SOCIALRANKIO: SocialRankIOBot; http://socialrank.io/about
|
40
54
|
SQUIDER: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Squider/0.01'
|
41
55
|
STRIPE: 'Stripe/1.0 (+https://stripe.com/docs/webhooks)'
|
42
56
|
SWIFTYPE: 'Swiftbot'
|
57
|
+
TEERAID: 'Mozilla/5.0 (compatible; TeeRaidBot; +https://teeraid.com/bot/)'
|
43
58
|
TINEYE: 'TinEye-bot/0.51 (see http://www.tineye.com/crawler.html)'
|
44
59
|
TRAACKR: 'Traackr.com'
|
45
60
|
WATCHSUMO: 'Mozilla/5.0 (compatible) WatchSumo/1.0.0 (http://www.watchsumo.com)'
|
61
|
+
WEBCEO: 'Mozilla/5.0 (compatible; online-webceo-bot/1.0; +http://online.webceo.com)'
|
46
62
|
WHATSAPP: 'WhatsApp/2.17.38 Mozilla/5.0 (Linux; U; Android 6.1; en-us; DV Build/Donut) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36'
|
63
|
+
WORIOBOT: 'Mozilla/5.0 (compatible; woriobot +http://worio.com)'
|
47
64
|
YAHOO_AD_MONITORING: 'Mozilla/5.0 (compatible; Yahoo Ad monitoring; https://help.yahoo.com/kb/yahoo-ad-monitoring-SLN24857.html)'
|
48
65
|
YAHOO_SLURP: 'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)'
|
49
66
|
YANDEX_DIRECT: 'Mozilla/5.0 (compatible; YandexDirect/3.0; +http://yandex.com/bots)'
|
50
67
|
YANDEX_METRIKA: 'Mozilla/5.0 (compatible; YandexMetrika/3.0; +http://yandex.com/bots)'
|
68
|
+
YANGA: 'Yanga WorldSearch Bot v1.1/beta (http://www.yanga.co.uk/)'
|
@@ -139,4 +139,12 @@ class AcceptLanguageTest < Minitest::Test
|
|
139
139
|
assert_language result[1], code: "ru", region: nil, quality: 0.9
|
140
140
|
assert_language result[2], code: "de", region: nil, quality: 0.8
|
141
141
|
end
|
142
|
+
|
143
|
+
test "handles invalid quality values that look like a number" do
|
144
|
+
accept_language = "fr-CH, fr;q=0.9, en;q=0.8, de;q=0..7, *;q=0.5"
|
145
|
+
result = Browser::AcceptLanguage.parse(accept_language)
|
146
|
+
|
147
|
+
assert_equal 5, result.size
|
148
|
+
assert_language result[3], code: "de", region: nil, quality: 0.7
|
149
|
+
end
|
142
150
|
end
|
data/test/unit/bots_test.rb
CHANGED
@@ -27,6 +27,15 @@ class BotsTest < Minitest::Test
|
|
27
27
|
assert browser.bot?
|
28
28
|
end
|
29
29
|
|
30
|
+
test "allows setting nil as user agent for bots" do
|
31
|
+
browser = Browser.new(nil)
|
32
|
+
refute browser.bot?
|
33
|
+
|
34
|
+
Browser::Bot.detect_empty_ua!
|
35
|
+
browser = Browser.new(nil)
|
36
|
+
assert browser.bot?
|
37
|
+
end
|
38
|
+
|
30
39
|
test "doesn't detect mozilla as a bot when considering empty UA" do
|
31
40
|
Browser::Bot.detect_empty_ua!
|
32
41
|
browser = Browser.new("Mozilla")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- browser.gemspec
|
173
173
|
- config.ru
|
174
174
|
- gemfiles/rails4.gemfile
|
175
|
+
- gemfiles/rails5.gemfile
|
175
176
|
- languages.yml
|
176
177
|
- lib/browser.rb
|
177
178
|
- lib/browser/accept_language.rb
|
@@ -315,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
316
|
version: '0'
|
316
317
|
requirements: []
|
317
318
|
rubyforge_project:
|
318
|
-
rubygems_version: 2.
|
319
|
+
rubygems_version: 2.7.3
|
319
320
|
signing_key:
|
320
321
|
specification_version: 4
|
321
322
|
summary: Do some browser detection with Ruby.
|