Skip to content

Commit 7daec92

Browse files
committed
Apply remaining rubocop fixes
1 parent d94d896 commit 7daec92

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/puppet/functions/postgresql/postgresql_escape.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ def default_impl(input_string)
2525
end
2626

2727
def tag_needed?(input_string)
28-
input_string =~ %r{\$\$} || input_string.end_with?('$') # rubocop:disable Performance/StringInclude
28+
input_string.include?('$$') || input_string.end_with?('$')
2929
end
3030
end

lib/puppet/provider/postgresql_psql/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def run_sql_command(sql)
3131

3232
private
3333

34-
def get_environment # rubocop:disable Naming/AccessorMethodName : Refactor does not work correctly
34+
def get_environment
3535
environment = (resource[:connect_settings] || {}).dup
3636
envlist = resource[:environment]
3737
return environment unless envlist

lib/puppet/provider/postgresql_replication_slot/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
commands psql: 'psql'
66

77
def self.instances
8-
run_sql_command('SELECT * FROM pg_replication_slots;')[0].split("\n").select { |l| l =~ %r{\|} }.map do |l| # rubocop:disable Performance/StringInclude
8+
run_sql_command('SELECT * FROM pg_replication_slots;')[0].split("\n").select { |l| l.include('|') }.map do |l|
99
name, *_others = l.strip.split(%r{\s+\|\s+})
1010
new(name: name,
1111
ensure: :present)

lib/puppet/util/postgresql_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def attempt_connection(sleep_length, tries)
4343
Puppet.debug "PostgresqlValidator.attempt_connection: #{build_validate_cmd}"
4444
result = execute_command
4545
if result && !result.empty?
46-
Puppet.debug "PostgresqlValidator.attempt_connection: Connection to #{@resource[:db_name] || parse_connect_settings.select { |elem| elem.match %r{PGDATABASE} }} successful!" # rubocop:disable Performance/StringInclude
46+
Puppet.debug "PostgresqlValidator.attempt_connection: Connection to #{@resource[:db_name] || parse_connect_settings.select { |elem| elem.include?('PGDATABASE') }} successful!"
4747
return true
4848
else
4949
Puppet.warning "PostgresqlValidator.attempt_connection: Sleeping for #{sleep_length} seconds"

0 commit comments

Comments
 (0)