Skip to content

Commit e27b232

Browse files
committed
maybe you like that more, not_if?
1 parent 8bd2e43 commit e27b232

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

chef/lib/chef/resource/execute.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(name, collection=nil, node=nil)
3030
@cwd = nil
3131
@environment = nil
3232
@group = nil
33-
@onlyif = nil
33+
@only_if = nil
3434
@path = nil
3535
@notify_only = false
3636
@returns = 0
@@ -109,7 +109,12 @@ def timeout(arg=nil)
109109
end
110110

111111
def not_if(arg=nil, &blk)
112-
@not_if = blk ? blk : arg
112+
if Kernel.block_given?
113+
@not_if = blk
114+
else
115+
@not_if = arg if arg
116+
end
117+
@not_if
113118
end
114119

115120
def user(arg=nil)

0 commit comments

Comments
 (0)