From 635bc92d8e4e5a8279f6b464dc8a0abc25cb7971 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 2 Jun 2015 22:32:25 +0500 Subject: [PATCH] add rack-mini-profiler --- Gemfile | 1 + Gemfile.lock | 3 +++ config/initializers/rack_profiler.rb | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 config/initializers/rack_profiler.rb diff --git a/Gemfile b/Gemfile index ce2c424d6..dd078eba8 100644 --- a/Gemfile +++ b/Gemfile @@ -126,6 +126,7 @@ group :development do gem 'localeapp' gem 'skype' #gem 'ruby-dbus' if RUBY_PLATFORM =~ /linux/i # Error at deploy + gem 'rack-mini-profiler', require: false end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index c85ad6e77..6f6e00ebb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -354,6 +354,8 @@ GEM rack (1.5.2) rack-contrib (1.2.0) rack (>= 0.9.1) + rack-mini-profiler (0.9.3) + rack (>= 1.1.3) rack-protection (1.5.3) rack rack-test (0.6.3) @@ -637,6 +639,7 @@ DEPENDENCIES protected_attributes puma pundit + rack-mini-profiler rack-throttle (~> 0.3.0) rack-utf8_sanitizer rails (= 4.1.10) diff --git a/config/initializers/rack_profiler.rb b/config/initializers/rack_profiler.rb new file mode 100644 index 000000000..2bb079c55 --- /dev/null +++ b/config/initializers/rack_profiler.rb @@ -0,0 +1,6 @@ +if Rails.env == 'development' + require 'rack-mini-profiler' + + # initialization is skipped so trigger it + Rack::MiniProfilerRails.initialize!(Rails.application) +end \ No newline at end of file