opscode/chef — pull request #2049 by bahamas10 (2014-09-13 01:11:36+00:00)
Title: support arrays for not_if and only_if

# summary

this allows `only_if` and `not_if` to be specified as arrays to pass to `shell_out`. this is useful for skipping the shell and not subjecting any of the commands to possible word-splitting

``` ruby
execute 'foo' do
command ['my', 'command', 'here'] # valid in master
only_if ['foo', 'bar'] # not valid in master, valid with this PR
end
```

this becomes useful when you want to interweave variables with commands... this separates data from logic

``` ruby
dataset = 'tank/my-dataset'
execute 'ZFS dataset' do
command ['zfs', 'create', dataset]
not_if ['zfs', 'list', dataset]
end
```