rack-mini-profiler 0.9.9 → 0.9.9.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rack-mini-profiler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09e877779936ca60a9be72fc14ae574a450cd338
4
- data.tar.gz: b53fc49ccabb1d8560c0ee8014199388fbf6749a
3
+ metadata.gz: 81fab6117126813e24c0138727a15d8003034ed9
4
+ data.tar.gz: ced0259792654878ede143826ba3ba25da96e7ac
5
5
  SHA512:
6
- metadata.gz: a5b9ced034cd204f59eb4be61c718a97960fed72a7e4484af99748b9ed62eb7a736a7ebc78668b46b71f743432c53758ced36f918a1c31859c7f965917f0c826
7
- data.tar.gz: 3c97726e0f276ff8b1bd3cf220f64f4b9908ca950b4485f6c9978c05d3479582aa166314e0dbc2afb2c1cb478ebb6801f1459a9cb4bcc51df7cec7826ee96356
6
+ metadata.gz: 6c480714ac5ff3cc5dd221b996a25a7f21299103e983a31fa2dff950cd26c5565d9b93525ee77cfa4af6a4edb16b84c8214e9edeff20f295a312fcc4244b8aa2
7
+ data.tar.gz: 522e2c82da57475b552b24db6ca9114df1461022f5a50a0b19a383cbfe5496918fa703e98c669552172c0df78f1a5f1dce1d47592ad60ba465ba96e68e70236a
@@ -2,6 +2,10 @@
2
2
 
3
3
  ##
4
4
 
5
+ ## 0.9.9.1 2016-03-06
6
+
7
+ - [FEATURE] expost MiniProfiler.pageTransition() for use by SPA web apps (@sam)
8
+
5
9
  ## 0.9.9 2016-03-06
6
10
 
7
11
  - [FIX] removes alias_method_chain in favor of alias_method until Ruby 1.9.3 (@ayfredlund)
data/README.md CHANGED
@@ -184,6 +184,18 @@ Rails.application.config.to_prepare do
184
184
  end
185
185
  ```
186
186
 
187
+ ### Using in SPA applications
188
+
189
+ Single page applications built using Ember, Angular or other frameworks need some special care, as routes often change without a full page load.
190
+
191
+ On route transition always call:
192
+
193
+ ```
194
+ window.MiniProfiler.pageTransition();
195
+ ```
196
+
197
+ This method will remove profiling information that was related to previous page and clear aggregate statistics.
198
+
187
199
  ### Configuration Options
188
200
 
189
201
  You can set configuration options using the configuration accessor on `Rack::MiniProfiler`.
@@ -7,7 +7,10 @@ var MiniProfiler = (function () {
7
7
  controls,
8
8
  fetchedIds = [],
9
9
  fetchingIds = [], // so we never pull down a profiler twice
10
- ajaxStartTime
10
+ ajaxStartTime,
11
+ totalsControl,
12
+ reqs = 0,
13
+ totalTime = 0;
11
14
  ;
12
15
 
13
16
  var hasLocalStorage = function (keyPrefix) {
@@ -149,9 +152,6 @@ var MiniProfiler = (function () {
149
152
  return $('#profilerTemplate').tmpl(json);
150
153
  };
151
154
 
152
- var totalsControl;
153
- var reqs = 0;
154
- var totalTime = 0;
155
155
 
156
156
  var buttonShow = function (json) {
157
157
  var result = renderTemplate(json);
@@ -745,6 +745,16 @@ var MiniProfiler = (function () {
745
745
  unbindDocumentEvents();
746
746
  },
747
747
 
748
+ pageTransition: function() {
749
+ if (totalsControl) {
750
+ totalsControl.remove();
751
+ totalsControl = null;
752
+ }
753
+ reqs = 0;
754
+ totalTime = 0;
755
+ $('.profiler-results .profiler-result').remove();
756
+ },
757
+
748
758
  getClientTimingByName: function (clientTiming, name) {
749
759
 
750
760
  for (var i = 0; i < clientTiming.timings.length; i++) {
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class MiniProfiler
3
- ASSET_VERSION = '16af8af9ec9b135097ff8209e717f825'.freeze
3
+ ASSET_VERSION = 'd59c36ba35d129420ca9ba77918c7c3e'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class MiniProfiler
3
- VERSION = '0.9.9'
3
+ VERSION = '0.9.9.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-mini-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron