aua 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 151b1188bb70816f5c6d7fb672f076e2078f6c85
4
- data.tar.gz: 444d7b614e154e29215f8d2f040f215611c42bfd
3
+ metadata.gz: 6689e944b498fc72ad1241de2f9223cb76e8250d
4
+ data.tar.gz: ad1a27023be7348159a1f551e3f4f58209c414d3
5
5
  SHA512:
6
- metadata.gz: f01a7678393ff7c60341aec8e265bbad4fad94241df54ef608ddf44c19a8e63e0817bc97ff65cbd33d850a375c7eb5da127c9184050c3f74d8dea2247e2e3627
7
- data.tar.gz: e66bd417b312cd54968bc35a38d176d62ac70b1531750b1b652045cb2bbd415f3e8de612b6ed48ce77cc0ec28b2936e93450ab850ba3e97aa56339ee94d74faa
6
+ metadata.gz: 05d6889cb302b6089f8f8bbecd1150ce0ab8a9a09e2f42d090e42d58145784285a3cbaf50a808d6181a191d99564d2030538962ed1080775c536c8aa922e688e
7
+ data.tar.gz: d8edad5f3cc8236cce92405b9e5c52761d18e683dbaa8e6a115350cc6eef052574582244f814460c0ae8ee7cc18e0a4b6e21b52b88866059b88202880173c07c
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.1
3
4
  - 2.0.0
4
- - 1.9.3
5
- - 1.8.7
5
+ - 1.9.3
data/CHANGES.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ### dev
2
2
 
3
- [full changelog](http://github.com/yolk/aua/compare/v0.2.2...master)
3
+ [full changelog](http://github.com/yolk/aua/compare/v0.2.4...master)
4
+
5
+ ### 0.2.4 / 2015-08-05
6
+
7
+ [full changelog](http://github.com/yolk/aua/compare/v0.2.3...v0.2.4)
8
+
9
+ * Added Windows 10 / WindowsPhone 10 / Edge (MSIE 12.0)
4
10
 
5
11
  ### 0.2.2 / 2012-03-29
6
12
 
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  Aua
2
2
  =============
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/aua.png)](http://badge.fury.io/rb/aua) [![Build Status](https://travis-ci.org/yolk/aua.png)](https://travis-ci.org/yolk/aua)
5
+
4
6
  aua = a user agent (parser).
5
7
 
6
8
  Installation
@@ -12,11 +14,11 @@ Installation
12
14
  Basic Usage
13
15
  -------
14
16
 
15
- Aua.parse("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13")
17
+ Aua.parse("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0")
16
18
 
17
19
  BlaBla
18
20
  -------
19
21
 
20
- Copyright (c) 2011 Yolk Sebastian Munz & Julia Soergel GbR
22
+ Copyright (c) 2011-2013 Yolk Sebastian Munz & Julia Soergel GbR
21
23
 
22
24
  Beyond that, the implementation is licensed under the MIT License.
data/aua.gemspec CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Sebastian Munz"]
10
10
  s.email = ["sebastian@yo.lk"]
11
+ s.license = 'MIT'
11
12
  s.homepage = "https://github.com/yolk/aua"
12
13
  s.summary = %q{aua = a user agent (parser).}
13
14
  s.description = %q{aua = a user agent (parser).}
@@ -19,7 +20,7 @@ Gem::Specification.new do |s|
19
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
21
  s.require_paths = ["lib"]
21
22
 
22
- s.add_development_dependency 'rspec', '>= 2.4'
23
+ s.add_development_dependency 'rspec', '~>2.4'
23
24
  s.add_development_dependency 'guard-rspec', '>=3.0'
24
25
  s.add_development_dependency 'growl', '>=1.0'
25
26
  s.add_development_dependency 'rb-fsevent', '>=0.9'
@@ -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") && !agent.products.include?("Edge")
4
4
  end
5
5
 
6
6
  def type
@@ -1,5 +1,5 @@
1
1
  module Aua::Agents::FeedReader
2
- KNOWN_CLIENTS = %w(hawkReader Fever Superfeedr Feedly Reeder AppleSyndication Netvibes Windows-RSS-Platform Vienna NewsGatorOnline NewsFire NetNewsWire MWFeedParser SimplePie MagpieRSS Feedfetcher-Google Apple-PubSub)
2
+ KNOWN_CLIENTS = %w(FreeRSSReader FeeddlerRSS FeeddlerPro hawkReader Fever Superfeedr Feedly FeedlyApp Reeder AppleSyndication Netvibes Windows-RSS-Platform Vienna NewsGatorOnline NewsFire NetNewsWire MWFeedParser SimplePie MagpieRSS Feedfetcher-Google Apple-PubSub Feedbin FeedDemon)
3
3
 
4
4
  def self.extend?(agent)
5
5
  KNOWN_CLIENTS.include?(agent.app) ||
@@ -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 || agent.products[-1] == "Edge"
5
5
  end
6
6
 
7
7
  PATTERN = /(MSIE |Trident\/)([\d.]+)/
@@ -19,8 +19,11 @@ module Aua::Agents::Msie
19
19
 
20
20
  def version
21
21
  @version ||= begin
22
- app_comments_string =~ PATTERN
23
- $1 == "Trident\/" ? TRIDENT_VERSION_MAP[$2] || $2 : $2
22
+ if app_comments_string =~ PATTERN
23
+ $1 == "Trident\/" ? TRIDENT_VERSION_MAP[$2] || $2 : $2
24
+ else
25
+ version_of("Edge")
26
+ end
24
27
  end
25
28
  end
26
29
  end
@@ -1,5 +1,5 @@
1
1
  module Aua::Agents::Others
2
- KNOWN_CLIENTS = %w(1PasswordThumbs 1PasswordThumbs1)
2
+ KNOWN_CLIENTS = %w(1PasswordThumbs 1PasswordThumbs1 Flint)
3
3
 
4
4
  def self.extend?(agent)
5
5
  KNOWN_CLIENTS.include?(agent.app) ||
@@ -8,7 +8,8 @@ module Aua::Agents::SearchBot
8
8
  agent.app_comments[1] == "Yahoo! Slurp" ||
9
9
  agent.raw =~ PATTERN_BAIDU ||
10
10
  agent.raw =~ PATTERN_GOOGLE ||
11
- agent.app == "msnbot"
11
+ agent.app == "msnbot" ||
12
+ agent.app == "FLUX-Toolchain"
12
13
  end
13
14
 
14
15
  def type
@@ -21,6 +22,7 @@ module Aua::Agents::SearchBot
21
22
  return :YahooSlurp if app_comments[1] == "Yahoo! Slurp"
22
23
  return :Baiduspider if raw =~ PATTERN_BAIDU
23
24
  return $1 ? :GooglebotMobile : :Googlebot if raw =~ PATTERN_GOOGLE
25
+ return :DWDSCrawler if app == "FLUX-Toolchain"
24
26
  app.to_sym
25
27
  end
26
28
  end
@@ -35,7 +35,21 @@ module Aua::OperatingSystems::Mac
35
35
  '10.4.0' => '10.6.4',
36
36
  '10.4.1' => '10.6.4',
37
37
  '10.5.0' => '10.6.5',
38
- '10.6.0' => '10.6.6'
38
+ '10.6.0' => '10.6.6',
39
+ '10.7.0' => '10.6.7',
40
+ '10.8.0' => '10.6.8',
41
+
42
+ '11.0' => '10.7',
43
+ '11.0.0' => '10.7',
44
+ '11.4.2' => '10.7.5',
45
+
46
+ '12.0' => '10.8',
47
+ '12.0.0' => '10.8',
48
+ '12.5' => '10.8.5',
49
+ '12.5.0' => '10.8.5',
50
+
51
+ '13.0' => '10.9',
52
+ '13.0.0' => '10.9.0'
39
53
  }
40
54
 
41
55
  def platform
@@ -7,6 +7,8 @@ module Aua::OperatingSystems::Windows
7
7
  end
8
8
 
9
9
  VERSIONS = {
10
+ "10.0" => "10",
11
+ "NT 10.0" => "10",
10
12
  "NT 6.3" => "8.1",
11
13
  "NT 6.2" => "8",
12
14
  "NT 6.1" => "7",
@@ -22,17 +24,24 @@ module Aua::OperatingSystems::Windows
22
24
  "9x 4.90" => "ME"
23
25
  }
24
26
 
25
- PATTERN = /Win(dows)?\s?([\d\sA-Zx\.]+)/
27
+ PATTERN = /Win(dows)?(\sPhone)?\s?([\d\sA-Zx\.]+)/
28
+ PHONE_PATTERN = /Windows Phone/
26
29
 
27
30
  def platform
28
31
  :Windows
29
32
  end
30
33
 
31
34
  def os_name
32
- :Windows
35
+ @os_name ||= windows_phone? ? :WindowsPhone : :Windows
33
36
  end
34
37
 
35
38
  def os_version
36
- @os_version ||= comments_string =~ PATTERN && VERSIONS[$2] || $2
39
+ @os_version ||= comments_string =~ PATTERN && VERSIONS[$3] || $3
40
+ end
41
+
42
+ private
43
+
44
+ def windows_phone?
45
+ !!(comments_string =~ PHONE_PATTERN)
37
46
  end
38
47
  end
data/lib/aua/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Aua
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/spec/aua_spec.rb CHANGED
@@ -15,7 +15,7 @@ describe Aua do
15
15
  mspr = ((sec/runs*1_000/EXAMPLES.size)*10_000).to_i/10_000.0
16
16
  puts "#{sec} sec #{mspr} ms/string #{(EXAMPLES.size*runs/sec).to_i} strings/sec"
17
17
  mspr.should < 0.2
18
- end
18
+ end unless ENV["TRAVIS"]
19
19
 
20
20
  context "when parsing blank string" do
21
21
  let(:user_agent) { Aua.parse("") }
@@ -215,6 +215,10 @@ describe Aua do
215
215
  { :type => :Browser, :name => :OperaMobile, :version => "10.1", :os_name => :Linux, :os_version => "Maemo", :platform => :X11 },
216
216
 
217
217
  # MSIE
218
+ "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" =>
219
+ { :type => :Browser, :name => :MSIE, :version => "12.0", :os_name => :Windows, :os_version => "10", :platform => :Windows },
220
+ "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" =>
221
+ { :type => :Browser, :name => :MSIE, :version => "12.0", :os_name => :WindowsPhone, :os_version => "10", :platform => :Windows },
218
222
  "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko" =>
219
223
  { :type => :Browser, :name => :MSIE, :version => "11.0", :os_name => :Windows, :os_version => "8.1", :platform => :Windows },
220
224
  "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)" =>
@@ -349,6 +353,8 @@ describe Aua do
349
353
  { :type => :Others, :name => :MSWord, :version => "12.25.0", :os_name => :MacOSX, :os_version => nil, :platform => :Macintosh },
350
354
  "Microsoft Office/14.0 (Windows NT 6.1; Microsoft Outlook 14.0.5128; Pro; ms-office; MSOffice 14)" =>
351
355
  { :type => :Others, :name => :MSOffice, :version => "14.0", :os_name => :Windows, :os_version => "7", :platform => :Windows },
356
+ "Flint/165 CFNetwork/520.5.1 Darwin/11.4.2 (x86_64) (MacBookPro10%2C1)" =>
357
+ { :type => :Others, :name => :"Flint", :version => "165", :os_name => :MacOSX, :os_version => "10.7.5", :platform => :Macintosh },
352
358
 
353
359
  # HttpCheckers
354
360
  "check_http/v2053 (nagios-plugins 1.4.13)" =>
@@ -371,12 +377,22 @@ describe Aua do
371
377
  { :type => :FeedReader, :name => :Superfeedr, :version => "2.0", :os_name => nil, :os_version => nil, :platform => nil },
372
378
  "Feedly/1.0 (+http://www.feedly.com/fetcher.html; like FeedFetcher-Google)" =>
373
379
  { :type => :FeedReader, :name => :Feedly, :version => "1.0", :os_name => nil, :os_version => nil, :platform => nil },
380
+ "FeedlyApp/1.0 (http://www.feedly.com)" =>
381
+ { :type => :FeedReader, :name => :FeedlyApp, :version => "1.0", :os_name => nil, :os_version => nil, :platform => nil },
382
+ "Feedbin" =>
383
+ { :type => :FeedReader, :name => :Feedbin, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
384
+ "Feedbin - 1 subscribers" =>
385
+ { :type => :FeedReader, :name => :Feedbin, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
374
386
  "Windows-RSS-Platform/2.0 (MSIE 9.0; Windows NT 6.1)" =>
375
387
  { :type => :FeedReader, :name => :"Windows-RSS-Platform", :version => "2.0", :os_name => :Windows, :os_version => "7", :platform => :Windows },
376
388
  "Vienna/2.5.0.2501" =>
377
389
  { :type => :FeedReader, :name => :Vienna, :version => "2.5.0.2501", :os_name => nil, :os_version => nil, :platform => nil },
378
390
  "NewsGatorOnline/2.0 (http://www.newsgator.com; 1 subscribers)" =>
379
391
  { :type => :FeedReader, :name => :NewsGatorOnline, :version => "2.0", :os_name => nil, :os_version => nil, :platform => nil },
392
+ "FeedDemon/2.7 (http://www.newsgator.com/; Microsoft Windows XP)" =>
393
+ { :type => :FeedReader, :name => :FeedDemon, :version => "2.7", :os_name => :Windows, :os_version => "XP", :platform => :Windows },
394
+ "FeedDemon/4.0 (http://www.feeddemon.com/; Microsoft Windows XP)" =>
395
+ { :type => :FeedReader, :name => :FeedDemon, :version => "4.0", :os_name => :Windows, :os_version => "XP", :platform => :Windows },
380
396
  "NewsFire/84 CFNetwork/454.11.5 Darwin/10.4.1 (i386) (iMac11%2C3)" =>
381
397
  { :type => :FeedReader, :name => :NewsFire, :version => "84", :os_name => :MacOSX, :os_version => "10.6.4", :platform => :Macintosh },
382
398
  "NetNewsWire/3.2b24 (Mac OS X; http://www.newsgator.com/Individuals/NetNewsWire/)" =>
@@ -401,6 +417,12 @@ describe Aua do
401
417
  { :type => :FeedReader, :name => :TumblrRSSSyndication, :version => "1.0", :os_name => nil, :os_version => nil, :platform => nil },
402
418
  "Reeder/1010.69.00 CFNetwork/520.3.2 Darwin/11.3.0 (x86_64) (MacBookPro6%2C2)" =>
403
419
  { :type => :FeedReader, :name => :Reeder, :version => "1010.69.00", :os_name => :Darwin, :os_version => "11.3.0", :platform => :Darwin },
420
+ "FeeddlerPro 1.12.5 (iPad; iPhone OS 6.1.3; de_DE)" =>
421
+ { :type => :FeedReader, :name => :FeeddlerPro, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
422
+ "FeeddlerRSS 1.12.5 (iPad; iPhone OS 6.1.3; de_DE)" =>
423
+ { :type => :FeedReader, :name => :FeeddlerRSS, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
424
+ "FreeRSSReader/1.9.5 CFNetwork/672.0.2 Darwin/14.0.0" =>
425
+ { :type => :FeedReader, :name => :FreeRSSReader, :version => "1.9.5", :os_name => :Darwin, :os_version => "14.0.0", :platform => :Darwin },
404
426
 
405
427
  # SearchBots
406
428
  "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" =>
@@ -419,6 +441,8 @@ describe Aua do
419
441
  { :type => :SearchBot, :name => :Googlebot, :version => "2.1", :os_name => nil, :os_version => nil, :platform => nil },
420
442
  "DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)" =>
421
443
  { :type => :SearchBot, :name => :GooglebotMobile, :version => "2.1", :os_name => nil, :os_version => nil, :platform => nil },
444
+ "FLUX-Toolchain/0.5 +http://odo.dwds.de/dwds-crawler.html" =>
445
+ { :type => :SearchBot, :name => :DWDSCrawler, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
422
446
 
423
447
  # Engine Fallbacks
424
448
  "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-au) AppleWebKit/533.19.4 (KHTML, like Gecko)" =>
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aua
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Munz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-18 00:00:00.000000000 Z
11
+ date: 2015-08-05 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
19
  version: '2.4'
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
26
  version: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: guard-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.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
40
  version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: growl
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rb-fsevent
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.9'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.9'
69
69
  description: aua = a user agent (parser).
@@ -73,8 +73,8 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
78
  - CHANGES.md
79
79
  - Gemfile
80
80
  - Guardfile
@@ -110,7 +110,8 @@ files:
110
110
  - spec/aua_spec.rb
111
111
  - spec/spec_helper.rb
112
112
  homepage: https://github.com/yolk/aua
113
- licenses: []
113
+ licenses:
114
+ - MIT
114
115
  metadata: {}
115
116
  post_install_message:
116
117
  rdoc_options: []
@@ -118,17 +119,17 @@ require_paths:
118
119
  - lib
119
120
  required_ruby_version: !ruby/object:Gem::Requirement
120
121
  requirements:
121
- - - '>='
122
+ - - ">="
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  requirements:
126
- - - '>='
127
+ - - ">="
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
131
  rubyforge_project: aua
131
- rubygems_version: 2.0.3
132
+ rubygems_version: 2.4.5
132
133
  signing_key:
133
134
  specification_version: 4
134
135
  summary: aua = a user agent (parser).