Skip to content

Commit 6c89748

Browse files
author
jordanbreen28
committed
(CONT-792) - Correct Style/StringConcatenation
1 parent ca4c9a7 commit 6c89748

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,6 @@ Style/OptionalBooleanParameter:
168168
- 'lib/puppet/functions/postgresql/postgresql_password.rb'
169169
- 'lib/puppet/type/postgresql_psql.rb'
170170

171-
# Offense count: 3
172-
# This cop supports unsafe autocorrection (--autocorrect-all).
173-
# Configuration parameters: Mode.
174-
Style/StringConcatenation:
175-
Exclude:
176-
- 'lib/puppet/functions/postgresql/postgresql_acls_to_resources_hash.rb'
177-
- 'lib/puppet/functions/postgresql/postgresql_password.rb'
178-
- 'lib/puppet/provider/postgresql_psql/ruby.rb'
179-
180171
# Offense count: 1
181172
# This cop supports unsafe autocorrection (--autocorrect-all).
182173
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.

lib/puppet/functions/postgresql/postgresql_acls_to_resources_hash.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def default_impl(acls, id, offset)
4040
resource['auth_method'] = parts[3]
4141
resource['auth_option'] = parts.last(parts.length - 4).join(' ') if parts.length > 4
4242
elsif %r{^\d}.match?(parts[4])
43-
resource['address'] = parts[3] + ' ' + parts[4]
43+
resource['address'] = "#{parts[3]} #{parts[4]}"
4444
resource['auth_method'] = parts[5]
4545

4646
resource['auth_option'] = parts.last(parts.length - 6).join(' ') if parts.length > 6

lib/puppet/functions/postgresql/postgresql_password.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def default_impl(username, password, sensitive = false, hash = 'md5', salt = nil
3232

3333
password = password.unwrap if password.respond_to?(:unwrap)
3434
pass = if hash == 'md5'
35-
'md5' + Digest::MD5.hexdigest(password.to_s + username.to_s)
35+
"md5#{Digest::MD5.hexdigest(password.to_s + username.to_s)}"
3636
else
3737
pg_sha256(password, (salt || username))
3838
end

lib/puppet/provider/postgresql_psql/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def run_unless_sql_command(sql)
66
# for the 'unless' queries, we wrap the user's query in a 'SELECT COUNT',
77
# which makes it easier to parse and process the output.
8-
run_sql_command('SELECT COUNT(*) FROM (' + sql + ') count')
8+
run_sql_command("SELECT COUNT(*) FROM (#{sql}) count")
99
end
1010

1111
def run_sql_command(sql)

0 commit comments

Comments
 (0)