capistrano/sshkit — pull request #204 by FooBarWidget (2014-12-24 18:30:11+00:00)
Title: Allow running local commands using `on(:local)`

This works as an alias for `run_locally`. The advantage of this
feature is that Capistrano can be easily configured to perform
actions on the local host or on a server, depending on user input,
without having to replace all `on` calls with `run_locally`.

For example (in Capistrano):

if ENV['RUN_LOCALLY']
server :local, :roles => [:app]
else
server "example.com", :roles => [:app]
end

on roles(:app) do
execute :any_command
end