summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-23 11:36:29 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-23 11:36:29 -0800
commitf17fc92d3b8400cc91bfd384c5bf39fd40bdf5b1 (patch)
treec034024fd7fd216dcc3dfd8f0d3fa95ced5a89f6
parent271d3e4f91e3d158c9112512ac75d0ca51fc928d (diff)
downloadchef-f17fc92d3b8400cc91bfd384c5bf39fd40bdf5b1.tar.gz
remove unused block argumentslcg/chefstyle-perf
-rw-r--r--lib/chef/chef_fs/data_handler/container_data_handler.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/data_handler_base.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/organization_data_handler.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/policy_data_handler.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/policy_group_data_handler.rb2
-rw-r--r--lib/chef/cookbook_version.rb2
-rw-r--r--lib/chef/guard_interpreter/resource_guard_interpreter.rb2
-rw-r--r--lib/chef/http.rb2
-rw-r--r--lib/chef/http/socketless_chef_zero_client.rb2
-rw-r--r--lib/chef/knife.rb4
-rw-r--r--lib/chef/mixin/command.rb2
-rw-r--r--lib/chef/mixin/provides.rb2
-rw-r--r--lib/chef/resource_collection/resource_list.rb2
-rw-r--r--lib/chef/run_list.rb4
-rw-r--r--lib/chef/shell/model_wrapper.rb2
-rw-r--r--lib/chef/util/windows/net_user.rb2
-rw-r--r--lib/chef/win32/api/file.rb6
-rw-r--r--spec/functional/win32/versions_spec.rb2
-rw-r--r--spec/support/matchers/leak.rb2
-rw-r--r--spec/support/mock/constant.rb2
-rw-r--r--spec/support/mock/platform.rb2
-rw-r--r--spec/support/shared/integration/knife_support.rb2
-rw-r--r--spec/unit/chef_fs/parallelizer.rb2
-rw-r--r--spec/unit/dsl/resources_spec.rb2
25 files changed, 29 insertions, 29 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,
diff --git a/spec/functional/win32/versions_spec.rb b/spec/functional/win32/versions_spec.rb
index 53fce39491..d6e840ed7f 100644
--- a/spec/functional/win32/versions_spec.rb
+++ b/spec/functional/win32/versions_spec.rb
@@ -50,7 +50,7 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on
@version = Chef::ReservedNames::Win32::Version.new
end
- def for_each_windows_version(&block)
+ def for_each_windows_version
@version.methods.each do |method_name|
if Chef::ReservedNames::Win32::Version::WIN_VERSIONS.keys.find { |key| method_name.to_s == Chef::ReservedNames::Win32::Version.send(:method_name_from_marketing_name, key) }
yield method_name
diff --git a/spec/support/matchers/leak.rb b/spec/support/matchers/leak.rb
index f50a1bf5f7..5f22c1c151 100644
--- a/spec/support/matchers/leak.rb
+++ b/spec/support/matchers/leak.rb
@@ -20,7 +20,7 @@ module Matchers
module LeakBase
include RSpec::Matchers
- def initialize(opts = {}, &block)
+ def initialize(opts = {})
@warmup = opts[:warmup] || 5
@iterations = opts[:iterations] || 100
@variance = opts[:variance] || 5000
diff --git a/spec/support/mock/constant.rb b/spec/support/mock/constant.rb
index 942905144f..3a23b4d8d8 100644
--- a/spec/support/mock/constant.rb
+++ b/spec/support/mock/constant.rb
@@ -4,7 +4,7 @@
# http://missingbit.blogspot.com/2011/07/stubbing-constants-in-rspec_20.html
# http://digitaldumptruck.jotabout.com/?p=551
-def mock_constants(constants, &block)
+def mock_constants(constants)
saved_constants = {}
constants.each do |constant, val|
source_object, const_name = parse_constant(constant)
diff --git a/spec/support/mock/platform.rb b/spec/support/mock/platform.rb
index ef94678b64..c6670827f9 100644
--- a/spec/support/mock/platform.rb
+++ b/spec/support/mock/platform.rb
@@ -5,7 +5,7 @@
# 'i386-mingw32' (windows) or 'x86_64-darwin11.2.0' (unix). Usueful for
# testing code that mixes in platform specific modules like +Chef::Mixin::Securable+
# or +Chef::FileAccessControl+
-def platform_mock(platform = :unix, &block)
+def platform_mock(platform = :unix)
allow(ChefConfig).to receive(:windows?).and_return(platform == :windows ? true : false)
ENV["SYSTEMDRIVE"] = (platform == :windows ? "C:" : nil)
diff --git a/spec/support/shared/integration/knife_support.rb b/spec/support/shared/integration/knife_support.rb
index fe9c6f78a7..1e81cd115c 100644
--- a/spec/support/shared/integration/knife_support.rb
+++ b/spec/support/shared/integration/knife_support.rb
@@ -23,7 +23,7 @@ require "chef/log"
module KnifeSupport
DEBUG = ENV["DEBUG"]
- def knife(*args, &block)
+ def knife(*args)
# Allow knife('role from file roles/blah.json') rather than requiring the
# arguments to be split like knife('role', 'from', 'file', 'roles/blah.json')
# If any argument will have actual spaces in it, the long form is required.
diff --git a/spec/unit/chef_fs/parallelizer.rb b/spec/unit/chef_fs/parallelizer.rb
index 96b713b547..9de8077677 100644
--- a/spec/unit/chef_fs/parallelizer.rb
+++ b/spec/unit/chef_fs/parallelizer.rb
@@ -463,7 +463,7 @@ describe Chef::ChefFS::Parallelizer do
attr_reader :num_processed
- def each(&each_block)
+ def each
@values.each do |value|
@num_processed += 1
yield(value)
diff --git a/spec/unit/dsl/resources_spec.rb b/spec/unit/dsl/resources_spec.rb
index 53cd6fcdb1..dc05f8bcf4 100644
--- a/spec/unit/dsl/resources_spec.rb
+++ b/spec/unit/dsl/resources_spec.rb
@@ -25,7 +25,7 @@ describe Chef::DSL::Resources do
r = declared_resources
Class.new do
include Chef::DSL::Resources
- define_method(:declare_resource) do |dsl_name, name, _created_at, &_block|
+ define_method(:declare_resource) do |dsl_name, name, _created_at|
r << [dsl_name, name]
end
end