woothee 1.9.0 → 1.13.0
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 +4 -4
- data/.github/workflows/ci.yaml +26 -0
- data/lib/woothee/browser.rb +23 -1
- data/lib/woothee/crawler.rb +8 -0
- data/lib/woothee/dataset.rb +13 -1
- data/lib/woothee/os.rb +3 -3
- data/lib/woothee/version.rb +1 -1
- data/lib/woothee.rb +2 -0
- metadata +7 -7
- data/.travis.yml +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7da31dd82c1e3c4a91f0e9bda7493bac91723b7edd135850037e4621c64e72bb
|
4
|
+
data.tar.gz: 132ada5aa4675a16c5f86cedf5284f4c763423382223633b06f6a40e7f816d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26226d7627431f61366f857fcc11c6284ea20673ecb7bf9b2150ac34677f3463c1b30317fa5c7d9376894e523147f6f730bd4ad6825f6a4f33e7029561434c5b
|
7
|
+
data.tar.gz: 846226ded8f8b35f8331e31ca32b43a5feffe478fe362852bd13ba113bb8665ee4db024c1662f918a4e4ee314a988b52d5898e0ca681ebb737aaefd0ffb9fc04
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: ci
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches: '*'
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- master
|
9
|
+
- main
|
10
|
+
- 'release-*'
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
mri:
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
os: [ubuntu]
|
17
|
+
ruby: ['2.7', '3.0', 'head', 'jruby-head']
|
18
|
+
runs-on: ${{ matrix.os }}-latest
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
- run: git submodule update --init
|
25
|
+
- run: bundle install
|
26
|
+
- run: make test
|
data/lib/woothee/browser.rb
CHANGED
@@ -43,7 +43,7 @@ module Woothee::Browser
|
|
43
43
|
version = Woothee::VALUE_UNKNOWN
|
44
44
|
|
45
45
|
# Edge
|
46
|
-
if ua =~ /Edge\/([.0-9]+)/o
|
46
|
+
if ua =~ /(?:Edge|Edg|EdgiOS|EdgA)\/([.0-9]+)/o
|
47
47
|
version = $1
|
48
48
|
update_map(result, Woothee::DataSet.get('Edge'))
|
49
49
|
update_version(result, version)
|
@@ -74,6 +74,14 @@ module Woothee::Browser
|
|
74
74
|
return true
|
75
75
|
end
|
76
76
|
|
77
|
+
# Google Search App
|
78
|
+
if ua =~ /GSA\/([.0-9]+)/o
|
79
|
+
version = $1
|
80
|
+
update_map(result, Woothee::DataSet.get("GSA"))
|
81
|
+
update_version(result, version)
|
82
|
+
return true
|
83
|
+
end
|
84
|
+
|
77
85
|
# Safari
|
78
86
|
if ua =~ /Version\/([.0-9]+)/o
|
79
87
|
version = $1
|
@@ -173,4 +181,18 @@ module Woothee::Browser
|
|
173
181
|
update_map(result, Woothee::DataSet.get('Vivaldi'))
|
174
182
|
update_version(result, version)
|
175
183
|
end
|
184
|
+
|
185
|
+
def self.challenge_samsungbrowser(ua, result)
|
186
|
+
return false if ua.index('SamsungBrowser/').nil?
|
187
|
+
|
188
|
+
version = Woothee::VALUE_UNKNOWN
|
189
|
+
if ua =~ /SamsungBrowser\/([.0-9]+)/o
|
190
|
+
version = $1
|
191
|
+
end
|
192
|
+
|
193
|
+
update_map(result, Woothee::DataSet.get('SamsungBrowser'))
|
194
|
+
update_version(result, version)
|
195
|
+
true
|
196
|
+
end
|
197
|
+
|
176
198
|
end
|
data/lib/woothee/crawler.rb
CHANGED
@@ -18,6 +18,14 @@ module Woothee::Crawler
|
|
18
18
|
return true
|
19
19
|
end
|
20
20
|
end
|
21
|
+
if ua.index('compatible; AdsBot-Google-Mobile;')
|
22
|
+
update_map(result, Woothee::DataSet.get('AdsBotGoogleMobile'))
|
23
|
+
return true
|
24
|
+
end
|
25
|
+
if ua.index('AdsBot-Google')
|
26
|
+
update_map(result, Woothee::DataSet.get('AdsBotGoogle'))
|
27
|
+
return true
|
28
|
+
end
|
21
29
|
if ua.index('Googlebot-Image/')
|
22
30
|
update_map(result, Woothee::DataSet.get('GoogleBot'))
|
23
31
|
return true
|
data/lib/woothee/dataset.rb
CHANGED
@@ -35,7 +35,7 @@ end
|
|
35
35
|
|
36
36
|
module Woothee::DataSet
|
37
37
|
DATASET = {}
|
38
|
-
# GENERATED from dataset.yaml at Sun
|
38
|
+
# GENERATED from dataset.yaml at Sun Jan 9 00:14:17 JST 2022 by yuji_developer
|
39
39
|
obj = {:label => 'MSIE', :name => 'Internet Explorer', :type => :browser}
|
40
40
|
obj[:vendor] = 'Microsoft'
|
41
41
|
DATASET[obj[:label]] = obj
|
@@ -60,12 +60,18 @@ module Woothee::DataSet
|
|
60
60
|
obj = {:label => 'Sleipnir', :name => 'Sleipnir', :type => :browser}
|
61
61
|
obj[:vendor] = 'Fenrir Inc.'
|
62
62
|
DATASET[obj[:label]] = obj
|
63
|
+
obj = {:label => 'GSA', :name => 'Google Search App', :type => :browser}
|
64
|
+
obj[:vendor] = 'Google'
|
65
|
+
DATASET[obj[:label]] = obj
|
63
66
|
obj = {:label => 'Webview', :name => 'Webview', :type => :browser}
|
64
67
|
obj[:vendor] = 'OS vendor'
|
65
68
|
DATASET[obj[:label]] = obj
|
66
69
|
obj = {:label => 'YaBrowser', :name => 'Yandex Browser', :type => :browser}
|
67
70
|
obj[:vendor] = 'Yandex'
|
68
71
|
DATASET[obj[:label]] = obj
|
72
|
+
obj = {:label => 'SamsungBrowser', :name => 'SamsungBrowser', :type => :browser}
|
73
|
+
obj[:vendor] = 'Samsung'
|
74
|
+
DATASET[obj[:label]] = obj
|
69
75
|
obj = {:label => 'Win', :name => 'Windows UNKNOWN Ver', :type => :os}
|
70
76
|
obj[:category] = :pc
|
71
77
|
DATASET[obj[:label]] = obj
|
@@ -345,6 +351,12 @@ module Woothee::DataSet
|
|
345
351
|
obj = {:label => 'VariousCrawler', :name => 'misc crawler', :type => :full}
|
346
352
|
obj[:category] = :crawler
|
347
353
|
DATASET[obj[:label]] = obj
|
354
|
+
obj = {:label => 'AdsBotGoogleMobile', :name => 'AdsBot-Google-Mobile', :type => :full}
|
355
|
+
obj[:category] = :crawler
|
356
|
+
DATASET[obj[:label]] = obj
|
357
|
+
obj = {:label => 'AdsBotGoogle', :name => 'AdsBot-Google', :type => :full}
|
358
|
+
obj[:category] = :crawler
|
359
|
+
DATASET[obj[:label]] = obj
|
348
360
|
|
349
361
|
DATASET.freeze
|
350
362
|
|
data/lib/woothee/os.rb
CHANGED
@@ -83,8 +83,6 @@ module Woothee::OS
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def self.challenge_linux(ua, result)
|
86
|
-
return false if ua.index('Linux').nil?
|
87
|
-
|
88
86
|
data = nil
|
89
87
|
os_version = nil
|
90
88
|
if ua.index('Android')
|
@@ -92,8 +90,10 @@ module Woothee::OS
|
|
92
90
|
if ua =~ /Android[- ](\d+(?:\.\d+(?:\.\d+)?)?)/
|
93
91
|
os_version = $1
|
94
92
|
end
|
95
|
-
|
93
|
+
elsif ua.index('Linux')
|
96
94
|
data = Woothee::DataSet.get('Linux')
|
95
|
+
else
|
96
|
+
return false
|
97
97
|
end
|
98
98
|
update_category(result, data[Woothee::KEY_CATEGORY])
|
99
99
|
update_os(result, data[Woothee::KEY_NAME])
|
data/lib/woothee/version.rb
CHANGED
data/lib/woothee.rb
CHANGED
@@ -75,6 +75,8 @@ module Woothee
|
|
75
75
|
|
76
76
|
return true if Woothee::Browser.challenge_yandexbrowser(useragent, result)
|
77
77
|
|
78
|
+
return true if Woothee::Browser.challenge_samsungbrowser(useragent, result)
|
79
|
+
|
78
80
|
return true if Woothee::Browser.challenge_safari_chrome(useragent, result)
|
79
81
|
|
80
82
|
return true if Woothee::Browser.challenge_firefox(useragent, result)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woothee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -44,9 +44,9 @@ executables: []
|
|
44
44
|
extensions: []
|
45
45
|
extra_rdoc_files: []
|
46
46
|
files:
|
47
|
+
- ".github/workflows/ci.yaml"
|
47
48
|
- ".gitignore"
|
48
49
|
- ".gitmodules"
|
49
|
-
- ".travis.yml"
|
50
50
|
- Gemfile
|
51
51
|
- LICENSE.txt
|
52
52
|
- Makefile
|
@@ -70,7 +70,7 @@ files:
|
|
70
70
|
homepage: https://github.com/woothee/woothee-ruby
|
71
71
|
licenses: []
|
72
72
|
metadata: {}
|
73
|
-
post_install_message:
|
73
|
+
post_install_message:
|
74
74
|
rdoc_options: []
|
75
75
|
require_paths:
|
76
76
|
- lib
|
@@ -85,8 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
89
|
-
signing_key:
|
88
|
+
rubygems_version: 3.3.3
|
89
|
+
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Cross-language UserAgent classifier library, ruby implementation
|
92
92
|
test_files:
|