nikhaldi / exception_notification-rake

Sends mail upon failures in Rake tasks
MIT License
39 stars 14 forks source link

Rails 5 support #19

Closed moubry closed 7 years ago

moubry commented 7 years ago

Currently, this gem only supports Rails ~> 4.1.0 and it would be great if it worked with Rails 5 as well.

robyedlin commented 7 years ago

I don't know if this will help, but in the meantime I have just been using the native methods of ExceptionNotifier to handle rake errors by using a rescue.

In lib/tasks/some_task.rake

task :do_something do
    begin
        # runs the task
        puts "Get up and go."
    rescue => e
        # sends an email with any errors
        ExceptionNotifier.notify_exception(e)
    end
end
nikhaldi commented 7 years ago

Thanks for the pointers. I definitely want to support Rails 5, it's just a matter of finding some time to sit down and do it. In the meantime, I would gladly accept pull requests for this!

nikhaldi commented 7 years ago

I just published a new version of the gem (0.3.0.rc1) which supports Rails 4.2 and later, including Rails 5. It needs a bit more testing before I make it final (removing the .rc1). If you have time to try it out and let me know how it goes, that would help a lot. Thanks!