1
0
Fork 0
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:
Matt Brictson 2015-12-25 18:36:50 -08:00
parent 35af88581c
commit b25f77bee5
2 changed files with 10 additions and 6 deletions

View file

@ -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

View file

@ -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)