Skip to content

Commit b9bed77

Browse files
committed
more rubocop
1 parent a43d2e0 commit b9bed77

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/puppet/provider/package/openbsd.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def latest
8282

8383
if output =~ /^#{resource[:name]}-(\d[^-]*)-?(\w*) \(installed\)$/
8484
debug "Package is already the latest available"
85-
return properties[:ensure]
85+
properties[:ensure]
8686
else
8787
match = /^(.*)-(\d[^-]*)-?(\w*)$/.match(output)
8888
debug "Latest available for #{resource[:name]}: #{match[2]}"
@@ -91,7 +91,7 @@ def latest
9191
return match[2]
9292
end
9393

94-
vcmp = properties[:ensure].split('.').map { |s|s.to_i } <=> match[2].split('.').map { |s|s.to_i }
94+
vcmp = properties[:ensure].split('.').map { &:to_i } <=> match[2].split('.').map { &:to_i }
9595
if vcmp > 0
9696
# The locally installed package may actually be newer than what a mirror
9797
# has. Log it at debug, but ignore it otherwise.
@@ -121,7 +121,6 @@ def install(latest = false)
121121
# pkg_add(1) doesn't set the return value upon failure so we have to peek
122122
# at it's output to see if something went wrong.
123123
output = Puppet::Util.withenv({}) { pkgadd cmd.flatten.compact }
124-
require 'pp'
125124
pp output
126125
if output =~ /Can't find /
127126
self.fail "pkg_add returned: #{output.chomp}"
@@ -145,8 +144,8 @@ def get_full_name(latest = false)
145144
end
146145
"#{resource[:name]}-#{use_version}-#{resource[:flavor]}"
147146
elsif resource[:name].to_s.match(/[a-z0-9]%[0-9a-z]/i)
148-
"#{resource[:name]}"
149-
elsif ! latest
147+
"#{resource[:name]}"
148+
elsif !latest
150149
"#{resource[:name]}--"
151150
else
152151
# If :ensure contains a version, use that instead of looking it up.
@@ -168,7 +167,7 @@ def get_full_name(latest = false)
168167

169168
def get_version
170169
pkg_search_name = @resource[:name]
171-
unless pkg_search_name.match(/[a-z0-9]%[0-9a-z]/i) and ! @resource[:flavor]
170+
unless pkg_search_name.match(/[a-z0-9]%[0-9a-z]/i) and !@resource[:flavor]
172171
# we are only called when no flavor is specified
173172
# so append '--' to the :name to avoid patch versions on flavors
174173
pkg_search_name << "--"

0 commit comments

Comments
 (0)