diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-10-20 11:54:46 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-10-20 11:54:46 -0700 |
commit | d0dbda11796e819d4a640f9ee58d5a308a109a19 (patch) | |
tree | 7b0879c74125f62cf18f79c0e4597904318882e5 /lib/chef | |
parent | ec534aa0fce2c0199bf622a06eeb2c291185cdee (diff) | |
download | chef-d0dbda11796e819d4a640f9ee58d5a308a109a19.tar.gz |
fixes for rubocop 0.44.1 enginelcg/rubocop-0.44.1
a few cops we have enabled got a little more accurate/stricter
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/application/client.rb | 4 | ||||
-rw-r--r-- | lib/chef/application/solo.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/windows/exe.rb | 7 | ||||
-rw-r--r-- | lib/chef/provider/package/windows/msi.rb | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index cbaa494b71..000aff905b 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -202,7 +202,7 @@ class Chef::Application::Client < Chef::Application :short => "-o RunlistItem,RunlistItem...", :long => "--override-runlist RunlistItem,RunlistItem...", :description => "Replace current run list with specified items for a single run", - :proc => lambda {|items| + :proc => lambda { |items| items = items.split(",") items.compact.map do |item| Chef::RunList::RunListItem.new(item) @@ -213,7 +213,7 @@ class Chef::Application::Client < Chef::Application :short => "-r RunlistItem,RunlistItem...", :long => "--runlist RunlistItem,RunlistItem...", :description => "Permanently replace current run list with specified items", - :proc => lambda {|items| + :proc => lambda { |items| items = items.split(",") items.compact.map do |item| Chef::RunList::RunListItem.new(item) diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb index 446a0f007d..1481338a9c 100644 --- a/lib/chef/application/solo.rb +++ b/lib/chef/application/solo.rb @@ -166,7 +166,7 @@ class Chef::Application::Solo < Chef::Application :short => "-o RunlistItem,RunlistItem...", :long => "--override-runlist RunlistItem,RunlistItem...", :description => "Replace current run list with specified items", - :proc => lambda {|items| + :proc => lambda { |items| items = items.split(",") items.compact.map do |item| Chef::RunList::RunListItem.new(item) diff --git a/lib/chef/provider/package/windows/exe.rb b/lib/chef/provider/package/windows/exe.rb index 44a2f19d1e..60065d9019 100644 --- a/lib/chef/provider/package/windows/exe.rb +++ b/lib/chef/provider/package/windows/exe.rb @@ -89,9 +89,10 @@ class Chef end def current_installed_version - @current_installed_version ||= uninstall_entries.count == 0 ? nil : begin - uninstall_entries.map { |entry| entry.display_version }.uniq - end + @current_installed_version ||= + if uninstall_entries.count != 0 + uninstall_entries.map { |entry| entry.display_version }.uniq + end end # http://unattended.sourceforge.net/installers.php diff --git a/lib/chef/provider/package/windows/msi.rb b/lib/chef/provider/package/windows/msi.rb index ac771688e7..96c6728ef4 100644 --- a/lib/chef/provider/package/windows/msi.rb +++ b/lib/chef/provider/package/windows/msi.rb @@ -50,7 +50,7 @@ class Chef Chef::Log.debug("#{new_resource} checking package status and version for #{product_code}") get_installed_version(product_code) else - uninstall_entries.count == 0 ? nil : begin + if uninstall_entries.count != 0 uninstall_entries.map { |entry| entry.display_version }.uniq end end |