rack-webprofiler 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/lib/rack/templates/panel/layout.erb +1 -1
- data/lib/rack/web_profiler.rb +5 -0
- data/lib/rack/web_profiler/collector.rb +2 -1
- data/lib/rack/web_profiler/collectors.rb +7 -2
- data/lib/rack/web_profiler/collectors/rack_collector.rb +1 -1
- data/lib/rack/web_profiler/collectors/ruby_collector.rb +1 -1
- data/lib/rack/web_profiler/collectors/time_collector.rb +1 -1
- data/lib/rack/web_profiler/controller.rb +2 -4
- data/lib/rack/web_profiler/engine.rb +4 -2
- data/lib/rack/web_profiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2995d0dfb44e3b0425c0f51f1d16dbc1e7a64e0
|
4
|
+
data.tar.gz: 6ef39dc746478b470ef19a106e55b2ca9c61e836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f1a0c68cdcc7d3e94739ebdec5253e0aca96251cb7cf9413d8813e769400e3595093d17cbe4cb6a5e23adf55172ea41ecfd13f51c6a5faea36e282b7936fd94
|
7
|
+
data.tar.gz: 783944e423468299ae22e53288d0220ec99f1c62a5c641caf8cc96b3c93e7d1c6a75b7ab0080d141a4643dfd2d8b7b88949e9ff832a927167b8e0b1ecd43ced2
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,16 @@
|
|
11
11
|
* Catch 500 or exceptions.
|
12
12
|
|
13
13
|
|
14
|
+
## v0.1.3
|
15
|
+
|
16
|
+
### Fixes
|
17
|
+
|
18
|
+
* Do request and response optional on DSL for collect method (#34).
|
19
|
+
* Create a method to reset collectors list.
|
20
|
+
* Debug `erb` method of Controller.
|
21
|
+
* Small code cleanup.
|
22
|
+
|
23
|
+
|
14
24
|
## v0.1.2
|
15
25
|
|
16
26
|
### Fixes
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
A Rack profiler for web application.
|
4
4
|
|
5
5
|
[![Version ](http://img.shields.io/gem/v/rack-webprofiler.svg) ](https://rubygems.org/gems/rack-webprofiler)
|
6
|
-
[![Travis CI ](http://img.shields.io/travis/rack-webprofiler/rack-webprofiler/master.svg) ](https://travis-ci.org/rack-
|
6
|
+
[![Travis CI ](http://img.shields.io/travis/rack-webprofiler/rack-webprofiler/master.svg) ](https://travis-ci.org/rack-webprofiler/rack-webprofiler)
|
7
7
|
[![Gitter ](https://img.shields.io/gitter/room/rack-webprofiler/rack-webprofiler.svg) ](https://gitter.im/rack-webprofiler/rack-webprofiler)
|
8
8
|
|
9
9
|
## Installation
|
data/lib/rack/web_profiler.rb
CHANGED
@@ -86,7 +86,8 @@ module Rack
|
|
86
86
|
#
|
87
87
|
# @return [Rack::WebProfiler::Collector::DSL::DataStorage]
|
88
88
|
def collect!(request, response)
|
89
|
-
|
89
|
+
args = [request, response]
|
90
|
+
@data_storage = Docile.dsl_eval(DataStorage.new, *args.take(collect.arity), &collect)
|
90
91
|
end
|
91
92
|
|
92
93
|
# Is the collector enabled.
|
@@ -11,8 +11,7 @@ module Rack
|
|
11
11
|
|
12
12
|
# Initialize.
|
13
13
|
def initialize
|
14
|
-
|
15
|
-
@sorted_collectors = {}
|
14
|
+
reset!
|
16
15
|
end
|
17
16
|
|
18
17
|
# Get a collector definition by his identifier.
|
@@ -77,6 +76,12 @@ module Rack
|
|
77
76
|
sort_collectors!
|
78
77
|
end
|
79
78
|
|
79
|
+
# Reset collecotrs.
|
80
|
+
def reset!
|
81
|
+
@collectors = {}
|
82
|
+
@sorted_collectors = {}
|
83
|
+
end
|
84
|
+
|
80
85
|
private
|
81
86
|
|
82
87
|
# Sort collectors by definition identifier.
|
@@ -127,12 +127,10 @@ module Rack
|
|
127
127
|
# @return [Rack::Response]
|
128
128
|
#
|
129
129
|
# @private
|
130
|
-
def erb(path, layout: nil, variables:
|
130
|
+
def erb(path, layout: nil, variables: binding, status: 200)
|
131
131
|
v = WebProfiler::View.new(path, layout: layout)
|
132
132
|
|
133
|
-
variables
|
134
|
-
|
135
|
-
Rack::Response.new(v.result(variables), status, {
|
133
|
+
Rack::Response.new(v.result(variables) || "", status, {
|
136
134
|
"Content-Type" => "text/html",
|
137
135
|
})
|
138
136
|
end
|
@@ -48,8 +48,10 @@ module Rack
|
|
48
48
|
#
|
49
49
|
# @param request [Rack::WebProfiler::Request]
|
50
50
|
# @param response [Rack::Response]
|
51
|
+
#
|
52
|
+
# @return [WebProfiler::Model::CollectionRecord]
|
51
53
|
def collect!(request, response)
|
52
|
-
processor = Processor.new(request, response)
|
54
|
+
processor = Processor.new(request.clone.freeze, response.clone.freeze)
|
53
55
|
processor.save!
|
54
56
|
|
55
57
|
processor.record
|
@@ -73,7 +75,7 @@ module Rack
|
|
73
75
|
attr_reader :record
|
74
76
|
|
75
77
|
def initialize(request, response)
|
76
|
-
@record = new_record(request
|
78
|
+
@record = new_record(request, response)
|
77
79
|
end
|
78
80
|
|
79
81
|
def save!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-webprofiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Brousse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|