quietbacktrace 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Rakefile +1 -1
- data/lib/quietbacktrace.rb +8 -10
- metadata +1 -1
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/quietbacktrace.rb
CHANGED
@@ -116,13 +116,13 @@ module QuietBacktrace # :nodoc: all
|
|
116
116
|
self.backtrace_filters, self.backtrace_silencers = [], []
|
117
117
|
|
118
118
|
extend ClassMethods
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
119
|
+
new_backtrace_silencer(:test_unit) { |line| (line.include?("ruby") && line.include?("/test/unit")) }
|
120
|
+
new_backtrace_silencer(:gem_root) { |line| line =~ /ruby\/gems/i }
|
121
|
+
new_backtrace_silencer(:e1) { |line| line == "-e:1" }
|
122
|
+
new_backtrace_silencer(:rails_vendor) { |line| (line.include?("vendor/plugins") || line.include?("vendor/gems") || line.include?("vendor/rails")) }
|
123
123
|
|
124
|
-
|
125
|
-
|
124
|
+
new_backtrace_filter(:method_name) { |line| line.slice!((line =~ /:in /)..line.length) if (line =~ /:in /) }
|
125
|
+
new_backtrace_filter(:rails_root) { |line| line.sub!("#{RAILS_ROOT}/", '') if (defined?(RAILS_ROOT) && line.include?(RAILS_ROOT)) }
|
126
126
|
|
127
127
|
self.quiet_backtrace = true
|
128
128
|
self.backtrace_silencers = [:test_unit, :gem_root, :e1]
|
@@ -131,14 +131,12 @@ module QuietBacktrace # :nodoc: all
|
|
131
131
|
end
|
132
132
|
|
133
133
|
module ClassMethods
|
134
|
-
def
|
134
|
+
def new_backtrace_silencer(symbol, &block)
|
135
135
|
QuietBacktrace::BacktraceFilter.silencers[symbol] = block
|
136
|
-
backtrace_silencers << symbol
|
137
136
|
end
|
138
137
|
|
139
|
-
def
|
138
|
+
def new_backtrace_filter(symbol, &block)
|
140
139
|
QuietBacktrace::BacktraceFilter.filters[symbol] = block
|
141
|
-
backtrace_filters << symbol
|
142
140
|
end
|
143
141
|
end
|
144
142
|
end
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: quietbacktrace
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
6
|
+
version: 0.0.6
|
7
7
|
date: 2007-12-03 00:00:00 -05:00
|
8
8
|
summary: quiet_backtrace suppresses the noise in your Test::Unit backtrace. It also provides hooks for you to add additional filters.
|
9
9
|
require_paths:
|