Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bogdanRada/4286453 to your computer and use it in GitHub Desktop.
Save bogdanRada/4286453 to your computer and use it in GitHub Desktop.
namespace :exceptions do
task :list => :environment do
exceptions = []
ObjectSpace.each_object(Class) do |k|
exceptions << k if k.ancestors.include?(Exception)
end
puts exceptions.sort { |a,b| a.name <=> b.name }.join("\n")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment