diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-09 07:53:56 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-09 07:53:56 -0800 |
commit | f073747786abbe6ada55ed24b696a03e39c3c45d (patch) | |
tree | 7971d871e89d522a58291713761a6c83f68e8d19 /lib/chef/win32 | |
parent | c6e69783705cfd48bfea0c943dc071964dd21311 (diff) | |
download | chef-f073747786abbe6ada55ed24b696a03e39c3c45d.tar.gz |
auto fixing some rubocops
Style/NegatedWhile
Style/ParenthesesAroundCondition
Style/WhileUntilDo
Style/WordArray
Performance/ReverseEach
Style/ColonMethodCall
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/eventlog.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/file.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security/sid.rb | 6 | ||||
-rw-r--r-- | lib/chef/win32/security/token.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/unicode.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/version.rb | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/win32/eventlog.rb b/lib/chef/win32/eventlog.rb index 0562f0c10e..723b43fc44 100644 --- a/lib/chef/win32/eventlog.rb +++ b/lib/chef/win32/eventlog.rb @@ -16,7 +16,7 @@ # limitations under the License. # -if Chef::Platform::windows? and not Chef::Platform::windows_server_2003? +if Chef::Platform.windows? and not Chef::Platform.windows_server_2003? if !defined? Chef::Win32EventLogLoaded if defined? Windows::Constants [:INFINITE, :WAIT_FAILED, :FORMAT_MESSAGE_IGNORE_INSERTS, :ERROR_INSUFFICIENT_BUFFER].each do |c| diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb index 19b17b7d7c..94a771c3ba 100644 --- a/lib/chef/win32/file.rb +++ b/lib/chef/win32/file.rb @@ -76,7 +76,7 @@ class Chef is_symlink = false path = encode_path(file_name) if ::File.exists?(file_name) - if ((GetFileAttributesW(path) & FILE_ATTRIBUTE_REPARSE_POINT) > 0) + if (GetFileAttributesW(path) & FILE_ATTRIBUTE_REPARSE_POINT) > 0 file_search_handle(file_name) do |handle, find_data| if find_data[:dw_reserved_0] == IO_REPARSE_TAG_SYMLINK is_symlink = true diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb index 4d2d252dd3..665cba8880 100644 --- a/lib/chef/win32/security/sid.rb +++ b/lib/chef/win32/security/sid.rb @@ -46,7 +46,7 @@ class Chef end def self.from_string_sid(string_sid) - Chef::ReservedNames::Win32::Security::convert_string_sid_to_sid(string_sid) + Chef::ReservedNames::Win32::Security.convert_string_sid_to_sid(string_sid) end def ==(other) @@ -275,10 +275,10 @@ class Chef status = ERROR_MORE_DATA - while(status == ERROR_MORE_DATA) do + while(status == ERROR_MORE_DATA) status = NetUserEnum(servername, level, filter, bufptr, prefmaxlen, entriesread, totalentries, resume_handle) - if (status == NERR_Success || status == ERROR_MORE_DATA) + if status == NERR_Success || status == ERROR_MORE_DATA entriesread.read_long.times.collect do |i| user_info = USER_INFO_3.new(bufptr.read_pointer + i * USER_INFO_3.size) # Check if the account is the Administrator account diff --git a/lib/chef/win32/security/token.rb b/lib/chef/win32/security/token.rb index f8b6790d44..38ef03b33c 100644 --- a/lib/chef/win32/security/token.rb +++ b/lib/chef/win32/security/token.rb @@ -55,7 +55,7 @@ class Chef def adjust_privileges(privileges_struct) if privileges_struct[:PrivilegeCount] > 0 - Chef::ReservedNames::Win32::Security::adjust_token_privileges(self, privileges_struct) + Chef::ReservedNames::Win32::Security.adjust_token_privileges(self, privileges_struct) end end diff --git a/lib/chef/win32/unicode.rb b/lib/chef/win32/unicode.rb index b0fcf6492d..d531463be0 100644 --- a/lib/chef/win32/unicode.rb +++ b/lib/chef/win32/unicode.rb @@ -38,7 +38,7 @@ module FFI # Find the length of the string length = 0 last_char = nil - while last_char != "\000\000" do + while last_char != "\000\000" length += 1 last_char = self.get_bytes(0, length * 2)[-2..-1] end diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb index a18211b8c6..85a2744645 100644 --- a/lib/chef/win32/version.rb +++ b/lib/chef/win32/version.rb @@ -76,7 +76,7 @@ class Chef # Obtain sku information for the purpose of identifying # datacenter, cluster, and core skus, the latter 2 only # exist in releases after Windows Server 2003 - if ! Chef::Platform::windows_server_2003? + if ! Chef::Platform.windows_server_2003? @sku = get_product_info(@major_version, @minor_version, @sp_major_version, @sp_minor_version) else # The get_product_info API is not supported on Win2k3, |