lib/require_bench.rb in require_bench-1.0.4.pre.alpha.2 vs lib/require_bench.rb in require_bench-1.0.4.pre.alpha.4
- old
+ new
@@ -37,10 +37,16 @@
require 'require_bench/color_printer'
else
require 'require_bench/printer'
end
PRINTER = Printer.new
+
+ if rescued_classes.any?
+ rescued_classes.map! do |klass|
+ Kernel.const_get(klass)
+ end
+ end
if skips && !skips.empty?
skip_pattern = case skips
when /,/
Regexp.union(*skips.split(','))
when /\|/
@@ -149,15 +155,15 @@
return send("#{type}_without_timing", file_path) if $require_bench_semaphore
short_type = type[0]
measure = RequireBench::INCLUDE_PATTERN && file_path.match?(RequireBench::INCLUDE_PATTERN)
skippy = RequireBench::SKIP_PATTERN && file_path.match?(RequireBench::SKIP_PATTERN)
- PRINTER.p(file, short_type) if RequireBench::LOG_START
+ RequireBench::PRINTER.p(file, short_type) if RequireBench::LOG_START
if RequireBench::RESCUED_CLASSES.any?
begin
_require_bench_file(type, measure, skippy, file_path)
rescue *RequireBench::RESCUED_CLASSES => e
- PRINTER.e(e, file, short_type)
+ RequireBench::PRINTER.e(e, file, short_type)
end
else
_require_bench_file(type, measure, skippy, file_path)
end
end