diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-04 11:13:26 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-04 11:13:26 -0800 |
commit | 6ec521c0b86c266b9dd5d17a6060139dab404c3b (patch) | |
tree | a27bf7a007bfeebd64258c2e5652f6da37b73efc /lib/chef/knife.rb | |
parent | ee53ee1aba16ee2ad7c1fdde18869af971dcba67 (diff) | |
parent | 4fd88f1f3c7d847712e61abab2bac6cb4a987265 (diff) | |
download | chef-6ec521c0b86c266b9dd5d17a6060139dab404c3b.tar.gz |
Merge pull request #4617 from chef/lcg/chefstyle-perf
Autofixing new Perf cops in 0.37.2
Diffstat (limited to 'lib/chef/knife.rb')
-rw-r--r-- | lib/chef/knife.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb index 8f7232d927..636be0dbc7 100644 --- a/lib/chef/knife.rb +++ b/lib/chef/knife.rb @@ -515,11 +515,12 @@ class Chef response.body end - def create_object(object, pretty_name = nil, object_class: nil, &block) + # FIXME: yard with @yield + def create_object(object, pretty_name = nil, object_class: nil) output = edit_data(object, object_class: object_class) if Kernel.block_given? - output = block.call(output) + output = yield(output) else output.save end @@ -531,11 +532,12 @@ class Chef output(output) if config[:print_after] end - def delete_object(klass, name, delete_name = nil, &block) + # FIXME: yard with @yield + def delete_object(klass, name, delete_name = nil) confirm("Do you really want to delete #{name}") if Kernel.block_given? - object = block.call + object = yield else object = klass.load(name) object.destroy |