Permalink
Browse files

Whitespace fixes

  • Loading branch information...
1 parent 3e11868 commit 0200a43f62da150b07a9ab11bf55472d0d364fd4 @brynary committed May 28, 2010
Showing with 383 additions and 378 deletions.
  1. +8 −8 History.txt
  2. +2 −2 README.md
  3. +6 −1 Rakefile
  4. +1 −1 Thorfile
  5. +1 −1 lib/rack/bug.rb
  6. +2 −2 lib/rack/bug/filtered_backtrace.rb
  7. +4 −4 lib/rack/bug/options.rb
  8. +12 −12 lib/rack/bug/panel.rb
  9. +8 −8 lib/rack/bug/panel_app.rb
  10. +11 −11 lib/rack/bug/panels/active_record_panel.rb
  11. +3 −3 lib/rack/bug/panels/active_record_panel/activerecord_extensions.rb
  12. +1 −1 lib/rack/bug/panels/cache_panel.rb
  13. +4 −4 lib/rack/bug/panels/cache_panel/memcache_extension.rb
  14. +11 −11 lib/rack/bug/panels/cache_panel/panel_app.rb
  15. +20 −20 lib/rack/bug/panels/cache_panel/stats.rb
  16. +10 −10 lib/rack/bug/panels/log_panel.rb
  17. +1 −1 lib/rack/bug/panels/log_panel/rails_extension.rb
  18. +8 −8 lib/rack/bug/panels/memory_panel.rb
  19. +5 −5 lib/rack/bug/panels/rails_info_panel.rb
  20. +1 −1 lib/rack/bug/panels/redis_panel.rb
  21. +2 −2 lib/rack/bug/panels/redis_panel/redis_extension.rb
  22. +12 −12 lib/rack/bug/panels/redis_panel/stats.rb
  23. +7 −7 lib/rack/bug/panels/request_variables_panel.rb
  24. +1 −1 lib/rack/bug/panels/sphinx_panel.rb
  25. +1 −1 lib/rack/bug/panels/sphinx_panel/sphinx_extension.rb
  26. +1 −1 lib/rack/bug/panels/sphinx_panel/stats.rb
  27. +1 −1 lib/rack/bug/panels/sql_panel.rb
  28. +7 −7 lib/rack/bug/panels/sql_panel/panel_app.rb
  29. +12 −12 lib/rack/bug/panels/sql_panel/query.rb
  30. +2 −2 lib/rack/bug/panels/sql_panel/sql_extension.rb
  31. +1 −1 lib/rack/bug/panels/templates_panel.rb
  32. +1 −1 lib/rack/bug/panels/templates_panel/actionview_extension.rb
  33. +14 −14 lib/rack/bug/panels/templates_panel/rendering.rb
  34. +8 −8 lib/rack/bug/panels/templates_panel/trace.rb
  35. +10 −10 lib/rack/bug/panels/timer_panel.rb
  36. +18 −18 lib/rack/bug/params_signature.rb
  37. +16 −16 lib/rack/bug/render.rb
  38. +32 −32 lib/rack/bug/toolbar.rb
  39. +5 −5 spec/fixtures/sample_app.rb
  40. +3 −3 spec/rack/bug/panels/active_record_panel_spec.rb
  41. +24 −24 spec/rack/bug/panels/cache_panel_spec.rb
  42. +3 −3 spec/rack/bug/panels/log_panel_spec.rb
  43. +3 −3 spec/rack/bug/panels/memory_panel_spec.rb
  44. +2 −2 spec/rack/bug/panels/rails_info_panel_spec.rb
  45. +10 −10 spec/rack/bug/panels/redis_panel_spec.rb
  46. +24 −24 spec/rack/bug/panels/sql_panel_spec.rb
  47. +11 −11 spec/rack/bug/panels/templates_panel_spec.rb
  48. +6 −6 spec/rack/bug/panels/timer_panel_spec.rb
  49. +17 −17 spec/rack/toolbar_spec.rb
  50. +10 −10 spec/spec_helper.rb
View
@@ -1,20 +1,20 @@
== HEAD
* New features
-
+
* Log panel includes log level and timestamp (Tim Connor)
* Sphinx panel (George Chatzigeorgiou)
* Backtraces for Redis panel (Luke Melia & Joey Aghion)
-
+
* Minor fixes
-
+
* Don't "enable" rack bug if you hit cancel on the bookmarklet prompt (Mischa Fierer)
-
+
* Compatibilty
-
+
* backtrace filtering now supports more than just Rails (Alex Chaffee)
* compatibility with current rack-test (Luke Melia & Joey Aghion)
* update Sinatra sample app (Tim Conner)
-
-== 0.2.1
- * The beginning of recorded history
+== 0.2.1
+
+ * The beginning of recorded history
View
@@ -33,7 +33,7 @@ Features
Rails quick start
---------------------------
- script/plugin install git://github.com/brynary/rack-bug.git
+ script/plugin install git://github.com/brynary/rack-bug.git
In config/environments/development.rb, add:
@@ -74,7 +74,7 @@ We have have found that Rack::Bug is fast enough to run in production for specif
### Configuration ####
-Add the middleware configuration to an initializer or the appropriate environment files, taking the rest of this section into consideration.
+Add the middleware configuration to an initializer or the appropriate environment files, taking the rest of this section into consideration.
### Security ####
View
@@ -15,4 +15,9 @@ Spec::Rake::SpecTask.new(:rcov) do |t|
end
desc "Run the specs"
-task :default => :spec
+task :default => :spec
+
+desc 'Removes trailing whitespace'
+task :whitespace do
+ sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
+end
View
@@ -106,4 +106,4 @@ class Release < Thor
def gem
sh "gem push pkg/#{read_gemspec.file_name}"
end
-end
+end
View
@@ -42,4 +42,4 @@ def self.enabled?
def self.new(*args, &block)
Toolbar.new(*args, &block)
end
-end
+end
@@ -5,7 +5,7 @@ module FilteredBacktrace
def backtrace
@backtrace
end
-
+
def has_backtrace?
filtered_backtrace.any?
end
@@ -16,7 +16,7 @@ def filtered_backtrace
(line.index(root_for_backtrace_filtering) == 0) && !(line.index(root_for_backtrace_filtering("vendor")) == 0)
end
end
-
+
def root_for_backtrace_filtering(sub_path = nil)
if defined?(Rails) && Rails.respond_to?(:root)
sub_path ? Rails.root.join(sub_path) : Rails.root
View
@@ -9,7 +9,7 @@ def option_accessor(key)
define_method("#{key}?") { || !! read_option(key) }
end
end
-
+
option_accessor :secret_key
option_accessor :ip_masks
option_accessor :password
@@ -45,7 +45,7 @@ def set(option, value=self, &block)
end
private
-
+
def read_option(key)
options[option_name(key)]
end
@@ -61,7 +61,7 @@ def option_name(key)
else raise ArgumentError
end
end
-
+
def initialize_options(options={})
@default_options = {
'rack-bug.ip_masks' => [IPAddr.new("127.0.0.1")],
@@ -84,6 +84,6 @@ def initialize_options(options={})
}
self.options = options
end
-
+
end
end
View
@@ -2,22 +2,22 @@
module Rack
module Bug
-
+
# Panels are also Rack middleware
class Panel
include Render
include ERB::Util
-
+
attr_reader :request
-
+
def initialize(app)
if panel_app
@app = Rack::Cascade.new([panel_app, app])
else
@app = app
end
end
-
+
def call(env)
before(env)
status, headers, body = @app.call(env)
@@ -26,25 +26,25 @@ def call(env)
env["rack-bug.panels"] << self
return [status, headers, body]
end
-
+
def panel_app
nil
end
-
+
def has_content?
true
end
-
+
def before(env)
end
-
+
def after(env, status, headers, body)
end
-
+
def render(template)
end
-
+
end
-
+
end
-end
+end
View
@@ -1,20 +1,20 @@
module Rack
module Bug
-
+
class PanelApp
include Rack::Bug::Render
-
+
attr_reader :request
-
+
def call(env)
@request = Rack::Request.new(env)
dispatch
end
-
+
def render_template(*args)
Rack::Response.new([super]).to_a
end
-
+
def params
@request.GET
end
@@ -26,8 +26,8 @@ def not_found
def validate_params
ParamsSignature.new(request).validate!
end
-
+
end
-
+
end
-end
+end
@@ -2,44 +2,44 @@
module Rack
module Bug
-
+
class ActiveRecordPanel < Panel
-
+
def self.record(class_name)
return unless Rack::Bug.enabled?
records[class_name] += 1
end
-
+
def self.reset
Thread.current["rack.bug.active_records"] = Hash.new { 0 }
end
-
+
def self.records
Thread.current["rack.bug.active_records"] ||= Hash.new { 0 }
end
-
+
def self.total
records.inject(0) do |memo, (key, value)|
memo + value
end
end
-
+
def name
"active_record"
end
-
+
def heading
"#{self.class.total} AR Objects"
end
-
+
def content
records = self.class.records.to_a.sort_by { |key, value| value }.reverse
result = render_template "panels/active_record", :records => records
self.class.reset
result
end
-
+
end
-
+
end
-end
+end
@@ -6,13 +6,13 @@ def after_initialize_with_rack_bug
Rack::Bug::ActiveRecordPanel.record(self.class.base_class.name)
after_initialize_without_rack_bug
end
-
+
alias_method_chain :after_initialize, :rack_bug
else
def after_initialize
Rack::Bug::ActiveRecordPanel.record(self.class.base_class.name)
end
end
-
+
end
-end
+end
@@ -47,4 +47,4 @@ def content
end
end
-end
+end
@@ -42,13 +42,13 @@ def prepend_with_rack_bug(key, value)
prepend_without_rack_bug(key, value)
end
end
-
+
def delete_with_rack_bug(key)
Rack::Bug::CachePanel.record(:delete, key) do
delete_without_rack_bug(key)
end
end
-
+
def get_with_rack_bug(keys, marshal=true)
if keys.is_a? Array
Rack::Bug::CachePanel.record(:get_multi, *keys) do
@@ -117,7 +117,7 @@ def delete_with_rack_bug(key, expiry = 0)
delete_without_rack_bug(key, expiry)
end
end
-
+
alias_method_chain :decr, :rack_bug
alias_method_chain :get, :rack_bug
alias_method_chain :get_multi, :rack_bug
@@ -126,4 +126,4 @@ def delete_with_rack_bug(key, expiry = 0)
alias_method_chain :add, :rack_bug
alias_method_chain :delete, :rack_bug
end
-end
+end
Oops, something went wrong.

0 comments on commit 0200a43

Please sign in to comment.