capistrano/capistrano — pull request #743 by rubyisbeautiful (2013-10-29 15:35:55+00:00)
Title: Fix split command argument leading to error raised and incorrect path returned

It looks like last_release_path is doing split[1], and that's the same code as in rollback_release_path. It produces:
1) an error when there is only one release:
```
DEBUG [3ce6105b] Running /usr/bin/env ls -xr /foo/releases on somebox
DEBUG [3ce6105b] Command: ( RAILS_ENV=production /usr/bin/env ls -xr /foo/releases )
DEBUG [3ce6105b] Finished in 1.081 seconds with exit status 0 (successful).
DEBUG [3ce6105b]	20131029143226
DEBUG [3ce6105b] Finished in 1.081 seconds with exit status 0 (successful).
cap aborted!
no implicit conversion of nil into String
/Users/bryan/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/pathname.rb:389:in `initialize'
```
2) the wrong link when running anything else:
given task:
```
namespace :deploy do

task :foo => :last_release_path do
on roles(:all) do
puts release_path
end
end
```

```
$ bin/cap --trace somebox deploy:foo
** Invoke somebox (first_time)
** Execute somebox
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy:foo (first_time)
** Invoke deploy:last_release_path (first_time)
** Execute deploy:last_release_path
DEBUG [874effb4] Running /usr/bin/env ls -xr /foo/releases on somebox
DEBUG [874effb4] Command: ( RAILS_ENV=production /usr/bin/env ls -xr /foo/releases )
DEBUG [874effb4] Finished in 1.083 seconds with exit status 0 (successful).
DEBUG [874effb4]	20131101000000	20131029143226
DEBUG [874effb4] Finished in 1.083 seconds with exit status 0 (successful).
** Execute deploy:foo
/foo/releases/20131029143226
```

My proposed patch is so simple, maybe I am missing something? I did want to update specs, but I didn't see anything specific to that task. I wanted to add some, but it was a bit complicated. I can give it a go if it's useful.

Thanks all for making and updating cap