From 319d75fdf5a0158d8a992c68f1cd8b96b7106ca7 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 12 Dec 2014 18:35:14 +0100 Subject: [PATCH] added sidekiq/web --- Gemfile | 1 + Gemfile.lock | 7 +++++++ config/routes.rb | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/Gemfile b/Gemfile index 358516a4..4322d230 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ gem 'rails_admin' gem 'twitter' gem 'sidekiq' +gem 'sinatra', require: false gem 'questiongenerator', git: 'https://github.com/justask/questiongenerator.git' diff --git a/Gemfile.lock b/Gemfile.lock index d3f7746f..c68728f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -140,6 +140,8 @@ GEM rack-pjax (0.8.0) nokogiri (~> 1.5) rack (~> 1.1) + rack-protection (1.5.3) + rack rack-test (0.6.2) rack (>= 1.0) rails (4.1.8) @@ -223,6 +225,10 @@ GEM multi_json (~> 1.0) simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + sinatra (1.4.5) + rack (~> 1.4) + rack-protection (~> 1.4) + tilt (~> 1.3, >= 1.3.4) spring (1.2.0) sprockets (2.12.3) hike (~> 1.2) @@ -308,6 +314,7 @@ DEPENDENCIES sdoc (~> 0.4.1) sidekiq simplecov + sinatra spring thin turbolinks diff --git a/config/routes.rb b/config/routes.rb index 9023408f..81fe8d51 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,12 @@ +require 'sidekiq/web' Rails.application.routes.draw do mount RailsAdmin::Engine => '/justask_admin', as: 'rails_admin' + constraints ->(req) { req.env["warden"].authenticate?(scope: :user) && + req.env['warden'].user.admin? } do + mount Sidekiq::Web, at: "/sidekiq" + end + get 'notifications/index' root 'static#index'