browserino 2.11.0 → 2.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bb1caac98a86a257da42ab8895c252d0b95897c
4
- data.tar.gz: 060c339a30a43de5adb619bbbe17c7f2ddff5279
3
+ metadata.gz: 34b7633668c832d3f3727c704ea96c2da8be3929
4
+ data.tar.gz: 778d170f897c02ea20f85a81d5a7885c02be78b1
5
5
  SHA512:
6
- metadata.gz: f3b62f1d58837e25c1f597772e8c717fd0bb1c91101abfdedf1685a22423e450e5f5ec7b3116da15895e9635fd2120b799b9a509a6705abc454c0c494398f225
7
- data.tar.gz: 3d22b59114f7698213f003c48ffc244bc5e8e97912887215d40eaf7b6634449c1327c391cf2ba163e26a353675b908f1d7c51691f89ad083383ed5f5055f281d
6
+ metadata.gz: 8e451c64fb90b5c368e058fe08f9b7c93f789754c1405b6c43d8f116ca50918eb7a06a44b16ed122bd99f9af68d2fb3baba94232b8c7d0ee134eee641dda525e
7
+ data.tar.gz: c9dd4680a336660d4982eac3200da17f14fd8ce6c8cbbc83598133529cc57dcc735ff8e68551c7732d8efee06755d714b2dcc4b1746f0e060c132987e365398e
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## CHANGELOG
2
2
  _dates are in dd-mm-yyyy format_
3
3
 
4
+ #### 25-08-2016 VERSION 2.10.1
5
+
6
+ - Replaced `require` with `require_relative` where possible
7
+ - Fixed cli not loading due to failing `require`
8
+
4
9
  #### 24-07-2016 VERSION 2.10.0
5
10
 
6
11
  - Added support for the servo browser:
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Browserino
2
2
 
3
3
  A UserAgent sniffer with Rails >= 3.2.0 integration.
4
- The sniffer can currently identify 22 bots (of which 6 social media and 5 search engines), 14 browsers, 9 operating systems, 6 programming language UA's and 4 consoles.
4
+ The sniffer can currently identify 22 bots (of which 6 social media and 5 search engines), 16 browsers, 11 operating systems, 6 programming language UA's and 4 consoles.
5
5
 
6
6
  # DEPRECATION WARNING: Ruby < 2
7
7
 
8
- Browserino will be dropping support for Ruby versions less than 2 with the release of version `3.0.0`
8
+ Browserino will be dropping support for Ruby versions less than 2 with the release of version `3`
9
9
 
10
10
  ## Status
11
11
 
@@ -26,6 +26,24 @@ Useragent references:
26
26
  _dates are in dd-mm-yyyy format_
27
27
  _older changes can be found in the [CHANGELOG.md](CHANGELOG.md)_
28
28
 
29
+ #### 14-11-2016 VERSION 2.12.0
30
+
31
+ - Added support for SamsungBrowser
32
+ - Added `samsungbrowser?` method
33
+ - Added support for `:samsungbrowser` (`Symbol` and `String`) in methods
34
+ - Added support for Tizen
35
+ - Added `tizen?` method
36
+ - Added support for `:tizen` (`Symbol` and `String`) in methods
37
+ - Added support for WebOS
38
+ - Added `webos?` method
39
+ - Added support for `:webos` (`Symbol` and `String`) in methods
40
+ - Added support for WebOSBrowser
41
+ - Added `webosbrowser?` method
42
+ - Added support for `:webosbrowser` (`Symbol` and `String`) in methods
43
+ - Added Android Nougat (7.0 and 7.1) detection
44
+ - merged OS map files into _/core/mappings.rb_ and removed the _lib/maps_ folder
45
+ - Reduced amount of (overkill) tests
46
+
29
47
  #### 13-11-2016 VERSION 2.11.0
30
48
 
31
49
  - Add `:macos` alias for `:macintosh` systems.
@@ -38,11 +56,6 @@ _older changes can be found in the [CHANGELOG.md](CHANGELOG.md)_
38
56
  - Fix missing questionmarks on method names in the README.
39
57
  - Change gem homepage to io domain
40
58
 
41
- #### 25-08-2016 VERSION 2.10.1
42
-
43
- - Replaced `require` with `require_relative` where possible
44
- - Fixed cli not loading due to failing `require`
45
-
46
59
  ## Installation
47
60
 
48
61
  Add the following to your applications Gemfile:
@@ -65,7 +78,7 @@ $ gem install browserino
65
78
 
66
79
  Browserino is tested with the following ruby versions
67
80
 
68
- * 1.9.3 - **SUPPORT WILL BE DROPPED WITHIN THE NEXT VERSION**
81
+ * 1.9.3 - **SUPPORT WILL BE DROPPED IN THE NEXT MAJOR VERSION RELEASE**
69
82
  * 2.0.0
70
83
  * 2.1.0
71
84
  * 2.2.1
@@ -581,6 +594,8 @@ agent.library? :curl, version: 7.21
581
594
  * `safari`
582
595
  * `ie`
583
596
  * `edge`
597
+ * `samsungbrowser`
598
+ * `webosbrowser`
584
599
 
585
600
  Examples:
586
601
 
@@ -608,6 +623,8 @@ agent.browser? :chrome, version: 42
608
623
  * `ios`
609
624
  * `blackberry` or `bb`
610
625
  * `windows_phone`
626
+ * `tizen`
627
+ * `webos`
611
628
 
612
629
  Examples:
613
630
 
@@ -635,7 +652,7 @@ Notes:
635
652
  * `linux?` doesn't support any versions
636
653
  * `bsd?` doesn't support any versions
637
654
  * `solaris?` only supports numeric versions
638
- * *named versions* are only supported if they are present in a [map](https://github.com/SidOfc/browserino/tree/master/lib/browserino/maps)
655
+ * *named versions* are only supported if they are present in a [map](https://github.com/SidOfc/browserino/tree/master/lib/browserino/core/mapping.rb)
639
656
 
640
657
  ## Contributing
641
658
 
data/bin/console CHANGED
@@ -4,7 +4,7 @@ require 'bundler/setup'
4
4
  require 'browserino'
5
5
  require 'pry'
6
6
 
7
- ua = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko'
7
+ ua = 'Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.2; U; de-DE) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.40.1 Safari/534.6 TouchPad/1.0'
8
8
  @agent = Browserino.parse(ua)
9
9
 
10
10
  puts "> @agent variable available parsed with: '#{ua}'\n\n"
data/browserino.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  Documentation can be found on : https://github.com/SidOfc/browserino
25
25
  Changes can be found on : https://github.com/SidOfc/browserino/blob/master/CHANGELOG.md
26
- Deprecation notice : Browserino will be dropping support for Ruby versions less than 2 with the release of version 3.0.0
26
+ Deprecation notice : Browserino will be dropping support for Ruby versions less than 2 with the release of version 3
27
27
 
28
28
  }
29
29
 
@@ -7,7 +7,8 @@ module Browserino
7
7
  'solaris' => /s(?:unos|olaris)/,
8
8
  'linux' => /ubuntu|x11/,
9
9
  'windows_phone' => /windows\sphone/,
10
- 'ios' => /ip(?:[ao]d|hone)/
10
+ 'ios' => /ip(?:[ao]d|hone)/,
11
+ 'webos' => /w(?:eb)?os/
11
12
  },
12
13
  console_name: {
13
14
  'nintendo_ds' => /nintendo\s\d?ds/,
@@ -5,7 +5,8 @@ module Browserino
5
5
  [/9\.80/, /opera/i],
6
6
  [%r{(?:apple)?webkit/[\d\.]+}i, /presto/i],
7
7
  [/(?:ms)?ie/i, /rv:/i],
8
- [/linux/i, /android|s(?:unos|olaris)/i],
8
+ [/android/i, /tizen/i],
9
+ [/linux/i, /android|s(?:unos|olaris)|w(?:eb)?os|tizen/i],
9
10
  [/x11/i, /bsd|s(?:unos|olaris)/i],
10
11
  [/windows\snt/i, /windows\sphone/i]
11
12
  ].freeze
@@ -0,0 +1,78 @@
1
+ module Browserino
2
+ module Mapping
3
+ def self.const?(const)
4
+ constants(true).include?(const)
5
+ end
6
+
7
+ # Taken from https://en.wikipedia.org/wiki/Android_version_history
8
+ # 15 - 09 - 2015
9
+ ANDROID = {
10
+ '1.0' => [10],
11
+ '1.1' => [11],
12
+ 'Cupcake 3' => [15],
13
+ 'Cupcake 4' => [16],
14
+ 'Eclair 5' => [20],
15
+ 'Eclair 6' => [201],
16
+ 'Eclair 7' => [21],
17
+ 'Froyo 8' => [22, 221, 222, 223],
18
+ 'Gingerbread 9' => [23, 231, 232],
19
+ 'Gingerbread 10' => [233, 234, 235, 236, 237],
20
+ 'Honeycomb 11' => [30],
21
+ 'honeycomb 12' => [31],
22
+ 'Honeycomb 13' => [32, 321, 322, 323, 324, 325, 326],
23
+ 'Ice Cream Sandwich 14' => [40, 401, 402],
24
+ 'Ice Cream Sandwich 15' => [403, 404],
25
+ 'Jelly Bean 16' => [41, 411, 412],
26
+ 'Jelly Bean 17' => [42, 421, 422],
27
+ 'Jelly Bean 18' => [43, 431],
28
+ 'KitKat 19' => [44, 441, 442, 443, 444],
29
+ 'Lollipop 21' => [50, 501, 502],
30
+ 'Lollipop 22' => [51, 511],
31
+ 'Marshmallow 23' => [60, 601],
32
+ 'Nougat 24' => [70],
33
+ 'Nougat 25' => [71]
34
+ }.freeze
35
+
36
+ # Taken from https://nl.wikipedia.org/wiki/OS_X
37
+ # 15 - 09 - 2015
38
+ MACINTOSH = {
39
+ 'Cheetah' => [100],
40
+ 'Puma' => [101],
41
+ 'Jaguar' => [102],
42
+ 'Panther' => [103],
43
+ 'Tiger' => [104],
44
+ 'Leopard' => [105],
45
+ 'Snow Leopard' => [106],
46
+ 'Lion' => [107],
47
+ 'Mountain Lion' => [108],
48
+ 'Mavericks' => [109],
49
+ 'Yosemite' => [1010],
50
+ 'El Capitan' => [1011],
51
+ 'Sierra' => [1012]
52
+ }.freeze
53
+
54
+ # Taken from https://nl.wikipedia.org/wiki/Windows_NT
55
+ # 15 - 09 - 2015
56
+ WINDOWS = {
57
+ '3.1' => [31],
58
+ '3.5' => [35],
59
+ '4' => [40],
60
+ '2000' => [50],
61
+ 'XP' => [51, 52],
62
+ 'Vista' => [60],
63
+ '7' => [61],
64
+ '8' => [62],
65
+ '8.1' => [63],
66
+ '10' => [100]
67
+ }.freeze
68
+
69
+ TIZEN = {}.freeze
70
+ BLACKBERRY = {}.freeze
71
+ BSD = {}.freeze
72
+ IOS = {}.freeze
73
+ LINUX = {}.freeze
74
+ SOLARIS = {}.freeze
75
+ WEBOS = {}.freeze
76
+ WINDOWS_PHONE = {}.freeze
77
+ end
78
+ end
@@ -2,6 +2,16 @@ module Browserino
2
2
  module Core
3
3
  PATTERNS = {
4
4
  browser: {
5
+ samsungbrowser: {
6
+ name: /(?<name>samsungbrowser)/i,
7
+ version: %r{samsungbrowser/(?<version>[\d\.]+)}i
8
+ },
9
+
10
+ webosbrowser: {
11
+ name: /(?<name>w(?:eb)?os(?:browser)?)/i,
12
+ version: %r{w(?:eb)?osbrowser/(?<version>[\d\.]+)}i,
13
+ },
14
+
5
15
  vivaldi: {
6
16
  name: /(?<name>vivaldi)/i,
7
17
  version: %r{vivaldi/(?<version>[\d\.]+)}i
@@ -136,14 +146,15 @@ module Browserino
136
146
  operating_system: {
137
147
  name: /(?<name>windows(?:\sphone(?:\sos)?)?|macintosh|android
138
148
  |ip(?:[ao]d|hone)|blackberry|linux|ubuntu|x11|bsd
139
- |s(?:unos|olaris))/xi,
149
+ |s(?:unos|olaris)|w(?:eb)?os|tizen)/xi,
140
150
  version: %r{(?:windows(?:\sphone(?:\sos)?)?|nt|mac\sos\sx|android
141
151
  |(cpu\s|ip([ao]d|hone)\s)os|blackberry.*?version/|bb
142
- |s(?:unos|olaris)/?)\s?(?<version>[\d\._]+)}xi,
152
+ |s(?:unos|olaris)/?|w(?:eb)?os/|tizen)
153
+ \s?(?<version>[\d\._]+)}xi,
143
154
  architecture: /(?<architecture>((?:x|x86_|amd|wow)64)|i(3|6)86)/i,
144
- mobile: /bolt|nokia|samsung|mobi(?:le)?|android|i?p(?:[ao]d|hone)|bb\d+
145
- |blackberry|iemobile|fennec|bada|meego|vodafone
146
- |t\-mobile|opera\sm(?:ob|in)i/xi,
155
+ mobile: /bolt|nokia|samsung(?!b)|mobi(?:le)?|android|i?p(?:[ao]d|hone)
156
+ |bb\d+|blackberry|iemobile|fennec|bada|meego|vodafone|t\-mobile
157
+ |opera\sm(?:ob|in)i/xi,
147
158
  locale: /\s(?<locale>\w{2}(?:\-\w{2})?)[;\)]/
148
159
  },
149
160
 
@@ -1,3 +1,3 @@
1
1
  module Browserino
2
- VERSION = '2.11.0'.freeze
2
+ VERSION = '2.12.0'.freeze
3
3
  end
data/lib/browserino.rb CHANGED
@@ -1,14 +1,4 @@
1
- require_relative 'browserino/maps/mapping'
2
- require_relative 'browserino/maps/macintosh'
3
- require_relative 'browserino/maps/blackberry'
4
- require_relative 'browserino/maps/ios'
5
- require_relative 'browserino/maps/bsd'
6
- require_relative 'browserino/maps/linux'
7
- require_relative 'browserino/maps/solaris'
8
- require_relative 'browserino/maps/android'
9
- require_relative 'browserino/maps/windows'
10
- require_relative 'browserino/maps/windows_phone'
11
-
1
+ require_relative 'browserino/core/mapping'
12
2
  require_relative 'browserino/core/patterns'
13
3
  require_relative 'browserino/core/supported'
14
4
  require_relative 'browserino/core/questions'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browserino
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.0
4
+ version: 2.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sidney Liebrand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-13 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -153,22 +153,13 @@ files:
153
153
  - lib/browserino/core/alias.rb
154
154
  - lib/browserino/core/helpers.rb
155
155
  - lib/browserino/core/lies.rb
156
+ - lib/browserino/core/mapping.rb
156
157
  - lib/browserino/core/patterns.rb
157
158
  - lib/browserino/core/questions.rb
158
159
  - lib/browserino/core/supported.rb
159
160
  - lib/browserino/engine.rb
160
161
  - lib/browserino/integrate/action_controller.rb
161
162
  - lib/browserino/integrate/rails.rb
162
- - lib/browserino/maps/android.rb
163
- - lib/browserino/maps/blackberry.rb
164
- - lib/browserino/maps/bsd.rb
165
- - lib/browserino/maps/ios.rb
166
- - lib/browserino/maps/linux.rb
167
- - lib/browserino/maps/macintosh.rb
168
- - lib/browserino/maps/mapping.rb
169
- - lib/browserino/maps/solaris.rb
170
- - lib/browserino/maps/windows.rb
171
- - lib/browserino/maps/windows_phone.rb
172
163
  - lib/browserino/operating_system.rb
173
164
  - lib/browserino/unknown.rb
174
165
  - lib/browserino/version.rb
@@ -184,7 +175,7 @@ post_install_message: "\n Thanks for using Browserino!\n\n Documentation c
184
175
  be found on : https://github.com/SidOfc/browserino\n Changes can be found on
185
176
  \ : https://github.com/SidOfc/browserino/blob/master/CHANGELOG.md\n Deprecation
186
177
  notice : Browserino will be dropping support for Ruby versions less than
187
- 2 with the release of version 3.0.0\n\n "
178
+ 2 with the release of version 3\n\n "
188
179
  rdoc_options: []
189
180
  require_paths:
190
181
  - lib
@@ -1,31 +0,0 @@
1
- # Taken from https://en.wikipedia.org/wiki/Android_version_history
2
- # 15 - 09 - 2015
3
-
4
- module Browserino
5
- module Mapping
6
- ANDROID = {
7
- '1.0' => [10],
8
- '1.1' => [11],
9
- 'Cupcake 3' => [15],
10
- 'Cupcake 4' => [16],
11
- 'Eclair 5' => [20],
12
- 'Eclair 6' => [201],
13
- 'Eclair 7' => [21],
14
- 'Froyo 8' => [22, 221, 222, 223],
15
- 'Gingerbread 9' => [23, 231, 232],
16
- 'Gingerbread 10' => [233, 234, 235, 236, 237],
17
- 'Honeycomb 11' => [30],
18
- 'honeycomb 12' => [31],
19
- 'Honeycomb 13' => [32, 321, 322, 323, 324, 325, 326],
20
- 'Ice Cream Sandwich 14' => [40, 401, 402],
21
- 'Ice Cream Sandwich 15' => [403, 404],
22
- 'Jelly Bean 16' => [41, 411, 412],
23
- 'Jelly Bean 17' => [42, 421, 422],
24
- 'Jelly Bean 18' => [43, 431],
25
- 'KitKat 19' => [44, 441, 442, 443, 444],
26
- 'Lollipop 21' => [50, 501, 502],
27
- 'Lollipop 22' => [51, 511],
28
- 'Marshmallow 23' => [60, 601]
29
- }.freeze
30
- end
31
- end
@@ -1,5 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- BLACKBERRY = {}.freeze
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- BSD = {}.freeze
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- IOS = {}.freeze
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- LINUX = {}.freeze
4
- end
5
- end
@@ -1,22 +0,0 @@
1
- # Taken from https://nl.wikipedia.org/wiki/OS_X
2
- # 15 - 09 - 2015
3
-
4
- module Browserino
5
- module Mapping
6
- MACINTOSH = {
7
- 'Cheetah' => [100],
8
- 'Puma' => [101],
9
- 'Jaguar' => [102],
10
- 'Panther' => [103],
11
- 'Tiger' => [104],
12
- 'Leopard' => [105],
13
- 'Snow Leopard' => [106],
14
- 'Lion' => [107],
15
- 'Mountain Lion' => [108],
16
- 'Mavericks' => [109],
17
- 'Yosemite' => [1010],
18
- 'El Capitan' => [1011],
19
- 'Sierra' => [1012]
20
- }.freeze
21
- end
22
- end
@@ -1,9 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- module_function
4
-
5
- def const?(const)
6
- constants(true).include?(const)
7
- end
8
- end
9
- end
@@ -1,5 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- SOLARIS = {}.freeze
4
- end
5
- end
@@ -1,18 +0,0 @@
1
- # Taken from https://nl.wikipedia.org/wiki/Windows_NT
2
- # 15 - 09 - 2015
3
-
4
- module Browserino
5
- module Mapping
6
- WINDOWS = {
7
- '3.5' => [35],
8
- '4' => [40],
9
- '2000' => [50],
10
- 'XP' => [51, 52],
11
- 'Vista' => [60],
12
- '7' => [61],
13
- '8' => [62],
14
- '8.1' => [63],
15
- '10' => [100]
16
- }.freeze
17
- end
18
- end
@@ -1,5 +0,0 @@
1
- module Browserino
2
- module Mapping
3
- WINDOWS_PHONE = {}.freeze
4
- end
5
- end