mobylette 3.3 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -132,7 +132,7 @@ module Mobylette
|
|
132
132
|
# Private: Tells if the request comes from a mobile user_agent or not
|
133
133
|
#
|
134
134
|
def is_mobile_request?
|
135
|
-
request.user_agent.to_s.downcase =~ @@mobylette_options[:mobile_user_agents].call
|
135
|
+
(not user_agent_excluded?) && request.user_agent.to_s.downcase =~ @@mobylette_options[:mobile_user_agents].call
|
136
136
|
end
|
137
137
|
|
138
138
|
# Private: Returns if this request comes from the informed device
|
@@ -154,15 +154,13 @@ module Mobylette
|
|
154
154
|
#
|
155
155
|
def respond_as_mobile?
|
156
156
|
impediments = stop_processing_because_xhr? || stop_processing_because_param?
|
157
|
-
(not impediments) && (force_mobile_by_session? ||
|
157
|
+
(not impediments) && (force_mobile_by_session? || is_mobile_request? || params[:format] == 'mobile')
|
158
158
|
end
|
159
159
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
def user_agent_included?
|
165
|
-
request.user_agent.to_s.downcase !~ Regexp.union([self.mobylette_options[:skip_user_agents]].flatten.map(&:to_s))
|
160
|
+
# Private: Rertuns true if the current user agent should be skipped by configuration
|
161
|
+
#
|
162
|
+
def user_agent_excluded?
|
163
|
+
request.user_agent.to_s.downcase =~ Regexp.union([self.mobylette_options[:skip_user_agents]].flatten.map(&:to_s))
|
166
164
|
end
|
167
165
|
|
168
166
|
# Private: Returns true if the visitor has the force_mobile set in it's session
|
data/lib/mobylette/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -30,3 +30,14 @@ DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any
|
|
30
30
|
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
31
31
|
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
32
32
|
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
33
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
34
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
35
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
36
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
37
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
38
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
39
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
40
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
41
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
42
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
43
|
+
DEPRECATED > Mobylette: Please don't user :fall_back to configure fall backs any more. See the README for :fallback_chains instead.
|
@@ -189,7 +189,7 @@ module Mobylette
|
|
189
189
|
subject.stub(:stop_processing_because_xhr?).and_return(false)
|
190
190
|
subject.stub(:stop_processing_because_param?).and_return(false)
|
191
191
|
subject.stub(:force_mobile_by_session?).and_return(false)
|
192
|
-
subject.stub(:is_mobile_request?).and_return(true)
|
192
|
+
#subject.stub(:is_mobile_request?).and_return(true)
|
193
193
|
subject.stub(:params).and_return({})
|
194
194
|
request = double("request", user_agent: "ipad")
|
195
195
|
subject.stub(:request).and_return(request)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobylette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -177,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
segments:
|
179
179
|
- 0
|
180
|
-
hash:
|
180
|
+
hash: 2076300502211513819
|
181
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
version: '0'
|
187
187
|
segments:
|
188
188
|
- 0
|
189
|
-
hash:
|
189
|
+
hash: 2076300502211513819
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
192
|
rubygems_version: 1.8.24
|