woothee 1.11.1 → 1.13.0

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
  SHA256:
3
- metadata.gz: 353dfb890880fa4189215cb2c1d39e88123c4eadb0231cbab121c32ad6188fc6
4
- data.tar.gz: 6575b95a753a986613a366610628bc34c0953506f181dd9302fcaa0237315b6c
3
+ metadata.gz: 7da31dd82c1e3c4a91f0e9bda7493bac91723b7edd135850037e4621c64e72bb
4
+ data.tar.gz: 132ada5aa4675a16c5f86cedf5284f4c763423382223633b06f6a40e7f816d47
5
5
  SHA512:
6
- metadata.gz: 01ab7dc54726d17ca57376b8cf0da95887b481c46a6f9b8b659ce0eb506a11d6b756ef1804a6a8fc1bbfe1d8441c491408419cfb0d6c2541e213028948427f46
7
- data.tar.gz: 18219b85d9a04fcfb091d3f0123fbb51ade14b22e3b7c5fcaa8ee1227a67bdf4f2569238d268adde959041878390a6dc9842ccf56e1dbcf5f3a277092ef7dda2
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
@@ -181,4 +181,18 @@ module Woothee::Browser
181
181
  update_map(result, Woothee::DataSet.get('Vivaldi'))
182
182
  update_version(result, version)
183
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
+
184
198
  end
@@ -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
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  module Woothee::DataSet
37
37
  DATASET = {}
38
- # GENERATED from dataset.yaml at Tue Mar 17 20:33:08 JST 2020 by tagomoris
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
@@ -69,6 +69,9 @@ module Woothee::DataSet
69
69
  obj = {:label => 'YaBrowser', :name => 'Yandex Browser', :type => :browser}
70
70
  obj[:vendor] = 'Yandex'
71
71
  DATASET[obj[:label]] = obj
72
+ obj = {:label => 'SamsungBrowser', :name => 'SamsungBrowser', :type => :browser}
73
+ obj[:vendor] = 'Samsung'
74
+ DATASET[obj[:label]] = obj
72
75
  obj = {:label => 'Win', :name => 'Windows UNKNOWN Ver', :type => :os}
73
76
  obj[:category] = :pc
74
77
  DATASET[obj[:label]] = obj
@@ -348,6 +351,12 @@ module Woothee::DataSet
348
351
  obj = {:label => 'VariousCrawler', :name => 'misc crawler', :type => :full}
349
352
  obj[:category] = :crawler
350
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
351
360
 
352
361
  DATASET.freeze
353
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
- else
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])
@@ -1,3 +1,3 @@
1
1
  module Woothee
2
- VERSION = "1.11.1"
2
+ VERSION = "1.13.0"
3
3
  end
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.11.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: 2020-05-19 00:00:00.000000000 Z
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.1.2
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:
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - "2.5.6"
5
- - "2.6.4"
6
- - "2.7.0"
7
- - "jruby-head"
8
- before_script:
9
- - git submodule update --init
10
- - gem update bundler
11
- - bundle install
12
- - bundle update
13
- script:
14
- - make