rack-simple_user_agent 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/README.md +8 -4
- data/lib/rack/simple_user_agent/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba7fef2f942164b42f111eaab0271530cf64af4
|
4
|
+
data.tar.gz: 3ad5b568e8675cad9b5295394129346564d0390e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 700eb49a714b3aeb5e8a9ea4b9fbe2b2e6f204a9fb13be20bbfe69d0757d1b58cbe862aca8af4f8a45a700026ef8abc47d4779f9737e5296029724189333751d
|
7
|
+
data.tar.gz: c8b6382f6e1dbf6b2a9a819d116ec7c6ae01886cef77d272d2c56821a5b526793df0357ba36f4cf45bc183d849d0124f4054845e5415b7f5c511d83375bbbd0d
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -5,11 +5,13 @@
|
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/github/toshimaru/rack-simple_user_agent/badge.svg)](https://coveralls.io/github/toshimaru/rack-simple_user_agent)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/toshimaru/rack-simple_user_agent/badges/gpa.svg)](https://codeclimate.com/github/toshimaru/rack-simple_user_agent)
|
7
7
|
|
8
|
-
Rack::SimpleUserAgent is Rack::Request extension which detects
|
8
|
+
Rack::SimpleUserAgent is Rack::Request extension which detects user-agent from request user-agent string. No complicated logic for the detection, it simply(stupidly) checks if user-agent includes particular string.
|
9
|
+
|
10
|
+
**[ANNOUNCEMENT] Current `request.from_smartphone?` behavior is going to be changed in the next version. Please don't use `request.from_smartphone?`, use `request.from_smartphone?`, `request.from_android?` instead depending on the use case.**
|
9
11
|
|
10
12
|
## Installation
|
11
13
|
|
12
|
-
Add this line to your application's Gemfile
|
14
|
+
Add this line to your application's `Gemfile`:
|
13
15
|
|
14
16
|
```ruby
|
15
17
|
gem 'rack-simple_user_agent'
|
@@ -19,7 +21,9 @@ gem 'rack-simple_user_agent'
|
|
19
21
|
|
20
22
|
### on Rails
|
21
23
|
|
22
|
-
|
24
|
+
Installing `rack-simple_user_agent` automatically makes all detection methods available. These methods are useful when you use the Rails' [Action Pack Variants](http://guides.rubyonrails.org/4_1_release_notes.html#action-pack-variants) (as of Rails4.1).
|
25
|
+
|
26
|
+
For example, you can use below detection methods in your Rails application.
|
23
27
|
|
24
28
|
- `request.from_smartphone?`
|
25
29
|
- `request.from_android?`
|
@@ -49,7 +53,7 @@ request ── from_smartphone?
|
|
49
53
|
│ ├── from_android?
|
50
54
|
│ │ ├── from_android_mobile?
|
51
55
|
│ │ └── from_android_tablet?
|
52
|
-
│ ├──
|
56
|
+
│ ├── from_ios?
|
53
57
|
│ │ ├── from_ipad?
|
54
58
|
│ │ ├── from_iphone?
|
55
59
|
│ │ └── from_ipod?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-simple_user_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toshimaru
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.5.1
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Rack::SimpleUserAgent is stupidly simple UA detector
|