diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 13:41:00 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 13:41:00 -0700 |
commit | 174a2748b54a5dbd746005e2aead59221b80f2b9 (patch) | |
tree | 55e4bacca96b540526f3c19a00d666e68610ea6e /lib/chef | |
parent | 3b10f9ca503dcbce747241281b9151d3d010f9ef (diff) | |
download | chef-174a2748b54a5dbd746005e2aead59221b80f2b9.tar.gz |
fix 4 cops
- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
EnforcedStyle: consistent
- Layout/BlockEndNewline
the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/api_client/registration.rb | 3 | ||||
-rw-r--r-- | lib/chef/data_bag.rb | 3 | ||||
-rw-r--r-- | lib/chef/file_access_control/windows.rb | 3 | ||||
-rw-r--r-- | lib/chef/mixin/windows_env_helper.rb | 4 | ||||
-rw-r--r-- | lib/chef/node.rb | 3 | ||||
-rw-r--r-- | lib/chef/provider/execute.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/reboot.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/service/simple.rb | 3 | ||||
-rw-r--r-- | lib/chef/util/dsc/configuration_generator.rb | 3 | ||||
-rw-r--r-- | lib/chef/win32/file.rb | 3 | ||||
-rw-r--r-- | lib/chef/win32/net.rb | 12 | ||||
-rw-r--r-- | lib/chef/win32/security/token.rb | 3 |
12 files changed, 27 insertions, 17 deletions
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb index 270945cfc2..fea4b001bc 100644 --- a/lib/chef/api_client/registration.rb +++ b/lib/chef/api_client/registration.rb @@ -162,8 +162,7 @@ class Chef api_version: "0", client_name: Chef::Config[:validation_client_name], signing_key_filename: Chef::Config[:validation_key], - } - ) + }) end # Whether or not to generate keys locally and post the public key to the diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb index d7e2de7397..67180559da 100644 --- a/lib/chef/data_bag.rb +++ b/lib/chef/data_bag.rb @@ -98,7 +98,8 @@ class Chef end names += Dir.glob(File.join( - Chef::Util::PathHelper.escape_glob_dir(path), "*")).map { |f| File.basename(f) }.sort + Chef::Util::PathHelper.escape_glob_dir(path), "*" + )).map { |f| File.basename(f) }.sort end names.inject({}) { |h, n| h[n] = n; h } else diff --git a/lib/chef/file_access_control/windows.rb b/lib/chef/file_access_control/windows.rb index e14c5a2746..de08a31876 100644 --- a/lib/chef/file_access_control/windows.rb +++ b/lib/chef/file_access_control/windows.rb @@ -34,7 +34,8 @@ class Chef # We want to mix these in as class methods def writable?(path) ::File.exists?(path) && Chef::ReservedNames::Win32::File.file_access_check( - path, Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE) + path, Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE + ) end end diff --git a/lib/chef/mixin/windows_env_helper.rb b/lib/chef/mixin/windows_env_helper.rb index 6a5240c005..8036fa2bbe 100644 --- a/lib/chef/mixin/windows_env_helper.rb +++ b/lib/chef/mixin/windows_env_helper.rb @@ -46,8 +46,8 @@ class Chef if SendMessageTimeoutA(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string("Environment").address, flags, 5000, nil) == 0 Chef::ReservedNames::Win32::Error.raise! end - if SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string( - utf8_to_wide("Environment") + if SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string( + utf8_to_wide("Environment") ).address, flags, 5000, nil) == 0 Chef::ReservedNames::Win32::Error.raise! end diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 6d5bb6d8e4..dfd2c685e1 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -121,7 +121,8 @@ class Chef { name: { kind_of: String, cannot_be: :blank, regex: /^[\-[:alnum:]_:.]+$/ }, - }) + } + ) @name = arg else @name diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb index c4312b58b4..61107a84ba 100644 --- a/lib/chef/provider/execute.rb +++ b/lib/chef/provider/execute.rb @@ -121,7 +121,7 @@ class Chef def sentinel_file Pathname.new(Chef::Util::PathHelper.cleanpath( - ( cwd && creates_relative? ) ? ::File.join(cwd, creates) : creates + ( cwd && creates_relative? ) ? ::File.join(cwd, creates) : creates )) end diff --git a/lib/chef/provider/reboot.rb b/lib/chef/provider/reboot.rb index 407d847313..7fd3c32d53 100644 --- a/lib/chef/provider/reboot.rb +++ b/lib/chef/provider/reboot.rb @@ -49,7 +49,7 @@ class Chef reason: new_resource.reason, timestamp: Time.now, requested_by: new_resource.name - ) + ) end def action_request_reboot diff --git a/lib/chef/provider/service/simple.rb b/lib/chef/provider/service/simple.rb index 302a2e75f4..754437b4a0 100644 --- a/lib/chef/provider/service/simple.rb +++ b/lib/chef/provider/service/simple.rb @@ -73,7 +73,8 @@ class Chef requirements.assert(:all_actions) do |a| a.assertion do @new_resource.status_command || supports[:status] || - (!ps_cmd.nil? && !ps_cmd.empty?) end + (!ps_cmd.nil? && !ps_cmd.empty?) + end a.failure_message Chef::Exceptions::Service, "#{@new_resource} could not determine how to inspect the process table, please set this node's 'command.ps' attribute" end requirements.assert(:all_actions) do |a| diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb index 0c101b204d..6f3dd908b8 100644 --- a/lib/chef/util/dsc/configuration_generator.rb +++ b/lib/chef/util/dsc/configuration_generator.rb @@ -40,7 +40,8 @@ class Chef::Util::DSC document_generation_cmdlet = Chef::Util::Powershell::Cmdlet.new( @node, - configuration_document_generation_code(script_path, configuration_name)) + configuration_document_generation_code(script_path, configuration_name) + ) merged_configuration_flags = get_merged_configuration_flags!(configuration_flags, configuration_name) diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb index 58e28735cb..4fac3fe797 100644 --- a/lib/chef/win32/file.rb +++ b/lib/chef/win32/file.rb @@ -182,7 +182,8 @@ class Chef Chef::ReservedNames::Win32::Security::STANDARD_RIGHTS_READ token = Chef::ReservedNames::Win32::Security.open_process_token( Chef::ReservedNames::Win32::Process.get_current_process, - token_rights) + token_rights + ) duplicate_token = token.duplicate_token(:SecurityImpersonation) mapping = Chef::ReservedNames::Win32::Security::GENERIC_MAPPING.new diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb index b92b723e27..1c08f2fbeb 100644 --- a/lib/chef/win32/net.rb +++ b/lib/chef/win32/net.rb @@ -224,7 +224,8 @@ class Chef buf = FFI::MemoryPointer.new(LOCALGROUP_MEMBERS_INFO_3, members.size) Array.new(members.size) do |i| member_info = LOCALGROUP_MEMBERS_INFO_3.new( - buf + i * LOCALGROUP_MEMBERS_INFO_3.size) + buf + i * LOCALGROUP_MEMBERS_INFO_3.size + ) member_info[:lgrmi3_domainandname] = FFI::MemoryPointer.from_string(wstring(members[i])) member_info end @@ -236,7 +237,8 @@ class Chef lgrmi3s = members_to_lgrmi3(members) rc = NetLocalGroupAddMembers( - server_name, group_name, 3, lgrmi3s[0], members.size) + server_name, group_name, 3, lgrmi3s[0], members.size + ) if rc != NERR_Success Chef::ReservedNames::Win32::Error.raise!(nil, rc) @@ -249,7 +251,8 @@ class Chef lgrmi3s = members_to_lgrmi3(members) rc = NetLocalGroupSetMembers( - server_name, group_name, 3, lgrmi3s[0], members.size) + server_name, group_name, 3, lgrmi3s[0], members.size + ) if rc != NERR_Success Chef::ReservedNames::Win32::Error.raise!(nil, rc) @@ -262,7 +265,8 @@ class Chef lgrmi3s = members_to_lgrmi3(members) rc = NetLocalGroupDelMembers( - server_name, group_name, 3, lgrmi3s[0], members.size) + server_name, group_name, 3, lgrmi3s[0], members.size + ) if rc != NERR_Success Chef::ReservedNames::Win32::Error.raise!(nil, rc) diff --git a/lib/chef/win32/security/token.rb b/lib/chef/win32/security/token.rb index 5710d896b7..78c79fbb44 100644 --- a/lib/chef/win32/security/token.rb +++ b/lib/chef/win32/security/token.rb @@ -35,7 +35,8 @@ class Chef def enable_privileges(*privilege_names) # Build the list of privileges we want to set new_privileges = Chef::ReservedNames::Win32::API::Security::TOKEN_PRIVILEGES.new( - FFI::MemoryPointer.new(Chef::ReservedNames::Win32::API::Security::TOKEN_PRIVILEGES.size_with_privileges(privilege_names.length))) + FFI::MemoryPointer.new(Chef::ReservedNames::Win32::API::Security::TOKEN_PRIVILEGES.size_with_privileges(privilege_names.length)) + ) new_privileges[:PrivilegeCount] = 0 privilege_names.each do |privilege_name| luid = Chef::ReservedNames::Win32::API::Security::LUID.new |