Method: Capistrano::Deploy::SCM::Base#local

Defined in:
lib/capistrano/recipes/deploy/scm/base.rb

#localObject

Returns a proxy that wraps the SCM instance and forces it to operate in “local” mode, which changes how variables are looked up in the configuration. Normally, if the value of a variable “foo” is needed, it is queried for in the configuration as “foo”. However, in “local” mode, first “local_foo” would be looked for, and only if it is not found would “foo” be used. This allows for both (e.g.) “scm_command” and “local_scm_command” to be set, if the two differ.

Alternatively, it may be called with a block, and for the duration of the block, all requests on this configuration object will be considered local.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/capistrano/recipes/deploy/scm/base.rb', line 59

def local
  if block_given?
    begin
      saved, @local_mode = @local_mode, true
      yield
    ensure
      @local_mode = saved
    end
  else
    LocalProxy.new(self)
  end
end