diff --git a/Gemfile b/Gemfile index bab09cb1..36a38603 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ source :rubygems gem 'puma' gem 'rack-ssl', '~> 1.3' gem 'rack-cache' +gem 'rack-mobile-detect' gem 'sinatra' group :assets do diff --git a/Gemfile.lock b/Gemfile.lock index c96df17b..a1571259 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/livingsocial/rake-pipeline.git - revision: ae0795842a8958934d872a005d18b16161aa05fe + revision: 50b8d77b703c96539a433ee53a680c43542aaa75 specs: rake-pipeline (0.8.0) json @@ -37,7 +37,7 @@ GEM foreman (0.60.2) thor (>= 0.13.6) fssm (0.2.9) - gli (2.5.0) + gli (2.5.2) guard (1.5.4) listen (>= 0.4.2) lumberjack (>= 1.0.2) @@ -61,7 +61,7 @@ GEM lumberjack (1.0.2) method_source (0.8.1) mime-types (1.19) - multi_json (1.4.0) + multi_json (1.5.0) pry (0.9.10) coderay (~> 1.0.5) method_source (~> 0.8) @@ -71,13 +71,15 @@ GEM rack (1.4.1) rack-cache (1.2) rack (>= 0.4) - rack-protection (1.2.0) + rack-mobile-detect (0.4.0) + rack + rack-protection (1.3.2) rack rack-ssl (1.3.2) rack rack-test (0.6.2) rack (>= 1.0) - rake (0.9.5) + rake (0.9.6) rake-pipeline-i18n-filters (0.0.5) rake-pipeline (~> 0.6) rb-fsevent (0.9.2) @@ -89,7 +91,7 @@ GEM rspec-core (~> 2.12.0) rspec-expectations (~> 2.12.0) rspec-mocks (~> 2.12.0) - rspec-core (2.12.1) + rspec-core (2.12.2) rspec-expectations (2.12.0) diff-lcs (~> 1.1.3) rspec-mocks (2.12.0) @@ -128,6 +130,7 @@ DEPENDENCIES localeapp-handlebars_i18n puma rack-cache + rack-mobile-detect rack-ssl (~> 1.3) rake (~> 0.9.2) rake-pipeline! diff --git a/config.ru b/config.ru index f9997d8e..adbdbda8 100644 --- a/config.ru +++ b/config.ru @@ -5,6 +5,8 @@ ENV['RAILS_ENV'] = ENV['RACK_ENV'] $: << 'lib' require 'travis/web' +use Rack::MobileDetect, :redirect_to => ENV['MOBILE_ENDPOINT'] if ENV['MOBILE_ENDPOINT'] + use Travis::Web::SetToken use Travis::Web::Allow use Travis::Web::ApiRedirect do |app|