module ExceptionCop
Constants
- VERSION
Attributes
white_list[RW]
Public Class Methods
configure() { |self| ... }
click to toggle source
# File lib/exception_cop.rb, line 7 def configure yield self ENV['EXCEPTION_WHITE_LIST'] = white_list.to_s override_kernel_raise unless white_list.empty? end
reset()
click to toggle source
# File lib/exception_cop.rb, line 13 def reset ExceptionCop.configure do |config| config.white_list = [] end end
Private Class Methods
override_kernel_raise()
click to toggle source
# File lib/exception_cop.rb, line 20 def override_kernel_raise Object.class_eval do def raise(*args) exception_arg = (args.first.is_a?(String)||args.first.nil?) ? RuntimeError : args.first instance_eval(ENV['EXCEPTION_WHITE_LIST']).include?(exception_arg) ? nil : Kernel.raise(*args) end end end
raise(*args)
click to toggle source
# File lib/exception_cop.rb, line 22 def raise(*args) exception_arg = (args.first.is_a?(String)||args.first.nil?) ? RuntimeError : args.first instance_eval(ENV['EXCEPTION_WHITE_LIST']).include?(exception_arg) ? nil : Kernel.raise(*args) end