Skip to content

Latest commit

 

History

History
18 lines (10 loc) · 547 Bytes

2.x-DSL-Configuration-Variables-Exists.md

File metadata and controls

18 lines (10 loc) · 547 Bytes

Definition

exists?(name) 

Module

Capistrano::Configuration::Variables 

This method returns true if the given variable has been set, and false otherwise. It can be useful for determining whether a variable has already been set before setting a default (such as would be the case if the variable were set on the command-line).

set :user, ENV['USER'] unless exists?(:user)
set(:revision) { query_revision } unless exists?(:revision)

Arguments

name

This is the name of a variable to query. It should be a symbol.