mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Move any?
definition to Configuration class
This makes the `any?` method available outside of the DSL module.
This commit is contained in:
parent
35af88581c
commit
b25f77bee5
2 changed files with 10 additions and 6 deletions
|
@ -58,6 +58,15 @@ module Capistrano
|
|||
return value
|
||||
end
|
||||
|
||||
def any?(key)
|
||||
value = fetch(key)
|
||||
if value && value.respond_to?(:any?)
|
||||
value.any?
|
||||
else
|
||||
!fetch(key).nil?
|
||||
end
|
||||
end
|
||||
|
||||
def validate(key, &validator)
|
||||
vs = (validators[key] || [])
|
||||
vs << validator
|
||||
|
|
|
@ -13,12 +13,7 @@ module Capistrano
|
|||
end
|
||||
|
||||
def any?(key)
|
||||
value = fetch(key)
|
||||
if value && value.respond_to?(:any?)
|
||||
value.any?
|
||||
else
|
||||
!fetch(key).nil?
|
||||
end
|
||||
env.any?(key)
|
||||
end
|
||||
|
||||
def roles(*names)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue