quietbacktrace 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +6 -0
  2. data/Rakefile +1 -1
  3. data/lib/quietbacktrace.rb +8 -10
  4. metadata +1 -1
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.0.6 / 2007-12-03
2
+
3
+ * Reworked the API again.
4
+ * Step one - create new silencers/filters.
5
+ * Step two - add them to the backtrace_silencers and backtrace_filters Arrays.
6
+
1
7
  == 0.0.5 / 2007-12-03
2
8
 
3
9
  * Improved the API with James Golick's code
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rubygems'
4
4
  require 'hoe'
5
5
  require './lib/quietbacktrace.rb'
6
6
 
7
- Hoe.new('quietbacktrace', '0.0.5') do |p|
7
+ Hoe.new('quietbacktrace', '0.0.6') do |p|
8
8
  p.rubyforge_name = 'quietbacktrace'
9
9
  p.author = 'Dan Croak'
10
10
  p.email = 'dcroak@thoughtbot.com'
@@ -116,13 +116,13 @@ module QuietBacktrace # :nodoc: all
116
116
  self.backtrace_filters, self.backtrace_silencers = [], []
117
117
 
118
118
  extend ClassMethods
119
- silences_backtrace(:test_unit) { |line| (line.include?("ruby") && line.include?("/test/unit")) }
120
- silences_backtrace(:gem_root) { |line| line =~ /ruby\/gems/i }
121
- silences_backtrace(:e1) { |line| line == "-e:1" }
122
- silences_backtrace(:rails_vendor) { |line| (line.include?("vendor/plugins") || line.include?("vendor/gems") || line.include?("vendor/rails")) }
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
- filters_backtrace(:method_name) { |line| line.slice!((line =~ /:in /)..line.length) if (line =~ /:in /) }
125
- filters_backtrace(:rails_root) { |line| line.sub!("#{RAILS_ROOT}/", '') if (defined?(RAILS_ROOT) && line.include?(RAILS_ROOT)) }
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 silences_backtrace(symbol, &block)
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 filters_backtrace(symbol, &block)
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.5
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: