rack-body_classes 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/body_classes.rb +1 -0
- data/lib/rack/body_classes/version.rb +1 -1
- data/spec/rack/body_classes_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88ac398d3e59613aa3bcadaac5ff3457531b44eb
|
4
|
+
data.tar.gz: 2d48235a57572d55a2849c23cd6c617d3e0b68f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 187db5543f8d3b6628c02e8b8168f60e2da92ad3bf90479a5c43ecf515f8c1a290c20fe920222cc76f0318845c681ddbf40c791d4e0768b138939275afce1b96
|
7
|
+
data.tar.gz: 931010e2a2410ffcde8b22b51450056ffbb1fca1550e1347e44aa38378352c52b129b0f30058891c524ebdff06b62c8e1f453b5aec380106423e1d98693c6f90
|
data/lib/rack/body_classes.rb
CHANGED
@@ -22,6 +22,7 @@ module Rack
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def mobile_esp(user_agent, http_accept)
|
25
|
+
return 'unknown-device' if user_agent.nil? || http_accept.nil?
|
25
26
|
mobileesp = MobileESPConverted::UserAgentInfo.new(user_agent, http_accept)
|
26
27
|
return :mobile if mobileesp.is_tier_generic_mobile || mobileesp.is_tier_iphone || mobileesp.is_tier_rich_css
|
27
28
|
return :tablet if mobileesp.is_tier_tablet
|
@@ -6,6 +6,6 @@ require 'spec_helper'
|
|
6
6
|
describe Rack::BodyClasses do
|
7
7
|
it "returns body classes" do
|
8
8
|
get '/'
|
9
|
-
last_response.body.must_match(/<body class="
|
9
|
+
last_response.body.must_match(/<body class="unknown-device other other0"><\/body>/)
|
10
10
|
end
|
11
11
|
end
|
data/spec/spec_helper.rb
CHANGED