]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/apache/providers/module.rb
Fix some foodcritic complaints
[chef.git] / cookbooks / apache / providers / module.rb
index 31910ed077a919672f5a209ba2dd0ab6311b2ec0..0a85f7ee4ce1c004642a0d7837dae00f7043ce85 100644 (file)
@@ -22,10 +22,8 @@ def whyrun_supported?
 end
 
 action :install do
-  if not installed?
-    package package_name do
-      version new_resource.version
-    end
+  if !installed?
+    package package_name
 
     updated = true
   else
@@ -42,14 +40,14 @@ action :install do
       notifies :reload, "service[apache2]" if enabled?
     end
 
-    updated = updated || t.updated_by_last_action?
+    updated ||= t.updated_by_last_action?
   end
 
   new_resource.updated_by_last_action(updated)
 end
 
 action :enable do
-  if not enabled?
+  unless enabled?
     link enabled_name("load") do
       to available_name("load")
       owner "root"
@@ -62,7 +60,7 @@ action :enable do
       owner "root"
       group "root"
       notifies :reload, "service[apache2]"
-      only_if { ::File.exists?(available_name("conf")) }
+      only_if { ::File.exist?(available_name("conf")) }
     end
 
     new_resource.updated_by_last_action(true)
@@ -108,9 +106,9 @@ def enabled_name(extension)
 end
 
 def installed?
-  ::File.exists?(available_name("load"))
+  ::File.exist?(available_name("load"))
 end
 
 def enabled?
-  ::File.exists?(enabled_name("load"))
+  ::File.exist?(enabled_name("load"))
 end