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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70876736be34082c5120b16cc242b3ccff6d4660
4
- data.tar.gz: f0af0b3fbb4be4387c7f81a64de51c194d579f91
3
+ metadata.gz: cda06c7f0ef3f1ee788b9bb19b4ebbeb89295fc3
4
+ data.tar.gz: 31bb3575df03d13697302fedf897ebb2018c3389
5
5
  SHA512:
6
- metadata.gz: c7d033f6645d478e0e71d6a488f9aa9f0e43f839c77973e6808b4e3444ebae1b5c3b6d81b15dddc552ccec29a579ab8452c6a33566451ca92ae7cda98f2562d6
7
- data.tar.gz: 6b54e7dd13ec639efad33b4be648c53f469ced01b66db358e24795b444bd11ec68d0008b352f77182b4ab059407d67e406094b774f76203934b268191c8780b1
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 ua
11
- puts "@agent.windows10? #=> #{@agent.windows10?}"
12
- puts "@agent.edge? #=> #{@agent.edge?}"
13
- puts "@agent.edge12? #=> #{@agent.edge12?}"
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
@@ -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
  }
@@ -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?(86_)?64)|i(3|6)86)/i
48
+ architecture: /(?<architecture>((?:x|x86_|amd|wow)64)|i(3|6)86)/i
49
49
  }
50
50
  }
51
51
  end
@@ -1,3 +1,3 @@
1
1
  module Browserino
2
- VERSION = "1.5.1.1"
2
+ VERSION = "1.5.2"
3
3
  end
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.1.1
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-23 00:00:00.000000000 Z
11
+ date: 2015-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler