browserino 1.5.1.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/bin/console +5 -25
- data/lib/browserino/alias.rb +2 -2
- data/lib/browserino/patterns.rb +2 -2
- data/lib/browserino/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cda06c7f0ef3f1ee788b9bb19b4ebbeb89295fc3
|
4
|
+
data.tar.gz: 31bb3575df03d13697302fedf897ebb2018c3389
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 134840ea0b376bbc780aba84526584cdaa20f3be195991fbe4dfe4caa3572c97b54586a5aea1523f9bf4d9a1b63952108c4c5bc77f1b1da9934b03a506d9089b
|
7
|
+
data.tar.gz: 240cbddb276e5d864d64f4d88db2866538c19f7b63d56f6615467b85968de43cef08f18ab457daca935f4f93497abc55f5abe3d2ca3739bc38cf8971e6e4b667
|
data/README.md
CHANGED
@@ -9,6 +9,12 @@ This gem aims to provide information about the browser that your visitor is usin
|
|
9
9
|
## Changelog
|
10
10
|
_dates are in dd-mm-yyyy format_
|
11
11
|
|
12
|
+
#### 31-12-2015 VERSION 1.5.2
|
13
|
+
|
14
|
+
- Added user agents
|
15
|
+
- Patterns could falsely identify a 64bit system, made the pattern more strict
|
16
|
+
- using `X11` in a user agent as a synonym to a `#linux?` system
|
17
|
+
|
12
18
|
#### 23-12-2015 VERSION 1.5.1.1
|
13
19
|
|
14
20
|
- Removed print statements from method
|
@@ -46,6 +52,7 @@ _dates are in dd-mm-yyyy format_
|
|
46
52
|
|
47
53
|
## Installation
|
48
54
|
|
55
|
+
*supports ruby 1.9.3+*
|
49
56
|
Add this line to your application's Gemfile:
|
50
57
|
|
51
58
|
```ruby
|
@@ -168,7 +175,7 @@ agent.not.maxthon?
|
|
168
175
|
|
169
176
|
```
|
170
177
|
|
171
|
-
Since linux doesn't have any supported versions all you can pretty much do is check if `agent.linux?` is true if you want to check for linux systems. The others do have versions so if you wanted to check for windows 10 you could do:
|
178
|
+
Since linux doesn't have any supported versions all you can pretty much do is check if `agent.linux?` is true if you want to check for linux systems. Also - `X11` in a user agent string will now also cause the OS to be set to linux. The others do have versions so if you wanted to check for windows 10 you could do:
|
172
179
|
|
173
180
|
```ruby
|
174
181
|
agent.windows10?
|
data/bin/console
CHANGED
@@ -7,30 +7,10 @@ require "pry"
|
|
7
7
|
ua = 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'
|
8
8
|
@agent = Browserino::parse(ua)
|
9
9
|
|
10
|
-
puts
|
11
|
-
puts "
|
12
|
-
puts "
|
13
|
-
puts "
|
10
|
+
puts "> @agent variable available parsed with: 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'\n\n"
|
11
|
+
puts "> You can create a fresh object by using\n"
|
12
|
+
puts "> Browserino::parse((string) ua, (any) unknown_alt = nil)\n\n"
|
13
|
+
puts "> ua - The user agent you'd actually want to parse as a string"
|
14
|
+
puts "> unknown_alt - A default value for unknown properties, default nil\n\n"
|
14
15
|
|
15
|
-
# puts "parsed #{ua} with results:"
|
16
|
-
# puts '------------------'
|
17
|
-
# puts '| browser |'
|
18
|
-
# puts '------------------'
|
19
|
-
# puts @agent.browser_name
|
20
|
-
# puts @agent.browser_version
|
21
|
-
# puts '------------------'
|
22
|
-
# puts '| engine |'
|
23
|
-
# puts '------------------'
|
24
|
-
# puts @agent.engine_name
|
25
|
-
# puts @agent.engine_version
|
26
|
-
# puts '------------------'
|
27
|
-
# puts '| system |'
|
28
|
-
# puts '------------------'
|
29
|
-
# puts @agent.system_name
|
30
|
-
# puts @agent.system_name(full: true)[1]
|
31
|
-
# puts @agent.system_version
|
32
|
-
# puts @agent.system_architecture
|
33
|
-
# puts '================='
|
34
|
-
# puts 'the @agent variable will be available at your disposal'
|
35
|
-
#
|
36
16
|
Pry.start
|
data/lib/browserino/alias.rb
CHANGED
@@ -16,13 +16,13 @@ module Browserino
|
|
16
16
|
},
|
17
17
|
system_name: {
|
18
18
|
Browserino::UNKNOWN => ['unknown', :unknown, '', nil],
|
19
|
-
'linux' => ['ubuntu']
|
19
|
+
'linux' => ['ubuntu', 'x11']
|
20
20
|
},
|
21
21
|
system_version: {
|
22
22
|
Browserino::UNKNOWN => ['unknown', :unknown, '', nil]
|
23
23
|
},
|
24
24
|
system_architecture: {
|
25
|
-
'x64' => ['64', 'x86_64'],
|
25
|
+
'x64' => ['64', 'x86_64', 'amd64', 'wow64'],
|
26
26
|
'x32' => ['32', 'i686', 'i383', 'x86_32'],
|
27
27
|
Browserino::UNKNOWN => ['unknown', :unknown, '', nil]
|
28
28
|
}
|
data/lib/browserino/patterns.rb
CHANGED
@@ -43,9 +43,9 @@ module Browserino
|
|
43
43
|
},
|
44
44
|
|
45
45
|
operating_system: {
|
46
|
-
name: /(?<name>windows|macintosh|android|ios|linux|ubuntu)/i,
|
46
|
+
name: /(?<name>windows|macintosh|android|ios|linux|ubuntu|x11)/i,
|
47
47
|
version: /(?:nt|mac\sos\sx|android|(cpu\s|i)os)\s(?<version>[\d\._]+)/i,
|
48
|
-
architecture: /(?<architecture>(x
|
48
|
+
architecture: /(?<architecture>((?:x|x86_|amd|wow)64)|i(3|6)86)/i
|
49
49
|
}
|
50
50
|
}
|
51
51
|
end
|
data/lib/browserino/version.rb
CHANGED
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: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sidney Liebrand
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|