diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-23 10:45:15 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-23 10:45:15 -0800 |
commit | 271d3e4f91e3d158c9112512ac75d0ca51fc928d (patch) | |
tree | 5beb5e5588db43ecac46f38725cabf5e573fd1d6 /lib/chef/provider/service/arch.rb | |
parent | aa7e0e05395823c66b30f1a810d1720aea3b6d72 (diff) | |
download | chef-271d3e4f91e3d158c9112512ac75d0ca51fc928d.tar.gz |
Autofixing new Perf cops in 0.37.2
6 Performance/Casecmp
18 Performance/Detect
1 Performance/RangeInclude
27 Performance/RedundantBlockCall
6 Performance/RedundantMatch
5 Performance/RedundantMerge
18 Performance/StringReplacement
Diffstat (limited to 'lib/chef/provider/service/arch.rb')
-rw-r--r-- | lib/chef/provider/service/arch.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/service/arch.rb b/lib/chef/provider/service/arch.rb index 9c66fb4098..c0545e9fb3 100644 --- a/lib/chef/provider/service/arch.rb +++ b/lib/chef/provider/service/arch.rb @@ -33,7 +33,7 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init def load_current_resource raise Chef::Exceptions::Service, "Could not find /etc/rc.conf" unless ::File.exists?("/etc/rc.conf") - raise Chef::Exceptions::Service, "No DAEMONS found in /etc/rc.conf" unless ::File.read("/etc/rc.conf").match(/DAEMONS=\((.*)\)/m) + raise Chef::Exceptions::Service, "No DAEMONS found in /etc/rc.conf" unless ::File.read("/etc/rc.conf") =~ /DAEMONS=\((.*)\)/m super @current_resource.enabled(daemons.include?(@current_resource.service_name)) @@ -49,7 +49,7 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init # ) def daemons entries = [] - if ::File.read("/etc/rc.conf").match(/DAEMONS=\((.*)\)/m) + if ::File.read("/etc/rc.conf") =~ /DAEMONS=\((.*)\)/m entries += $1.gsub(/\\?[\r\n]/, " ").gsub(/# *[^ ]+/, " ").split(" ") if $1.length > 0 end |