lib/detect_mobiles.rb in aaalex-detect_mobiles-0.0.2 vs lib/detect_mobiles.rb in aaalex-detect_mobiles-0.0.3

- old
+ new

@@ -1,8 +1,7 @@ -# DetectMobiles - -module DetectMobiles +module Aaalex + module DetectMobiles def detect_mobiles case when is_request_from_iphone? request.format = :iphone logger.debug "detected iPhone -> request.format = :iphone" @@ -26,10 +25,9 @@ reg_arr.each do |reg_exp| return true if Regexp.new(reg_exp) =~ request.env["HTTP_USER_AGENT"] end return false end + end end -ActionController::Base.class_eval do - include DetectMobiles -end +ActionController::Base.send(:include, Aaalex::DetectMobiles)