rails-webprofiler 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a63d72241be08bb543bd3f463571bd7c560acf3
4
- data.tar.gz: 2baccab9e96c4377e5be9d61e23e68bc4500218d
3
+ metadata.gz: 6cf874afa5c6166db8d90ca2f03d7e40d44d8ac3
4
+ data.tar.gz: f55e26a5bcd9a9010a2c465ec46269649de197a3
5
5
  SHA512:
6
- metadata.gz: 07ddd1fb120f61f05023d3aa1146a64a7292261e0089a186ffa36d9d3d719155f2da6110584f6d8abf2cb190d0d15eb9038e66b7036edc7dc6d7785ee3fa994a
7
- data.tar.gz: b1836c45195e1dfae91d31723beb449f2c6fc8027d70e6e32e64ea67eeb4da4dbdb00a43e0f02697dbc551edc2b351baf09663e607273eb775bead4e0406bb30
6
+ metadata.gz: '083e18909af5bc24ff594bcaed64f5e4deb6cc946794cfc4130cacfe22981a6e32638244edcd9ac54116f578812ea7b034bea864c8c102c14ddaf1109430a94c'
7
+ data.tar.gz: 49ea09d12d8a78cdffd1fad817111e1f8a82a57404867ef6cd471d5b1762219258907dc0a95be16510d3b48d902fcd34aa7ac1849dd79ee4ee726123f558b2ba
@@ -9,6 +9,13 @@
9
9
  * Create a collector to show the Rails logger informations.
10
10
 
11
11
 
12
+ ## v0.1.2
13
+
14
+ ### Fixes
15
+
16
+ * Avoid exception with NotificationHandler.
17
+
18
+
12
19
  ## v0.1.1
13
20
 
14
21
  Use `rack-webprofiler` >= `0.1.3`.
@@ -1,5 +1,7 @@
1
1
  class Rails::WebProfiler::NotificationHandler
2
2
  def call(*args)
3
+ return unless args.length == 5
4
+
3
5
  event = ActiveSupport::Notifications::Event.new(*args)
4
6
 
5
7
  events = ::Rack::WebProfiler.data("rails.events")
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  class WebProfiler
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-webprofiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Brousse