ndbroadbent/capistrano_deploy_lock — pull request #6 by kouno (2014-11-18 22:25:59+00:00)
Title: Fix return statement

Reproducing this error:
1- For the purpose of this test, set the default time expiry to 1 (`set :default_lock_expiry, 1`)
2- Run `cap deploy:create_lock`
3- Run `cap deploy:check_lock`

In my case it produced something like:
```
Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano_deploy_lock-1.3.3/lib/capistrano/recipes/deploy_lock.rb:29:in `block (3 levels) in fetch_deploy_lock': unexpected return (LocalJumpError)
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:241:in `[]'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:241:in `block (4 levels) in open_channels'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:569:in `call'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:569:in `do_data'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:566:in `channel_data'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/processable.rb:17:in `block in process_iteration'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/processable.rb:45:in `block in ensure_each_session'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/processable.rb:43:in `each'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/processable.rb:43:in `ensure_each_session'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/processable.rb:17:in `process_iteration'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:171:in `block (2 levels) in process!'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:170:in `loop'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:170:in `block in process!'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:169:in `process!'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/command.rb:140:in `process'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/actions/invocation.rb:198:in `block in run_tree'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/connections.rb:205:in `block in execute_on_servers'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/connections.rb:193:in `each'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/connections.rb:193:in `each_slice'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/connections.rb:193:in `execute_on_servers'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/actions/invocation.rb:196:in `run_tree'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/actions/invocation.rb:155:in `run'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano_deploy_lock-1.3.3/lib/capistrano/recipes/deploy_lock.rb:44:in `remove_deploy_lock'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano_deploy_lock-1.3.3/lib/capistrano/recipes/deploy_lock.rb:137:in `block (3 levels) in '
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `each'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:34:in `execute!'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/kouno/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-2.15.5/bin/cap:4:in `'
from ./bin/cap:16:in `load'
from ./bin/cap:16:in `

'
```

I first thought that it was related to my ruby version, but testing it on 1.9.3 didn't fix it either (using 2.1.2 at the moment). A problem with capistrano version? I doubt it... Anyway here's a fix.

Also, I added the date when inspecting a lock as `%H:%M:%S` was a bit lacking. For instance, was my lock created yesterday morning? or this morning?