appsignal/appsignal — pull request #10 by tombruijn (2014-02-27 09:14:53+00:00)
Title: Capistrano 3 support (kind of)

I've modified the Capistrano 2 deploy script to try and make it work on version 3.

To make it work in my own project I've used the following (annotated) [Rake task](https://gist.github.com/tombruijn/9246758) for the past 30-something deploys and it works fine. However, to implement it in the AppSignal gem is a whole different story.

The main issue with this feature is to support both versions of Capistrano and after 2 attempts I'm not feeling it. Just look at the file changes for the end result. The code works, but to make the specs work for both versions? I don't think the end result will be pretty.

Anyway, as you can see it became a bit too messy* , there are too many conditionals, rescues, etc. which would also have to be applied to the specs. The alternative would be to completely separate it for both versions and have a lot of duplicate code and specs.

*: _do note I stopped halfway through when I realized the impact_

However, I think I would be better to make a separate gem for version 3 it as that's the new 'Capistrano way' of doing it (see [capistrano-bunder](https://github.com/capistrano/bundler), [capistrano-rails](https://github.com/capistrano/rails), [etc.](https://github.com/capistrano)). This is this pull request serves mainly as an code example and hopefully a place to discuss the best course of action.

Let me know your thoughts on this!