rack-profiler 1.0.0 → 1.1.0
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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +1 -0
- data/lib/rack/profiler/version.rb +1 -1
- data/public/rack-profiler.html +11 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe1afedae470bb85742aeb3a12c0d254fe85dcae
|
4
|
+
data.tar.gz: 1e70fe3c574df047fecc89476c6ae25ac684ebb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 873f5b0416871e69754316871703e68ae47df70aab738192dc5d7867460abb755c46834a45cd58182406ec89187a9d07224709e4f7f48e55555bd45ee16fa1cb
|
7
|
+
data.tar.gz: da4315aba4b60ac6807de38c84fbe15ad83eeaedb1c8849b51f84f3c1c6d14aecda2802c8fb4af558d59aa90d18d707a5d17d8cb070ec9af21b5d3a72e015efd
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Rack::Profiler
|
2
2
|
|
3
3
|
[](https://travis-ci.org/dawanda/rack-profiler) [](https://codeclimate.com/github/dawanda/rack-profiler) [](https://codeclimate.com/github/dawanda/rack-profiler)
|
4
|
+
[](http://badge.fury.io/rb/rack-profiler)
|
4
5
|
|
5
6
|
Simple profiler for Rack applications (Sinatra and Ruby on Rails for example).
|
6
7
|
It helps providing an answer to common questions like:
|
data/public/rack-profiler.html
CHANGED
@@ -232,6 +232,9 @@
|
|
232
232
|
type = $("#req-method").val() || "GET",
|
233
233
|
data = $("#req-data").val()
|
234
234
|
|
235
|
+
path += path.indexOf("?") > -1 ? "&" : "?";
|
236
|
+
path += "rack-profiler";
|
237
|
+
|
235
238
|
var exposeKeyValues = function( obj ) {
|
236
239
|
return Object.keys( obj ).map( function( key ) {
|
237
240
|
return { key: key, value: JSON.stringify( obj[key], null, 1 ) }
|
@@ -241,7 +244,7 @@
|
|
241
244
|
$(".pr-queries tbody").html('')
|
242
245
|
$(".pr-steps tbody").html('')
|
243
246
|
|
244
|
-
$.ajax( path, { type: type, data:
|
247
|
+
$.ajax( path, { type: type, data: data } )
|
245
248
|
.done(function( data, status, xhr ) {
|
246
249
|
$(".stats").show()
|
247
250
|
|
@@ -253,6 +256,13 @@
|
|
253
256
|
headersKeyVal = exposeKeyValues( data.response.headers ),
|
254
257
|
responseWrap = $.extend( {}, data.response, { headers: headersKeyVal } )
|
255
258
|
|
259
|
+
try {
|
260
|
+
// pretty-print a JSON response
|
261
|
+
responseWrap.body = JSON.stringify(JSON.parse(responseWrap.body), null, 2);
|
262
|
+
} catch(e) {
|
263
|
+
// can't parse it as JSON, nevermind
|
264
|
+
};
|
265
|
+
|
256
266
|
$('#response').html( Mustache.render( responseTmpl, responseWrap ) )
|
257
267
|
if (data.response.status < 400) {
|
258
268
|
$('#response_panel').removeClass('panel-danger').addClass('panel-success')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Ongaro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.4.8
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: A simple profiler for Rack applications
|