rails-webprofiler 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/rails/web_profiler/notification_handler.rb +2 -0
- data/lib/rails/web_profiler/railtie.rb +30 -0
- data/lib/rails/web_profiler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cf874afa5c6166db8d90ca2f03d7e40d44d8ac3
|
4
|
+
data.tar.gz: f55e26a5bcd9a9010a2c465ec46269649de197a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '083e18909af5bc24ff594bcaed64f5e4deb6cc946794cfc4130cacfe22981a6e32638244edcd9ac54116f578812ea7b034bea864c8c102c14ddaf1109430a94c'
|
7
|
+
data.tar.gz: 49ea09d12d8a78cdffd1fad817111e1f8a82a57404867ef6cd471d5b1762219258907dc0a95be16510d3b48d902fcd34aa7ac1849dd79ee4ee726123f558b2ba
|
data/CHANGELOG.md
CHANGED
@@ -22,11 +22,41 @@ module Rails
|
|
22
22
|
|
23
23
|
c = ::Rack::WebProfiler.config
|
24
24
|
|
25
|
+
# c.skip_paths ||= []
|
26
|
+
|
27
|
+
# if serves_static_assets?(app)
|
28
|
+
# c.skip_paths << app.config.assets.prefix
|
29
|
+
# end
|
30
|
+
|
31
|
+
# unless Rails.env.development? || Rails.env.test?
|
32
|
+
# c.authorization_mode = :whitelist
|
33
|
+
# end
|
34
|
+
|
35
|
+
# if Rails.logger
|
36
|
+
# c.logger = Rails.logger
|
37
|
+
# end
|
38
|
+
|
25
39
|
c.tmp_dir = ::File.expand_path(::File.join(Rails.root, "tmp"), __FILE__)
|
26
40
|
|
27
41
|
@already_initialized = true
|
28
42
|
end
|
29
43
|
|
44
|
+
def self.serves_static_assets?(app)
|
45
|
+
config = app.config
|
46
|
+
|
47
|
+
if !config.respond_to?(:assets) || !config.assets.respond_to?(:prefix)
|
48
|
+
return false
|
49
|
+
end
|
50
|
+
|
51
|
+
if ::Rails.version >= "5.0.0"
|
52
|
+
::Rails.configuration.public_file_server.enabled
|
53
|
+
elsif ::Rails.version >= "4.2.0"
|
54
|
+
::Rails.configuration.serve_static_files
|
55
|
+
else
|
56
|
+
::Rails.configuration.serve_static_assets
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
30
60
|
class Railtie < ::Rails::Railtie # :nodoc:
|
31
61
|
initializer "rails-webprofiler.configure_rails_initialization" do |app|
|
32
62
|
Rails::WebProfiler.initialize!(app)
|