aua 0.2.6 → 0.3.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 +5 -5
- data/Gemfile +0 -2
- data/Guardfile +2 -2
- data/aua.gemspec +3 -4
- data/bin/_guard-core +29 -0
- data/bin/guard +29 -0
- data/lib/aua/agents/chrome.rb +2 -2
- data/lib/aua/agents/edge.rb +25 -0
- data/lib/aua/agents/msie.rb +2 -2
- data/lib/aua/agents.rb +2 -2
- data/lib/aua/operating_systems/android.rb +5 -5
- data/lib/aua/version.rb +1 -1
- data/spec/aua_spec.rb +18 -8
- data/spec/spec_helper.rb +2 -1
- metadata +26 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 900211a4adb2fb31f00f974c4812046e9d66053577a29caa24bc9a98325e6dbc
|
4
|
+
data.tar.gz: b4c9cc887f15d7e093c5e81a3b9961331cd674a882cc413bdd526717e86d536f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4516385abff4eca5f276517463be74287c42e38a065258b3e0c3a2db7cf20f700e747c4b3feba2ee6eacb604fc49564c795dbb1b90f180180dfa60c60ea45449
|
7
|
+
data.tar.gz: af95f1e46838ad354fde9339a964a75a4619c433f1475c7d317027d1d22eda95d9848ea791130a268ee0aa08d61ba300b16844a76f81f077b82650f9bcb732e4
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
data/aua.gemspec
CHANGED
@@ -20,8 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_development_dependency 'rspec', '
|
24
|
-
s.add_development_dependency '
|
25
|
-
s.add_development_dependency '
|
26
|
-
s.add_development_dependency 'rb-fsevent', '>=0.9'
|
23
|
+
s.add_development_dependency 'rspec', '>0'
|
24
|
+
s.add_development_dependency 'rspec-its', '>0'
|
25
|
+
s.add_development_dependency 'guard-rspec', '>0'
|
27
26
|
end
|
data/bin/_guard-core
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application '_guard-core' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("guard", "_guard-core")
|
data/bin/guard
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'guard' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("guard", "guard")
|
data/lib/aua/agents/chrome.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Aua::Agents::Chrome
|
2
2
|
def self.extend?(agent)
|
3
|
-
agent.products.include?("Safari") && agent.products.include?("Chrome")
|
3
|
+
agent.products.include?("Safari") && agent.products.include?("Chrome")
|
4
4
|
end
|
5
5
|
|
6
6
|
def type
|
@@ -32,4 +32,4 @@ module Aua::Agents::Chrome
|
|
32
32
|
@version ||= version_of("chromeframe")
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
35
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Aua::Agents::Edge
|
2
|
+
def self.extend?(agent)
|
3
|
+
agent.products.include?("Safari") && agent.products.include?("Chrome") && (
|
4
|
+
agent.products.include?("Edge") ||
|
5
|
+
agent.products.include?("Edg") ||
|
6
|
+
agent.products.include?("EdgA")
|
7
|
+
)
|
8
|
+
end
|
9
|
+
|
10
|
+
def type
|
11
|
+
:Browser
|
12
|
+
end
|
13
|
+
|
14
|
+
def name
|
15
|
+
:Edge
|
16
|
+
end
|
17
|
+
|
18
|
+
def version
|
19
|
+
@version ||= version_of("Edg") || version_of("Edge") || version_of("EdgA")
|
20
|
+
end
|
21
|
+
|
22
|
+
def major_version
|
23
|
+
@major_version ||= (version || "").split('.', 2)[0]
|
24
|
+
end
|
25
|
+
end
|
data/lib/aua/agents/msie.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Aua::Agents::Msie
|
2
2
|
|
3
3
|
def self.extend?(agent)
|
4
|
-
agent.app_comments_string =~ PATTERN
|
4
|
+
agent.app_comments_string =~ PATTERN
|
5
5
|
end
|
6
6
|
|
7
7
|
PATTERN = /(MSIE |Trident\/)([\d.]+)/
|
@@ -26,4 +26,4 @@ module Aua::Agents::Msie
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
|
-
end
|
29
|
+
end
|
data/lib/aua/agents.rb
CHANGED
@@ -6,11 +6,11 @@ class Aua
|
|
6
6
|
extend self
|
7
7
|
|
8
8
|
def default
|
9
|
-
@default ||= [HttpChecker, ApiClients, FeedReader, Firefox, Chrome::Frame, Chrome, Safari, Opera, Msie, SearchBot, Konqueror, Others, EngineFallback, OtherBrowsers]
|
9
|
+
@default ||= [HttpChecker, ApiClients, FeedReader, Firefox, Edge, Chrome::Frame, Chrome, Safari, Opera, Msie, SearchBot, Konqueror, Others, EngineFallback, OtherBrowsers]
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
Dir["#{File.dirname(__FILE__)}/agents/*.rb"].each do |agent|
|
15
15
|
require(agent)
|
16
|
-
end
|
16
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Aua::OperatingSystems::Android
|
2
2
|
|
3
3
|
def self.extend?(agent)
|
4
|
-
agent.platform_string == "Linux" && agent.comments.first && agent.comments.first
|
4
|
+
agent.platform_string == "Linux" && agent.comments.first && agent.comments.first.any?{|c| c.match(PATTERN) }
|
5
5
|
end
|
6
6
|
|
7
7
|
PATTERN = /^Android\s([\d\.]+)$/
|
@@ -15,14 +15,14 @@ module Aua::OperatingSystems::Android
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def os_version
|
18
|
-
@os_version ||= comments.first
|
18
|
+
@os_version ||= comments.first.any?{|c| c.match(PATTERN) } && $1
|
19
19
|
end
|
20
20
|
|
21
21
|
def name
|
22
|
-
@name ||= :AndroidWebkit
|
22
|
+
@name ||= super || :AndroidWebkit
|
23
23
|
end
|
24
24
|
|
25
25
|
def version
|
26
|
-
@version ||= version_of("Version")
|
26
|
+
@version ||= super || version_of("Version")
|
27
27
|
end
|
28
|
-
end
|
28
|
+
end
|
data/lib/aua/version.rb
CHANGED
data/spec/aua_spec.rb
CHANGED
@@ -43,6 +43,10 @@ describe Aua do
|
|
43
43
|
|
44
44
|
EXAMPLES = {
|
45
45
|
# Firefox
|
46
|
+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0" =>
|
47
|
+
{ :type => :Browser, :name => :Firefox, :version => "94.0", :major_version => "94.0", :os_name => :MacOSX, :os_version => "10.15", :os_major_version => "10.15", :platform => :Macintosh },
|
48
|
+
"Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" =>
|
49
|
+
{ :type => :Browser, :name => :Firefox, :version => "91.0", :major_version => "91.0", :os_name => :Windows, :os_version => "10", :os_major_version => "10", :platform => :Windows },
|
46
50
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0" =>
|
47
51
|
{ :type => :Browser, :name => :Firefox, :version => "22.0", :major_version => "22.0", :os_name => :MacOSX, :os_version => "10.8", :os_major_version => "10.8", :platform => :Macintosh },
|
48
52
|
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13" =>
|
@@ -220,13 +224,19 @@ describe Aua do
|
|
220
224
|
"Opera/9.80 (Linux armv7l; Maemo; Opera Mobi/4; U; de) Presto/2.5.28 Version/10.1" =>
|
221
225
|
{ :type => :Browser, :name => :OperaMobile, :version => "10.1", :os_name => :Linux, :os_version => "Maemo", :platform => :X11 },
|
222
226
|
|
223
|
-
#
|
227
|
+
# Edge
|
228
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 Edg/96.0.1054.29" =>
|
229
|
+
{ :type => :Browser, :name => :Edge, :version => "96.0.1054.29", :major_version => "96", :os_name => :Windows, :os_version => "10", :platform => :Windows },
|
230
|
+
"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Mobile Safari/537.36 EdgA/90.0.818.46" =>
|
231
|
+
{ :type => :Browser, :name => :Edge, :version => "90.0.818.46", :major_version => "90", :os_name => :Android, :os_version => "6.0", :platform => :Android },
|
224
232
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" =>
|
225
|
-
{ :type => :Browser, :name => :
|
233
|
+
{ :type => :Browser, :name => :Edge, :version => "12.10240", :major_version => "12", :os_name => :Windows, :os_version => "10", :platform => :Windows },
|
226
234
|
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0" =>
|
227
|
-
{ :type => :Browser, :name => :
|
235
|
+
{ :type => :Browser, :name => :Edge, :version => "12.0", :major_version => "12", :os_name => :Windows, :os_version => "10", :platform => :Windows },
|
228
236
|
"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0" =>
|
229
|
-
{ :type => :Browser, :name => :
|
237
|
+
{ :type => :Browser, :name => :Edge, :version => "12.0", :major_version => "12", :os_name => :WindowsPhone, :os_version => "10", :platform => :Windows },
|
238
|
+
|
239
|
+
# MSIE
|
230
240
|
"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko" =>
|
231
241
|
{ :type => :Browser, :name => :MSIE, :version => "11.0", :os_name => :Windows, :os_version => "8.1", :platform => :Windows },
|
232
242
|
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)" =>
|
@@ -282,11 +292,11 @@ describe Aua do
|
|
282
292
|
|
283
293
|
# Android
|
284
294
|
"Mozilla/5.0 (Linux; U; Android 1.1; en-gb; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2" =>
|
285
|
-
{ :type => :Browser, :name => :
|
295
|
+
{ :type => :Browser, :name => :MobileSafari, :version => "3.0.4", :os_name => :Android, :os_version => "1.1", :platform => :Android },
|
286
296
|
"Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3" =>
|
287
|
-
{ :type => :Browser, :name => :
|
297
|
+
{ :type => :Browser, :name => :Safari, :version => "2.0.4", :os_name => :Android, :os_version => "0.5", :platform => :Android },
|
288
298
|
"Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17" =>
|
289
|
-
{ :type => :Browser, :name => :
|
299
|
+
{ :type => :Browser, :name => :MobileSafari, :version => "4.0", :os_name => :Android, :os_version => "2.1", :platform => :Android },
|
290
300
|
|
291
301
|
# Palm (Pre)
|
292
302
|
"Mozilla/5.0 (webOS/1.3; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Desktop/1.0" =>
|
@@ -572,4 +582,4 @@ describe Aua do
|
|
572
582
|
its(:os_version) { should eql(nil) }
|
573
583
|
its(:platform) { should eql(nil) }
|
574
584
|
end
|
575
|
-
end
|
585
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rspec'
|
2
|
+
require 'rspec/its'
|
2
3
|
require File.dirname(__FILE__) + '/../lib/aua.rb'
|
3
4
|
|
4
5
|
if File.exist?(File.dirname(__FILE__) + '/../../aua-mite/')
|
@@ -10,4 +11,4 @@ end
|
|
10
11
|
RSpec.configure do |config|
|
11
12
|
config.filter_run :focus => true
|
12
13
|
config.run_all_when_everything_filtered = true
|
13
|
-
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,75 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aua
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec-its
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rb-fsevent
|
42
|
+
name: guard-rspec
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - "
|
45
|
+
- - ">"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
54
|
+
version: '0'
|
69
55
|
description: aua = a user agent (parser).
|
70
56
|
email:
|
71
57
|
- sebastian@yo.lk
|
72
|
-
executables:
|
58
|
+
executables:
|
59
|
+
- _guard-core
|
60
|
+
- guard
|
73
61
|
extensions: []
|
74
62
|
extra_rdoc_files: []
|
75
63
|
files:
|
@@ -82,10 +70,13 @@ files:
|
|
82
70
|
- README.md
|
83
71
|
- Rakefile
|
84
72
|
- aua.gemspec
|
73
|
+
- bin/_guard-core
|
74
|
+
- bin/guard
|
85
75
|
- lib/aua.rb
|
86
76
|
- lib/aua/agents.rb
|
87
77
|
- lib/aua/agents/api_clients.rb
|
88
78
|
- lib/aua/agents/chrome.rb
|
79
|
+
- lib/aua/agents/edge.rb
|
89
80
|
- lib/aua/agents/engine_fallback.rb
|
90
81
|
- lib/aua/agents/feed_reader.rb
|
91
82
|
- lib/aua/agents/firefox.rb
|
@@ -113,7 +104,7 @@ homepage: https://github.com/yolk/aua
|
|
113
104
|
licenses:
|
114
105
|
- MIT
|
115
106
|
metadata: {}
|
116
|
-
post_install_message:
|
107
|
+
post_install_message:
|
117
108
|
rdoc_options: []
|
118
109
|
require_paths:
|
119
110
|
- lib
|
@@ -128,9 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
119
|
- !ruby/object:Gem::Version
|
129
120
|
version: '0'
|
130
121
|
requirements: []
|
131
|
-
|
132
|
-
|
133
|
-
signing_key:
|
122
|
+
rubygems_version: 3.0.3
|
123
|
+
signing_key:
|
134
124
|
specification_version: 4
|
135
125
|
summary: aua = a user agent (parser).
|
136
126
|
test_files:
|