mobile-fu-uncommon 1.3.2 → 1.3.3
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/lib/mobile-fu/version.rb +1 -1
- data/lib/mobile-fu.rb +6 -6
- 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: 9e67d30324f7a7c5f130f40a5b12367e3a850471
|
4
|
+
data.tar.gz: 15460da6f6595b374aa9e4c6d276ce517c307e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22898c6a6cc837b91546b787d6d526ef76c0fc737299d0bece767134b3be85ebfc4af3b186a2092ffc1c131d957d18c6fb74cf0db2432e0c8d168abda7cd6713
|
7
|
+
data.tar.gz: d03ceab7dbbe02786f09f6a852e86b0a9acad30d68589210bdb77ebc1ef2549dc732cfac54d58c838e332633a05837d1fd877c7b0ffa0e025ddcf619b66e6596
|
data/lib/mobile-fu/version.rb
CHANGED
data/lib/mobile-fu.rb
CHANGED
@@ -81,7 +81,7 @@ module ActionController
|
|
81
81
|
# end
|
82
82
|
# end
|
83
83
|
def has_no_mobile_fu_for(*actions)
|
84
|
-
@
|
84
|
+
@mobile_except_actions = actions
|
85
85
|
end
|
86
86
|
|
87
87
|
# Add this to your controllers to only let those actions use the mobile format
|
@@ -111,17 +111,17 @@ module ActionController
|
|
111
111
|
if mobile_action? && !request.xhr?
|
112
112
|
if tablet_enabled? && is_tablet_device?
|
113
113
|
prepend_view_path tablet_views_path
|
114
|
-
if
|
114
|
+
if request_format_enabled? && (request.formats.first == Mime::HTML) || (request.formats.first == Mime::ALL)
|
115
115
|
request.formats.prepend(Mime::TABLET)
|
116
116
|
end
|
117
117
|
elsif mobile_enabled? && is_mobile_device?
|
118
118
|
prepend_view_path mobile_views_path
|
119
|
-
if
|
119
|
+
if request_format_enabled? && (request.formats.first == Mime::HTML) || (request.formats.first == Mime::ALL)
|
120
120
|
request.formats.prepend(Mime::MOBILE)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
if !
|
124
|
+
if !request_format_enabled? && (request.formats.first == Mime::MOBILE) || (request.formats.first == Mime::TABLET)
|
125
125
|
request.format = :html
|
126
126
|
end
|
127
127
|
else
|
@@ -147,7 +147,7 @@ module ActionController
|
|
147
147
|
mobile_enabled? && mobile_action? && !request.xhr?
|
148
148
|
end
|
149
149
|
|
150
|
-
def
|
150
|
+
def request_format_enabled?
|
151
151
|
# raise "You must owerride this method"
|
152
152
|
true
|
153
153
|
end
|
@@ -188,7 +188,7 @@ module ActionController
|
|
188
188
|
# Returns true if current action isn't supposed to use mobile format
|
189
189
|
# See #has_no_mobile_fu_for
|
190
190
|
def mobile_exempt?
|
191
|
-
self.class.instance_variable_get("@
|
191
|
+
self.class.instance_variable_get("@mobile_except_actions").try(:include?, params[:action].try(:to_sym))
|
192
192
|
end
|
193
193
|
end
|
194
194
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobile-fu-uncommon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendan Lim
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project: mobile-fu
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.6.7
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Automatically detect mobile requests from mobile devices in your Rails application.
|