diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-23 11:36:29 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-23 11:36:29 -0800 |
commit | f17fc92d3b8400cc91bfd384c5bf39fd40bdf5b1 (patch) | |
tree | c034024fd7fd216dcc3dfd8f0d3fa95ced5a89f6 /lib/chef | |
parent | 271d3e4f91e3d158c9112512ac75d0ca51fc928d (diff) | |
download | chef-f17fc92d3b8400cc91bfd384c5bf39fd40bdf5b1.tar.gz |
remove unused block argumentslcg/chefstyle-perf
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/chef_fs/data_handler/container_data_handler.rb | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/data_handler/data_handler_base.rb | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/data_handler/organization_data_handler.rb | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/data_handler/policy_data_handler.rb | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/data_handler/policy_group_data_handler.rb | 2 | ||||
-rw-r--r-- | lib/chef/cookbook_version.rb | 2 | ||||
-rw-r--r-- | lib/chef/guard_interpreter/resource_guard_interpreter.rb | 2 | ||||
-rw-r--r-- | lib/chef/http.rb | 2 | ||||
-rw-r--r-- | lib/chef/http/socketless_chef_zero_client.rb | 2 | ||||
-rw-r--r-- | lib/chef/knife.rb | 4 | ||||
-rw-r--r-- | lib/chef/mixin/command.rb | 2 | ||||
-rw-r--r-- | lib/chef/mixin/provides.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource_collection/resource_list.rb | 2 | ||||
-rw-r--r-- | lib/chef/run_list.rb | 4 | ||||
-rw-r--r-- | lib/chef/shell/model_wrapper.rb | 2 | ||||
-rw-r--r-- | lib/chef/util/windows/net_user.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/api/file.rb | 6 |
18 files changed, 22 insertions, 22 deletions
diff --git a/lib/chef/chef_fs/data_handler/container_data_handler.rb b/lib/chef/chef_fs/data_handler/container_data_handler.rb index 6e578e53d6..27bb9dc736 100644 --- a/lib/chef/chef_fs/data_handler/container_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/container_data_handler.rb @@ -15,7 +15,7 @@ class Chef return key == "containername" end - def verify_integrity(object, entry, &on_error) + def verify_integrity(object, entry) base_name = remove_dot_json(entry.name) if object["containername"] != base_name yield("Name in #{entry.path_for_printing} must be '#{base_name}' (is '#{object['name']}')") diff --git a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb index 3b609fad4e..89087e159f 100644 --- a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb @@ -42,7 +42,7 @@ class Chef Chef::DataBagItem end - def verify_integrity(object, entry, &on_error) + def verify_integrity(object, entry) base_name = remove_dot_json(entry.name) if object["raw_data"]["id"] != base_name yield("ID in #{entry.path_for_printing} must be '#{base_name}' (is '#{object['raw_data']['id']}')") diff --git a/lib/chef/chef_fs/data_handler/data_handler_base.rb b/lib/chef/chef_fs/data_handler/data_handler_base.rb index 93d54e3bee..f487218f31 100644 --- a/lib/chef/chef_fs/data_handler/data_handler_base.rb +++ b/lib/chef/chef_fs/data_handler/data_handler_base.rb @@ -189,7 +189,7 @@ class Chef # Verify that the JSON hash for this type has a key that matches its name. # Calls the on_error block with the error, if there is one. # - def verify_integrity(object, entry, &on_error) + def verify_integrity(object, entry) base_name = remove_dot_json(entry.name) if object["name"] != base_name yield("Name must be '#{base_name}' (is '#{object['name']}')") diff --git a/lib/chef/chef_fs/data_handler/organization_data_handler.rb b/lib/chef/chef_fs/data_handler/organization_data_handler.rb index d61e4f454a..4afde75d40 100644 --- a/lib/chef/chef_fs/data_handler/organization_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/organization_data_handler.rb @@ -19,7 +19,7 @@ class Chef return key == "name" end - def verify_integrity(object, entry, &on_error) + def verify_integrity(object, entry) if entry.org != object["name"] yield("Name must be '#{entry.org}' (is '#{object['name']}')") end diff --git a/lib/chef/chef_fs/data_handler/policy_data_handler.rb b/lib/chef/chef_fs/data_handler/policy_data_handler.rb index 47f534bfc9..f88b41401f 100644 --- a/lib/chef/chef_fs/data_handler/policy_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/policy_data_handler.rb @@ -26,7 +26,7 @@ class Chef normalize_hash(policy, defaults) end - def verify_integrity(object_data, entry, &on_error) + def verify_integrity(object_data, entry) name, revision = name_and_revision(entry.name) if object_data["name"] != name yield("Object name '#{object_data['name']}' doesn't match entry '#{entry.name}'.") diff --git a/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb b/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb index d3bdd81e25..e20676a791 100644 --- a/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb @@ -15,7 +15,7 @@ class Chef result end - def verify_integrity(object_data, entry, &on_error) + def verify_integrity(object_data, entry) if object_data["policies"].empty? yield("Policy group #{object_data["name"]} does not have any policies in it.") end diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb index d9078ac48c..6c26ae265a 100644 --- a/lib/chef/cookbook_version.rb +++ b/lib/chef/cookbook_version.rb @@ -485,7 +485,7 @@ class Chef # @deprecated This method was used by the Ruby Chef Server and is no longer # needed. There is no replacement. - def generate_manifest_with_urls(&url_generator) + def generate_manifest_with_urls Chef.log_deprecation("Deprecated method #generate_manifest_with_urls.") rendered_manifest = manifest.dup diff --git a/lib/chef/guard_interpreter/resource_guard_interpreter.rb b/lib/chef/guard_interpreter/resource_guard_interpreter.rb index c21961479c..6df60aec89 100644 --- a/lib/chef/guard_interpreter/resource_guard_interpreter.rb +++ b/lib/chef/guard_interpreter/resource_guard_interpreter.rb @@ -22,7 +22,7 @@ class Chef class GuardInterpreter class ResourceGuardInterpreter < DefaultGuardInterpreter - def initialize(parent_resource, command, opts, &block) + def initialize(parent_resource, command, opts) super(command, opts) @parent_resource = parent_resource @resource = get_interpreter_resource(parent_resource) diff --git a/lib/chef/http.rb b/lib/chef/http.rb index a3673ce281..17024c4bdc 100644 --- a/lib/chef/http.rb +++ b/lib/chef/http.rb @@ -159,7 +159,7 @@ class Chef # # If no block is given, the tempfile is returned, which means it's up to # you to unlink the tempfile when you're done with it. - def streaming_request(path, headers = {}, &block) + def streaming_request(path, headers = {}) url = create_url(path) response, rest_request, return_value = nil, nil, nil tempfile = nil diff --git a/lib/chef/http/socketless_chef_zero_client.rb b/lib/chef/http/socketless_chef_zero_client.rb index e25242c033..482d4ce292 100644 --- a/lib/chef/http/socketless_chef_zero_client.rb +++ b/lib/chef/http/socketless_chef_zero_client.rb @@ -148,7 +148,7 @@ class Chef @url.port end - def request(method, url, body, headers, &handler_block) + def request(method, url, body, headers) request = req_to_rack(method, url, body, headers) res = ChefZero::SocketlessServerMap.request(port, request) diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb index 71127b5b57..1c2c88e540 100644 --- a/lib/chef/knife.rb +++ b/lib/chef/knife.rb @@ -510,7 +510,7 @@ class Chef response.body end - def create_object(object, pretty_name = nil, object_class: nil, &block) + def create_object(object, pretty_name = nil, object_class: nil) output = edit_data(object, object_class: object_class) if Kernel.block_given? @@ -526,7 +526,7 @@ class Chef output(output) if config[:print_after] end - def delete_object(klass, name, delete_name = nil, &block) + def delete_object(klass, name, delete_name = nil) confirm("Do you really want to delete #{name}") if Kernel.block_given? diff --git a/lib/chef/mixin/command.rb b/lib/chef/mixin/command.rb index 435daeda77..387292c8f8 100644 --- a/lib/chef/mixin/command.rb +++ b/lib/chef/mixin/command.rb @@ -177,7 +177,7 @@ class Chef # module_function :popen4 - def chdir_or_tmpdir(dir, &block) + def chdir_or_tmpdir(dir) dir ||= Dir.tmpdir unless File.directory?(dir) raise Chef::Exceptions::Exec, "#{dir} does not exist or is not a directory" diff --git a/lib/chef/mixin/provides.rb b/lib/chef/mixin/provides.rb index 34a078c010..a9dc8bc8f0 100644 --- a/lib/chef/mixin/provides.rb +++ b/lib/chef/mixin/provides.rb @@ -7,7 +7,7 @@ class Chef # TODO no longer needed, remove or deprecate? include Chef::Mixin::DescendantsTracker - def provides(short_name, opts = {}, &block) + def provides(short_name, opts = {}) raise NotImplementedError, :provides end diff --git a/lib/chef/resource_collection/resource_list.rb b/lib/chef/resource_collection/resource_list.rb index 20bfc7b5f0..fe96e1a69c 100644 --- a/lib/chef/resource_collection/resource_list.rb +++ b/lib/chef/resource_collection/resource_list.rb @@ -76,7 +76,7 @@ class Chef @resources end - def execute_each_resource(&resource_exec_block) + def execute_each_resource @iterator = ResourceCollection::StepableIterator.for_collection(@resources) @iterator.each_with_index do |resource, idx| @insert_after_idx = idx diff --git a/lib/chef/run_list.rb b/lib/chef/run_list.rb index 9647ef16e6..86c28e6824 100644 --- a/lib/chef/run_list.rb +++ b/lib/chef/run_list.rb @@ -105,11 +105,11 @@ class Chef @run_list_items[pos] = parse_entry(item) end - def each(&block) + def each @run_list_items.each { |i| yield(i) } end - def each_index(&block) + def each_index @run_list_items.each_index { |i| yield(i) } end diff --git a/lib/chef/shell/model_wrapper.rb b/lib/chef/shell/model_wrapper.rb index 403f9479cf..5f2d89d641 100644 --- a/lib/chef/shell/model_wrapper.rb +++ b/lib/chef/shell/model_wrapper.rb @@ -59,7 +59,7 @@ module Shell alias :load :show - def transform(what_to_transform, &block) + def transform(what_to_transform) if what_to_transform == :all objects_to_transform = list_objects else diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb index 9bb615aee7..1366700304 100644 --- a/lib/chef/util/windows/net_user.rb +++ b/lib/chef/util/windows/net_user.rb @@ -119,7 +119,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows NetUser.net_local_group_add_member(nil, "Users", args[:name]) end - def user_modify(&proc) + def user_modify user = get_info user[:last_logon] = user[:units_per_week] = 0 #ignored as per USER_INFO_3 doc user[:logon_hours] = nil #PBYTE field; \0 == no changes diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb index 09501e66ce..aeb424bab0 100644 --- a/lib/chef/win32/api/file.rb +++ b/lib/chef/win32/api/file.rb @@ -535,7 +535,7 @@ BOOL WINAPI VerQueryValue( # retrieves a file search handle and passes it # to +&block+ along with the find_data. also # ensures the handle is closed on exit of the block - def file_search_handle(path, &block) + def file_search_handle(path) begin # Workaround for CHEF-4419: # Make sure paths starting with "/" has a drive letter @@ -559,7 +559,7 @@ BOOL WINAPI VerQueryValue( # retrieves a file handle and passes it # to +&block+ along with the find_data. also # ensures the handle is closed on exit of the block - def file_handle(path, &block) + def file_handle(path) begin path = canonical_encode_path(path) handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, @@ -574,7 +574,7 @@ BOOL WINAPI VerQueryValue( end end - def symlink_file_handle(path, &block) + def symlink_file_handle(path) begin path = encode_path(path) handle = CreateFileW(path, FILE_READ_EA, FILE_SHARE_READ, |