From 2d703fb58e60178319fe8ee877a19720004cf5d6 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 18 Jan 2016 21:01:25 -0500 Subject: [PATCH] add exceptions rake task --- lib/tasks/exceptions.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/tasks/exceptions.rake diff --git a/lib/tasks/exceptions.rake b/lib/tasks/exceptions.rake new file mode 100644 index 0000000..11fd631 --- /dev/null +++ b/lib/tasks/exceptions.rake @@ -0,0 +1,10 @@ +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.to_s <=> b.to_s }.join("\n") + end +end