rails_request_parser 0.1.3 → 0.1.4
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 +4 -4
- data/README.md +1 -0
- data/lib/rails_request_parser.rb +4 -0
- data/lib/rails_request_parser/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: a0df5aa606a73f07a6c1208435a51f65069afd66
|
4
|
+
data.tar.gz: c5856e7086c28c9225aca280dd8fd14e3c99cbcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4a2b36c2b7c59a4cd575d8a9f7e97999cf4e128fc80b51b4984ced8fd892cab20c6e3defbf4359219e1441b3ddafc3a31d6569cfafd4061316a72f25cb47293
|
7
|
+
data.tar.gz: 323c79deabbb63bc660a8e9b31040e2988d0f4eb6a2f481a54b80fe4b3e650a354df3bda531a39de2c7b0683c018f1025e364ec4b79473bdcb81228425c5aa95
|
data/README.md
CHANGED
@@ -20,6 +20,7 @@ $ gem install rails_request_parser
|
|
20
20
|
```ruby
|
21
21
|
request_parser = RailsRequestParser.new(request)
|
22
22
|
request_parser.is_mac_os? #=> true
|
23
|
+
request_parser.is_electron_client? #=> true
|
23
24
|
request_parser.is_windows_os? #=> false
|
24
25
|
request_parser.is_chrome_browser? #=> true
|
25
26
|
```
|
data/lib/rails_request_parser.rb
CHANGED
@@ -9,6 +9,10 @@ class RailsRequestParser
|
|
9
9
|
chrome = 'Chrome'.freeze
|
10
10
|
return UserAgentParser.parse(@request.user_agent).family == chrome
|
11
11
|
end
|
12
|
+
def is_electron_client?
|
13
|
+
electron = 'Electron'.freeze
|
14
|
+
return @request.user_agent.include? electron
|
15
|
+
end
|
12
16
|
def is_mac_os?
|
13
17
|
mac = 'Mac'.freeze
|
14
18
|
UserAgentParser.parse(@request.user_agent).os.to_s.include? mac
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_request_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Gesualdo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|