5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 00:46:21 +00:00

rack-mini-profiler

This commit is contained in:
f 2020-05-11 18:56:42 -03:00
parent b4fc837ecb
commit d63f7a75e9
3 changed files with 18 additions and 2 deletions

View file

@ -70,6 +70,12 @@ gem 'validates_hostname'
gem 'webpacker'
gem 'yaml_db', git: 'https://0xacab.org/sutty/yaml_db.git'
# performance
gem 'flamegraph'
gem 'memory_profiler'
gem 'rack-mini-profiler'
gem 'stackprof'
group :themes do
gem 'editorial-autogestiva-jekyll-theme', require: false
gem 'minima', require: false
@ -87,7 +93,6 @@ group :development, :test do
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'sqlite3'
gem 'stackprof'
end
group :development do
@ -106,4 +111,3 @@ group :test do
gem 'factory_bot_rails'
gem 'timecop'
end

View file

@ -158,6 +158,7 @@ GEM
factory_bot (~> 5.1.0)
railties (>= 4.2.0)
ffi (1.12.2)
flamegraph (0.9.5)
forwardable-extended (2.6.0)
friendly_id (5.3.0)
activerecord (>= 4.0.0)
@ -289,6 +290,8 @@ GEM
pundit (2.1.0)
activesupport (>= 3.0.0)
rack (2.2.2)
rack-mini-profiler (2.0.1)
rack (>= 1.2.0)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
@ -472,6 +475,7 @@ DEPENDENCIES
email_address
exception_notification
factory_bot_rails
flamegraph
friendly_id
haml-lint
hamlit-rails
@ -484,6 +488,7 @@ DEPENDENCIES
letter_opener
listen (>= 3.0.5, < 3.2)
lograge
memory_profiler
mini_magick
minima
mobility
@ -491,6 +496,7 @@ DEPENDENCIES
pry
puma
pundit
rack-mini-profiler
rails (~> 6)
rails-i18n
rails_warden

View file

@ -9,6 +9,12 @@ class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_locale
before_action do
if current_usuarie.try(:ends_with?, '@' + ENV.fetch('SUTTY', 'sutty.nl'))
Rack::MiniProfiler.authorize_request
end
end
# No tenemos índice de sutty, vamos directamente a ver el listado de
# sitios
def index