device_detector 0.9.0 → 0.9.1

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: 436bad611848de9243a2d405a28991780ebe86cf
4
- data.tar.gz: d25b0cadb1959e32e1a2adf362c246d5f77b7050
3
+ metadata.gz: 09c952f196436a80a8fd715b5e288150a5c57b60
4
+ data.tar.gz: 6d76a5d6205fc496dce0620b9ba9a61d7b701c56
5
5
  SHA512:
6
- metadata.gz: 6a03c4141c003f03a5cc30a37ecb39fe26bddfbcee014867f96af8f2504f6abaa4bddc766c5236b5d7381b486611b3f5d6eb9bfa195a1756bcfa885e08e3a6bd
7
- data.tar.gz: d53a0a43694c932854c149fac2af81be4c8bf5e0b427c0c523c6fc2aef060db183d650619c25f1cb531cd0abea07f986fd5a6169edd8c716c9ae89077c016408
6
+ metadata.gz: 57244e7078da923413102dade915b10b8b0e3287d3f3b41fd111302ee48d64713295d11a5f68a0f6e7cc5faf623b0caf773094eca5e44349d3b388e07b402f61
7
+ data.tar.gz: bc96dae6295d954e8b40ba1591c6bd1049b1e64f3aa853fda10c99c5d79a59e3db947feecd3f23466a151e13a2d02f898c6980e37c08e696adcaf83e86e4e14f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.9.1]
4
+ - Removed regexp warnings in Ruby 2.2.4+. Thanks to [mkdynamic](https://github.com/mkdynamic)
5
+
3
6
  ## [0.9.0]
4
7
  - Preparing for the 1.0.0 release. This version (with minor bumps) will be promoted to 1.0.0 once the release has been proven stable
5
8
  - Updated regex files from upstream
data/README.md CHANGED
@@ -47,7 +47,7 @@ client.os_full_version # => '8'
47
47
 
48
48
  # For many devices, you can also query the device name (usually the model name)
49
49
  client.device_name # => 'iPhone 5'
50
- # Device types can be one of the following: smartphone, tablet, console,
50
+ # Device types can be one of the following: smartphone, tablet, console,
51
51
  # portable media player, tv, car browser, camera
52
52
  client.device_type # => 'smartphone'
53
53
  ```
@@ -152,12 +152,14 @@ Updated on 2016-07-16
152
152
 
153
153
  - Mati Sojka: https://github.com/yagooar
154
154
  - Ben Zimmer: https://github.com/benzimmer
155
+ - Peter Gao: https://github.com/peteygao
155
156
 
156
157
  ## Contributors
157
158
 
158
159
  Thanks a lot to the following contributors:
159
160
 
160
- - Peter Gao: https://github.com/peteygao
161
+ - Dennis Wu: https://github.com/dnswus
162
+ - Mark Dodwell: https://github.com/mkdynamic
161
163
 
162
164
  ## Contributing
163
165
 
@@ -3,7 +3,8 @@ class DeviceDetector
3
3
 
4
4
  DEFAULT_MAX_KEYS = 5000
5
5
 
6
- attr_reader :data, :max_keys
6
+ attr_reader :data, :max_keys, :lock
7
+ private :lock
7
8
 
8
9
  def initialize(config)
9
10
  @data = {}
@@ -39,8 +40,6 @@ class DeviceDetector
39
40
 
40
41
  private
41
42
 
42
- attr_reader :lock
43
-
44
43
  def purge_cache
45
44
  key_size = data.size
46
45
 
@@ -1,3 +1,3 @@
1
1
  class DeviceDetector
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
@@ -1444,7 +1444,7 @@ Sony:
1444
1444
  - regex: '(?:Sony-)?(KDL?-?[0-9a-z]+)'
1445
1445
  model: '$1'
1446
1446
  device: 'tv'
1447
- - regex: 'Opera TV Store.*(?:Sony-)([0-9a-z-_]+)'
1447
+ - regex: 'Opera TV Store.*(?:Sony-)([0-9a-z\-_]+)'
1448
1448
  model: '$1'
1449
1449
  device: 'tv'
1450
1450
  - regex: '((?:WT|SO|ST|SK|MK)[0-9]+[a-z]*[0-9]*)(?: Build|\))'
@@ -3001,14 +3001,14 @@ Ouki:
3001
3001
 
3002
3002
  # Overmax
3003
3003
  Overmax:
3004
- regex: 'OV-[a-z]+(?:[^;/]+)? Build'
3004
+ regex: 'OV-[a-z]+(?:[^;/]*) Build'
3005
3005
  device: 'tablet'
3006
3006
  models:
3007
3007
  - regex: 'OV-Vertis-([^;/]+) Build'
3008
3008
  model: 'OV-Vertis-$1'
3009
3009
  device: 'smartphone'
3010
3010
 
3011
- - regex: '(OV-[a-z]+(?:[^;/]+)?) Build'
3011
+ - regex: '(OV-[a-z]+(?:[^;/]*)) Build'
3012
3012
  model: '$1'
3013
3013
 
3014
3014
  # Oysters
@@ -4089,7 +4089,7 @@ Toplux:
4089
4089
 
4090
4090
  # Trevi
4091
4091
  Trevi:
4092
- regex: 'Trevi[ _]|TAB[ _]10[ _]3G[ _]V16|TAB[ _](7|8)[ _]3G[ _]V8|TAB9 3G|MINITAB 3GV|Phablet[ _](?:4|4\.5|5|5\,3|6)[ _]?[C|S|Q]|REVERSE[ _]5\.5[ _]?Q'
4092
+ regex: 'Trevi[ _]|TAB[ _]10[ _]3G[ _]V16|TAB[ _](7|8)[ _]3G[ _]V8|TAB9 3G|MINITAB 3GV|Phablet[ _](?:4|4\.5|5|5\,3|6)[ _]?[CSQ]|REVERSE[ _]5\.5[ _]?Q'
4093
4093
  device: 'tablet'
4094
4094
  models:
4095
4095
  - regex: 'TAB[ _]?(7|8)[ _]3G[ _]V8'
@@ -20,8 +20,6 @@ describe DeviceDetector do
20
20
  user_agent = f["user_agent"]
21
21
  detector = DeviceDetector.new(user_agent)
22
22
  os = detector.send(:os)
23
- device = detector.send(:device)
24
- regex_meta = device.send(:regex_meta)
25
23
 
26
24
  describe user_agent do
27
25
  it "should be detected" do
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'minitest/spec'
2
1
  require 'minitest/autorun'
2
+ require 'minitest/spec'
3
3
 
4
4
  $:.unshift(File.expand_path('../../lib', __FILE__))
5
5
  require 'device_detector'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: device_detector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mati Sójka
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-28 00:00:00.000000000 Z
12
+ date: 2016-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest