browserino 2.4.0 → 2.4.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: 4b5620248b55bb700730a80e4d7276148081f686
4
- data.tar.gz: 99d49e62bed9ddecd80d47e0ba16cf929b85624c
3
+ metadata.gz: c58d55e8c15365a92c63a6c464a64cd4ad79260c
4
+ data.tar.gz: abbb4b0806e32aa727a6769cf68ceb31c03c746d
5
5
  SHA512:
6
- metadata.gz: 120db10d8fae325502dec215a8c2e960afac7bd4f37c663b53a1b13d9a4ecc3deed381c9fd23e3009cac333eb06d11f4ad677b1edc6f791afa9fb3b8c1176aca
7
- data.tar.gz: c209b683298709e503ce623a5d4e02010a333c95befbf49f5ae2152185557e50abd4d9e877327ffa7ac32f0aa29d1245408b1bc09545878c80f442fed7b5a534
6
+ metadata.gz: 798a7afcf5a6ac1430ed5fbd4fd062275af0508b691e1de2654824be326a1e298fc47178b561e461966742093f7b6312e002472d928447f54c138cf5871c1177
7
+ data.tar.gz: e124a8e7e7ae67b344950fb8ae2e4d226f64c896d9178bc937bea132266b4ad4d4e426f52db0da3938e9c21f955f831ca13df37ad0f3a587ef69f91390d248d1
data/.travis.yml CHANGED
@@ -1,10 +1,8 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
4
  - 2.2.1
4
5
  - 2.1.0
5
6
  - 2.0.0
6
7
  - 1.9.3
7
- before_install: gem install bundler -v 1.10.5
8
-
9
- cache: bundler
10
8
  script: 'bundle exec rspec spec'
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## CHANGELOG
2
2
  _dates are in dd-mm-yyyy format_
3
3
 
4
+ #### 04-01-2016 VERSION 2.2.0
5
+
6
+ - Added more bots
7
+ - `#bot?` method can now take a bot name as argument to check for an exact bot
8
+
4
9
  #### 04-01-2016 VERSION 2.1.0
5
10
 
6
11
  - Small restructuring of test suite
data/README.md CHANGED
@@ -10,6 +10,11 @@ This gem aims to provide information about the browser that your visitor is usin
10
10
  _dates are in dd-mm-yyyy format_
11
11
  _older changes can be found in the [CHANGELOG.md](https://github.com/SidOfc/browserino/blob/master/CHANGELOG.md)_
12
12
 
13
+ #### 11-01-2016 VERSION 2.4.1
14
+
15
+ - Caching the agent object in Rails
16
+ - **DEPRECATE** Using a custom return value for when a property isn't found
17
+
13
18
  #### 10-01-2016 VERSION 2.4.0
14
19
 
15
20
  - Added rails integration
@@ -21,11 +26,6 @@ _older changes can be found in the [CHANGELOG.md](https://github.com/SidOfc/brow
21
26
  - Added `#locale` method
22
27
  - Empty UA's are identified as bots through `#bot?`
23
28
 
24
- #### 04-01-2016 VERSION 2.2.0
25
-
26
- - Added more bots
27
- - `#bot?` method can now take a bot name as argument to check for an exact bot
28
-
29
29
  ## Installation
30
30
 
31
31
  *supports ruby 1.9.3+*
@@ -4,7 +4,7 @@ module Browserino
4
4
  class ActionController
5
5
  module Base
6
6
  def agent
7
- Browserino::parse request.headers['User-Agent']
7
+ @agent ||= Browserino::parse(request.headers['User-Agent'])
8
8
  end
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module Browserino
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
data/lib/browserino.rb CHANGED
@@ -22,8 +22,11 @@ require "browserino/operating_system"
22
22
  # require_relative "../spec/user_agents_browsers"
23
23
 
24
24
  module Browserino
25
- def self.parse(ua, unknown_alt = UNKNOWN)
26
- Agent.new(ua, unknown_alt)
25
+ def self.parse(ua, unknown_alt = nil)
26
+ if unknown_alt
27
+ puts "The feature for using a custom return value is deprecated and will be removed in a future release. For now, your value will be ignored and nil will be the return value for unknown properties."
28
+ end
29
+ Agent.new(ua, UNKNOWN)
27
30
  end
28
31
 
29
32
  private
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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sidney Liebrand
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-10 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler