Is having multiple only_if or mix of only_if and not_if inside a Ruby_block supported?
ruby_block 'do something' do
block do
....
end
only_if {}
not_if {}
end
What would be the ordering logic here?
Is having multiple only_if or mix of only_if and not_if inside a Ruby_block supported?
ruby_block 'do something' do
block do
....
end
only_if {}
not_if {}
end
What would be the ordering logic here?
All only_if
and not_if
guards are evaluated and they must all "pass". You should probably avoid doing anything crazy that requires passing state between the guards, but FWIW they are stored and evaluated in the order you wrote them.
Thank you very much. I intend to use only_if and not_if to validate something like File.exists
and note attribute. Should that be fine?
Yes, make sure to understand lazy evaluation if you need it