mini-mini-profiler 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,8 +44,7 @@ var MiniProfiler = (function () {
44
44
 
45
45
  var fetchTemplates = function (success) {
46
46
  var key = 'templates',
47
- // cached = load(key);
48
- cached = false
47
+ cached = load(key);
49
48
 
50
49
  if (cached) {
51
50
  $('body').append(cached);
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class MiniProfiler
3
- VERSION = '6dd090de49f69e3ca9f7dcb5e7090010'.freeze
3
+ VERSION = 'fcdf8df841ec8f65ffa5cc7f9beef133'.freeze
4
4
  end
5
5
  end
@@ -36,35 +36,38 @@ module Rack::MiniProfilerRails
36
36
 
37
37
  # Install the Middleware
38
38
  app.middleware.insert(0, Rack::MiniProfiler)
39
+ end
40
+
41
+ class Railtie < ::Rails::Railtie
42
+
43
+ initializer "rack_mini_profiler.configure_rails_initialization" do |app|
44
+ Rack::MiniProfilerRails.initialize!(app)
45
+ end
39
46
 
40
- # Attach to various Rails methods
41
- ::Rack::MiniProfiler.profile_method(ActionController::Base, :process) {|action| "Controller: #{self.class.name} Action: #{action}"}
42
- ::Rack::MiniProfiler.profile_method(ActionView::Template, :render) {|x,y| "View: #{@virtual_path}"}
47
+ config.after_initialize do
48
+ # Attach to various Rails methods
49
+ ::Rack::MiniProfiler.profile_method(ActionController::Base, :process) {|action| "Controller: #{self.class.name} Action: #{action}"}
50
+ ::Rack::MiniProfiler.profile_method(ActionView::Template, :render) {|x,y| "View: #{@virtual_path}"}
43
51
 
44
- # preload all model classes
45
- Dir.glob("#{Rails.root}/app/models/**/*.rb").map{|file| file.match(/([^\/]+).rb/)[1].camelize.constantize}
52
+ # preload all model classes
53
+ Dir.glob("#{Rails.root}/app/models/**/*.rb").map{|file| file.match(/([^\/]+).rb/)[1].camelize.constantize}
46
54
 
47
- ActiveRecord::Base.subclasses.each do |model_class|
48
- (model_class.instance_methods - ActiveRecord::Base.instance_methods + [:save, :update_attributes, :initialize]).each do |method|
49
- # ::Rack::MiniProfiler.profile_method(model_class, method){ |*args| "Model: #{self.class.name} Method: #{method}" }
50
- unless method.to_s =~ /^_.*/
51
- ::Rack::MiniProfiler.profile_method(model_class, method){ |*args| "Model: #{ self.class.name } Method: #{ method }" }
55
+ ActiveRecord::Base.subclasses.each do |model_class|
56
+ (model_class.instance_methods - ActiveRecord::Base.instance_methods + [:save, :update_attributes, :initialize]).each do |method|
57
+ # ::Rack::MiniProfiler.profile_method(model_class, method){ |*args| "Model: #{self.class.name} Method: #{method}" }
58
+ unless method.to_s =~ /^_.*/
59
+ ::Rack::MiniProfiler.profile_method(model_class, method){ |*args| "Model: #{ self.class.name } Method: #{ method }" }
60
+ end
52
61
  end
53
- end
54
62
 
55
- ((model_class.public_methods - ActiveRecord::Base.public_methods) + [:find, :where, :order, :all]).each do |method|
56
- unless method.to_s =~ /^_.*/
57
- ::Rack::MiniProfiler.profile_method(model_class, method, true){ |*args| "Model: #{ self.name } Method: #{ method }" }
63
+ ((model_class.public_methods - ActiveRecord::Base.public_methods) + [:find, :where, :order, :all]).each do |method|
64
+ unless method.to_s =~ /^_.*/
65
+ ::Rack::MiniProfiler.profile_method(model_class, method, true){ |*args| "Model: #{ self.name } Method: #{ method }" }
66
+ end
58
67
  end
59
68
  end
60
69
  end
61
- end
62
-
63
- class Railtie < ::Rails::Railtie
64
70
 
65
- initializer "rack_mini_profiler.configure_rails_initialization" do |app|
66
- Rack::MiniProfilerRails.initialize!(app)
67
- end
68
71
 
69
72
  # TODO: Implement something better here
70
73
  # config.after_initialize do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mini-mini-profiler"
3
- s.version = "0.1"
3
+ s.version = "0.1.1"
4
4
  s.summary = "Simple Profiler for learning about Rails Development"
5
5
  s.authors = ["Aubrey Rhodes"]
6
6
  s.description = "Simple Profiler for learning about Rails Development"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini-mini-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -135,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  segments:
137
137
  - 0
138
- hash: 4144483272332306708
138
+ hash: -724534221415535854
139
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  segments:
146
146
  - 0
147
- hash: 4144483272332306708
147
+ hash: -724534221415535854
148
148
  requirements: []
149
149
  rubyforge_project:
150
150
  rubygems_version: 1.8.25