flowdock/flowdock-api — Issue #1: Problem when capistrano variable 'stage' is undefined
Author: SKoschnicke
Created: 2011-11-02 11:38:06+00:00
State: open

I think there is a problem in the capistrano file, line 19 (https://github.com/flowdock/flowdock-api/blob/master/lib/flowdock/capistrano.rb#L19 ):

```
set :rails_env, (!stage.nil?) ? stage : ENV['RAILS_ENV']
```

Because capistrano provides "variables" via method_missing, calling `nil?` on an undefined capistrano variable results in

```
`method_missing': undefined local variable or method `stage'
```

see http://groups.google.com/group/capistrano/browse_thread/thread/57733d9ce4c43ad2

A solution would be using `variables.include?(:stage)` instead of `stage.nil?`