woothee 1.8.0 → 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: fe0f7e098f6e8054dd12b42b4f231446d2adfdfcda1da42a482c254876f49f73
4
- data.tar.gz: ac9e99c0039bd8fd2b0ac04cc2bd60cb6bb1c8b55b81198b1703ca27c02d3400
3
+ metadata.gz: 7da31dd82c1e3c4a91f0e9bda7493bac91723b7edd135850037e4621c64e72bb
4
+ data.tar.gz: 132ada5aa4675a16c5f86cedf5284f4c763423382223633b06f6a40e7f816d47
5
5
  SHA512:
6
- metadata.gz: 5c7c421028759196c13b46f92910df256b24523ddd6f462493dcf59c77ce8c7573af7c9b5afea2bfaca176d9788ea5feee2362c99b478e66b5e4cb91edfb563f
7
- data.tar.gz: 6bc3c434f0a18776606c12fed9d82c4351da0257b506547aa212fa036bf1144797b26f40f81a54a5a9eb49f34a7cca34951fa769b3fa91e9d83bb58a542dfb47
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
@@ -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
@@ -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 Sun Jul 22 00:57:28 JST 2018 by tell_k
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,17 +83,17 @@ 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')
91
89
  data = Woothee::DataSet.get('Android')
92
- if ua =~ /Android[- ](\d+\.\d+(?:\.\d+)?)/
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.8.0"
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)
data/woothee.gemspec CHANGED
@@ -12,8 +12,6 @@ Gem::Specification.new do |gem|
12
12
  gem.version = Woothee::VERSION
13
13
  gem.authors = ["TAGOMORI Satoshi"]
14
14
  gem.email = "tagomoris@gmail.com"
15
- gem.has_rdoc = false
16
- #gem.platform = Gem::Platform::RUBY
17
15
  gem.files = `git ls-files`.split("\n")
18
16
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
17
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
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.8.0
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: 2018-07-23 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,9 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubyforge_project:
89
- rubygems_version: 2.7.6
90
- signing_key:
88
+ rubygems_version: 3.3.3
89
+ signing_key:
91
90
  specification_version: 4
92
91
  summary: Cross-language UserAgent classifier library, ruby implementation
93
92
  test_files:
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - "2.2"
5
- - "2.3.3"
6
- - "2.4.1"
7
- - "jruby-19mode"
8
- before_script:
9
- - git submodule update --init
10
- - gem update bundler
11
- - bundle install
12
- - bundle update
13
- script:
14
- - make