capistrano/capistrano — pull request #930 by mpapis (2014-02-12 14:07:14+00:00)
Title: make sure deploying? method is available beofre testing it, fix #915

any problem in `Capfile` will be to early for the `deploying?` method to be defined, this suppresses the real problem and prints error about missing `deploying?` method, I was able to simulate it by missing to add quote in `Capfile`, a full repository reproducing it => https://github.com/mpapis/broken-capistrano-project

Before the fix:
```ssh
cap production bundler:install
cap aborted!
/home/mpapis/projects/owned/broken-capistrano-project/Capfile:18: syntax error, unexpected tIDENTIFIER, expecting end-of-input
# require 'capistrano/rvm'
^
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:24:in `load_rakefile'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:15:in `run'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/bin/cap:3:in `'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `load'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `

'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `

'
(See full trace by running task with --trace)
cap aborted!
undefined method `deploying?' for #
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:36:in `exit_because_of_exception'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:24:in `load_rakefile'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:15:in `run'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/bin/cap:3:in `'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `load'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `

'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `

'
(See full trace by running task with --trace)
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:36:in `exit_because_of_exception': undefined method `deploying?' for # (NoMethodError)
from /home/mpapis/.rvm/gems/ruby-2.1.0/gems/rake-10.1.1/lib/rake/application.rb:175:in `rescue in standard_exception_handling'
from /home/mpapis/.rvm/gems/ruby-2.1.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
from /home/mpapis/.rvm/gems/ruby-2.1.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
from /home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:15:in `run'
from /home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/bin/cap:3:in `'
from /home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `load'
from /home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `

'
from /home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `

'
```
after the fix:
```ssh
cap aborted!
/home/mpapis/projects/owned/broken-capistrano-project/Capfile:18: syntax error, unexpected tIDENTIFIER, expecting end-of-input
# require 'capistrano/rvm'
^
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:24:in `load_rakefile'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/lib/capistrano/application.rb:15:in `run'
/home/mpapis/.rvm/gems/ruby-2.1.0/gems/capistrano-3.1.0/bin/cap:3:in `'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `load'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/cap:23:in `

'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/home/mpapis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `

'
(See full trace by running task with --trace)
```