aua 0.2.5 → 0.3.2

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
- SHA1:
3
- metadata.gz: 5f0331d20167670922477dea635073e93cde5963
4
- data.tar.gz: add2fdf9d9a138c4d3392ef8b93b6b5039e81b49
2
+ SHA256:
3
+ metadata.gz: 33204404b125f9d2e59019fb1526b6ce535c7c8636a112d78d18b9a4d64daf37
4
+ data.tar.gz: d41eae4a2a53c1acdb0a309f7dc4b4b084dcd1e7109a685a1dee6bade847014f
5
5
  SHA512:
6
- metadata.gz: 81e291279385ab2fbd0e55d9c44b0e023656ae60bcd564249b03157a8121f7f28e7935473cd4c15b0dfbff1634fea0e5918dc6d7412a763db1dd51e6aa8dc86a
7
- data.tar.gz: 7f153e8e0751c762fb96a4cc9d1de0cbdc9e5b5f73faeb4bcb8940cfbbac1727bfc71bd20c7059a0edd834795ad39ded7840eb67bef895597bcb496471c0f6aa
6
+ metadata.gz: 8466a797c13044f64e21cb1f39a646a4fa1a1fe0bd116b31630760d21f13cd5fe92fb89803490ecc149e6a6d4e63e35a4c04577b5ae7e8eb88229e9923cd306d
7
+ data.tar.gz: 395b4ad416c5801e02c1b21a1af2b9ca3fa4c43a272752c0b1c43b1f58067eaee27731397608b666df26cb89d925a45d28b905d7bc349290c41d2688c8ba7cea
data/CHANGES.md CHANGED
@@ -1,6 +1,13 @@
1
1
  ### dev
2
2
 
3
- [full changelog](http://github.com/yolk/aua/compare/v0.2.5...master)
3
+ [full changelog](http://github.com/yolk/aua/compare/v0.2.6...master)
4
+
5
+ ### 0.2.6 / 2015-08-05
6
+
7
+ [full changelog](http://github.com/yolk/aua/compare/v0.2.5...v0.2.6)
8
+
9
+ * Show only major version for MSIE 12 (Edge)
10
+ * Small fixes: Konqueror + Vienna RSS
4
11
 
5
12
  ### 0.2.5 / 2015-08-05
6
13
 
data/Gemfile CHANGED
@@ -2,5 +2,3 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in aua.gemspec
4
4
  gemspec
5
-
6
- gem "rake"
data/Guardfile CHANGED
@@ -1,5 +1,5 @@
1
- guard 'rspec' do
1
+ guard :rspec, cmd: "bundle exec rspec" do
2
2
  watch(/^spec\/(.*)_spec\.rb/) { "spec" }
3
3
  watch(/^lib\/(.*)\.rb/) { "spec" } # { |m| "spec/#{m[1]}_spec.rb" }
4
4
  watch(/^spec\/spec_helper\.rb/) { "spec" }
5
- end
5
+ end
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', '~>2.4'
24
- s.add_development_dependency 'guard-rspec', '>=3.0'
25
- s.add_development_dependency 'growl', '>=1.0'
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
@@ -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") && !agent.products.include?("Edge")
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
@@ -3,7 +3,8 @@ module Aua::Agents::FeedReader
3
3
 
4
4
  def self.extend?(agent)
5
5
  KNOWN_CLIENTS.include?(agent.app) ||
6
- (agent.app == "Tumblr" && agent.products.include?("RSS") && agent.products.include?("syndication"))
6
+ (agent.app == "Tumblr" && agent.products.include?("RSS") && agent.products.include?("syndication")) ||
7
+ agent.products.include?("Vienna")
7
8
  end
8
9
 
9
10
  def type
@@ -12,10 +13,11 @@ module Aua::Agents::FeedReader
12
13
 
13
14
  def name
14
15
  return :TumblrRSSSyndication if app == "Tumblr"
16
+ return :Vienna if products.include?("Vienna")
15
17
  app.to_sym
16
18
  end
17
19
 
18
20
  def version
19
- @version ||= versions[0] || versions[1]
21
+ @version ||= version_of(name) || versions[0] || versions[1]
20
22
  end
21
23
  end
@@ -1,7 +1,8 @@
1
1
  module Aua::Agents::Konqueror
2
2
  def self.extend?(agent)
3
3
  agent.products.include?("KHTML") &&
4
- agent.app_comments[1] =~ PATTERN
4
+ (agent.app_comments[1] =~ PATTERN ||
5
+ agent.products.include?("Konqueror"))
5
6
  end
6
7
 
7
8
  PATTERN = /Konqueror\/([\d\.]+)/
@@ -15,6 +16,6 @@ module Aua::Agents::Konqueror
15
16
  end
16
17
 
17
18
  def version
18
- @version ||= app_comments[1] =~ PATTERN && $1
19
+ @version ||= app_comments[1] =~ PATTERN && $1 || version_of("Konqueror")
19
20
  end
20
21
  end
@@ -1,11 +1,14 @@
1
1
  module Aua::Agents::Msie
2
2
 
3
3
  def self.extend?(agent)
4
- agent.app_comments_string =~ PATTERN || agent.products[-1] == "Edge"
4
+ agent.app_comments_string =~ PATTERN
5
5
  end
6
6
 
7
7
  PATTERN = /(MSIE |Trident\/)([\d.]+)/
8
8
  TRIDENT_VERSION_MAP = {
9
+ "4.0" => "8.0",
10
+ "5.0" => "9.0",
11
+ "6.0" => "10.0",
9
12
  "7.0" => "11.0"
10
13
  }
11
14
 
@@ -18,12 +21,8 @@ module Aua::Agents::Msie
18
21
  end
19
22
 
20
23
  def version
21
- @version ||= begin
22
- if app_comments_string =~ PATTERN
23
- $1 == "Trident\/" ? TRIDENT_VERSION_MAP[$2] || $2 : $2
24
- else
25
- version_of("Edge")
26
- end
24
+ @version ||= if app_comments_string =~ PATTERN
25
+ $1 == "Trident\/" ? TRIDENT_VERSION_MAP[$2] || $2 : $2
27
26
  end
28
27
  end
29
- end
28
+ 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[2] && agent.comments.first[2].match(PATTERN)
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[2] =~ PATTERN && $1
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
@@ -1,3 +1,3 @@
1
1
  class Aua
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.2"
3
3
  end
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" =>
@@ -157,6 +161,10 @@ describe Aua do
157
161
  { :type => :Browser, :name => :Konqueror, :version => "4.3", :os_name => :Linux, :os_version => nil, :platform => :X11 },
158
162
  "Mozilla/5.0 (compatible; Konqueror/4.0; Windows) KHTML/4.0.83 (like Gecko)" =>
159
163
  { :type => :Browser, :name => :Konqueror, :version => "4.0", :os_name => :Windows, :os_version => nil, :platform => :Windows },
164
+ "Mozilla/5.0 (X11; Linux x86_64) KHTML/5.8.0 (like Gecko) Konqueror/5.8" =>
165
+ { :type => :Browser, :name => :Konqueror, :version => "5.8", :os_name => :Linux, :os_version => nil, :platform => :X11 },
166
+ "Mozilla/5.0 (X11; Linux x86_64) KHTML/4.14.3 (like Gecko) Konqueror/4.14 Fedora/4.14.3-8.fc21" =>
167
+ { :type => :Browser, :name => :Konqueror, :version => "4.14", :os_name => :Linux, :os_version => "Fedora", :platform => :X11 },
160
168
 
161
169
  # Chrome
162
170
  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36" =>
@@ -216,11 +224,19 @@ describe Aua do
216
224
  "Opera/9.80 (Linux armv7l; Maemo; Opera Mobi/4; U; de) Presto/2.5.28 Version/10.1" =>
217
225
  { :type => :Browser, :name => :OperaMobile, :version => "10.1", :os_name => :Linux, :os_version => "Maemo", :platform => :X11 },
218
226
 
219
- # MSIE
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 },
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" =>
233
+ { :type => :Browser, :name => :Edge, :version => "12.10240", :major_version => "12", :os_name => :Windows, :os_version => "10", :platform => :Windows },
220
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" =>
221
- { :type => :Browser, :name => :MSIE, :version => "12.0", :os_name => :Windows, :os_version => "10", :platform => :Windows },
235
+ { :type => :Browser, :name => :Edge, :version => "12.0", :major_version => "12", :os_name => :Windows, :os_version => "10", :platform => :Windows },
222
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" =>
223
- { :type => :Browser, :name => :MSIE, :version => "12.0", :os_name => :WindowsPhone, :os_version => "10", :platform => :Windows },
237
+ { :type => :Browser, :name => :Edge, :version => "12.0", :major_version => "12", :os_name => :WindowsPhone, :os_version => "10", :platform => :Windows },
238
+
239
+ # MSIE
224
240
  "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko" =>
225
241
  { :type => :Browser, :name => :MSIE, :version => "11.0", :os_name => :Windows, :os_version => "8.1", :platform => :Windows },
226
242
  "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)" =>
@@ -276,11 +292,11 @@ describe Aua do
276
292
 
277
293
  # Android
278
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" =>
279
- { :type => :Browser, :name => :AndroidWebkit, :version => "3.0.4", :os_name => :Android, :os_version => "1.1", :platform => :Android },
295
+ { :type => :Browser, :name => :MobileSafari, :version => "3.0.4", :os_name => :Android, :os_version => "1.1", :platform => :Android },
280
296
  "Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3" =>
281
- { :type => :Browser, :name => :AndroidWebkit, :version => nil, :os_name => :Android, :os_version => "0.5", :platform => :Android },
297
+ { :type => :Browser, :name => :Safari, :version => "2.0.4", :os_name => :Android, :os_version => "0.5", :platform => :Android },
282
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" =>
283
- { :type => :Browser, :name => :AndroidWebkit, :version => "4.0", :os_name => :Android, :os_version => "2.1", :platform => :Android },
299
+ { :type => :Browser, :name => :MobileSafari, :version => "4.0", :os_name => :Android, :os_version => "2.1", :platform => :Android },
284
300
 
285
301
  # Palm (Pre)
286
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" =>
@@ -425,6 +441,8 @@ describe Aua do
425
441
  { :type => :FeedReader, :name => :FeeddlerRSS, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
426
442
  "FreeRSSReader/1.9.5 CFNetwork/672.0.2 Darwin/14.0.0" =>
427
443
  { :type => :FeedReader, :name => :FreeRSSReader, :version => "1.9.5", :os_name => :Darwin, :os_version => "14.0.0", :platform => :Darwin },
444
+ "Mozilla/5.0 Vienna/3.0.6" =>
445
+ { :type => :FeedReader, :name => :Vienna, :version => "3.0.6", :os_name => nil, :os_version => nil, :platform => nil },
428
446
 
429
447
  # SearchBots
430
448
  "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" =>
@@ -564,4 +582,4 @@ describe Aua do
564
582
  its(:os_version) { should eql(nil) }
565
583
  its(:platform) { should eql(nil) }
566
584
  end
567
- 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,71 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aua
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.2
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: 2015-08-05 00:00:00.000000000 Z
11
+ date: 2021-12-07 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: '2.4'
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: '2.4'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: guard-rspec
28
+ name: rspec-its
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
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: '3.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: growl
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.9'
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.9'
54
+ version: '0'
69
55
  description: aua = a user agent (parser).
70
56
  email:
71
57
  - sebastian@yo.lk
@@ -86,6 +72,7 @@ files:
86
72
  - lib/aua/agents.rb
87
73
  - lib/aua/agents/api_clients.rb
88
74
  - lib/aua/agents/chrome.rb
75
+ - lib/aua/agents/edge.rb
89
76
  - lib/aua/agents/engine_fallback.rb
90
77
  - lib/aua/agents/feed_reader.rb
91
78
  - lib/aua/agents/firefox.rb
@@ -113,7 +100,7 @@ homepage: https://github.com/yolk/aua
113
100
  licenses:
114
101
  - MIT
115
102
  metadata: {}
116
- post_install_message:
103
+ post_install_message:
117
104
  rdoc_options: []
118
105
  require_paths:
119
106
  - lib
@@ -128,9 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
115
  - !ruby/object:Gem::Version
129
116
  version: '0'
130
117
  requirements: []
131
- rubyforge_project: aua
132
- rubygems_version: 2.4.5
133
- signing_key:
118
+ rubygems_version: 3.1.6
119
+ signing_key:
134
120
  specification_version: 4
135
121
  summary: aua = a user agent (parser).
136
122
  test_files: