Skip to content

Commit 736ad9a

Browse files
committed
Cookstyle auto-corrections
This change is automatically generated by the GitHub Cookstyle Runner.
1 parent 09de294 commit 736ad9a

File tree

13 files changed

+109
-109
lines changed

13 files changed

+109
-109
lines changed

libraries/access.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ def to_s
219219
entry_string.strip
220220
end
221221

222-
def eql?(entry)
223-
return false unless self.class.eql?(entry.class)
222+
def eql?(other)
223+
return false unless self.class.eql?(other.class)
224224

225-
return true if self.class.const_get(:ENTRY_FIELDS).all? { |field| send(field).eql?(entry.send(field)) }
225+
return true if self.class.const_get(:ENTRY_FIELDS).all? { |field| send(field).eql?(other.send(field)) }
226226

227227
false
228228
end
@@ -314,14 +314,14 @@ def to_s
314314
end.join(' ')
315315
end
316316

317-
def eql?(auth_options)
318-
case auth_options
317+
def eql?(other)
318+
case other
319319
when self.class
320-
@options.eql?(auth_options.options)
320+
@options.eql?(other.options)
321321
when Hash
322-
@options.eql?(auth_options)
322+
@options.eql?(other)
323323
when String
324-
to_s.eql?(options_string_parse(auth_options))
324+
to_s.eql?(options_string_parse(other))
325325
else
326326
false
327327
end

libraries/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def default_yum_gpg_key_uri
157157
end
158158

159159
def dnf_module_platform?
160-
(platform_family?('rhel') && node['platform_version'].to_i == 8)
160+
platform_family?('rhel') && node['platform_version'].to_i == 8
161161
end
162162

163163
# determine the appropriate DB init command to run based on RHEL/Amazon release

libraries/ident.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def entry(map_name)
9797
end
9898

9999
def entry?(map_name)
100-
!@entries.filter { |e| e.map_name.eql?(map_name) }.empty?
100+
!@entries.none? { |e| e.map_name.eql?(map_name) }
101101
end
102102

103103
def include?(entry)
@@ -199,10 +199,10 @@ def to_s
199199
entry_string.strip
200200
end
201201

202-
def eql?(entry)
203-
return false unless self.class.eql?(entry.class)
202+
def eql?(other)
203+
return false unless self.class.eql?(other.class)
204204

205-
return true if self.class.const_get(:ENTRY_FIELDS).all? { |field| send(field).eql?(entry.send(field)) }
205+
return true if self.class.const_get(:ENTRY_FIELDS).all? { |field| send(field).eql?(other.send(field)) }
206206

207207
false
208208
end

libraries/sql/role.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def role_sql(new_resource)
7171
next unless property_is_set?(perm)
7272

7373
if new_resource.send(perm)
74-
sql.push("#{perm.to_s.upcase.gsub('_', ' ')}")
74+
sql.push(perm.to_s.upcase.gsub('_', ' ').to_s)
7575
else
7676
sql.push("NO#{perm.to_s.upcase.gsub('_', ' ')}")
7777
end

resources/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
property :version, [String, Integer],
3131
default: lazy { installed_postgresql_major_version },
3232
desired_state: false,
33-
coerce: proc { |p| p.to_s },
33+
coerce: proc(&:to_s),
3434
description: 'PostgreSQL installed version override'
3535

3636
property :data_directory, String,

resources/database.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
property :connection_limit, [Integer, String],
6565
default: -1,
66-
coerce: proc { |p| p.to_s },
66+
coerce: proc(&:to_s),
6767
description: 'How many concurrent connections can be made to this database. -1 (the default) means no limit.'
6868

6969
property :is_template, [true, false],

resources/install.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424

2525
property :version, [String, Integer],
2626
default: '17',
27-
coerce: proc { |p| p.to_s },
27+
coerce: proc(&:to_s),
2828
description: 'Version to install'
2929

3030
property :source, [String, Symbol],
3131
default: :repo,
32-
coerce: proc { |p| p.to_sym },
32+
coerce: proc(&:to_sym),
3333
equal_to: %i(repo os),
3434
description: 'Installation source'
3535

@@ -191,7 +191,7 @@ def do_repository_action(repo_action)
191191

192192
package 'apt-transport-https'
193193

194-
apt_repository "postgresql_org_repository_#{new_resource.version.to_s}" do
194+
apt_repository "postgresql_org_repository_#{new_resource.version}" do
195195
uri new_resource.apt_repository_uri
196196
components ['main', new_resource.version.to_s]
197197
distribution "#{node['lsb']['codename']}-pgdg"

resources/role.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
property :connection_limit, [Integer, String],
5353
default: -1,
54-
coerce: proc { |p| p.to_s },
54+
coerce: proc(&:to_s),
5555
description: 'If role can log in, this specifies how many concurrent connections the role can make'
5656

5757
property :unencrypted_password, String,

test/cookbooks/test/recipes/all_repos_install.rb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@
1010
version '15'
1111

1212
server_config({
13-
'max_connections' => 110,
14-
'shared_buffers' => '128MB',
15-
'dynamic_shared_memory_type' => 'posix',
16-
'max_wal_size' => '1GB',
17-
'min_wal_size' => '80MB',
18-
'log_destination' => 'stderr',
19-
'logging_collector' => true,
20-
'log_directory' => 'log',
21-
'log_filename' => 'postgresql-%a.log',
22-
'log_rotation_age' => '1d',
23-
'log_rotation_size' => 0,
24-
'log_truncate_on_rotation' => true,
25-
'log_line_prefix' => '%m [%p]',
26-
'log_timezone' => 'Etc/UTC',
27-
'datestyle' => 'iso, mdy',
28-
'timezone' => 'Etc/UTC',
29-
'lc_messages' => 'C',
30-
'lc_monetary' => 'C',
31-
'lc_numeric' => 'C',
32-
'lc_time' => 'C',
33-
'default_text_search_config' => 'pg_catalog.english',
34-
})
13+
'max_connections' => 110,
14+
'shared_buffers' => '128MB',
15+
'dynamic_shared_memory_type' => 'posix',
16+
'max_wal_size' => '1GB',
17+
'min_wal_size' => '80MB',
18+
'log_destination' => 'stderr',
19+
'logging_collector' => true,
20+
'log_directory' => 'log',
21+
'log_filename' => 'postgresql-%a.log',
22+
'log_rotation_age' => '1d',
23+
'log_rotation_size' => 0,
24+
'log_truncate_on_rotation' => true,
25+
'log_line_prefix' => '%m [%p]',
26+
'log_timezone' => 'Etc/UTC',
27+
'datestyle' => 'iso, mdy',
28+
'timezone' => 'Etc/UTC',
29+
'lc_messages' => 'C',
30+
'lc_monetary' => 'C',
31+
'lc_numeric' => 'C',
32+
'lc_time' => 'C',
33+
'default_text_search_config' => 'pg_catalog.english',
34+
})
3535

3636
notifies :restart, 'postgresql_service[postgresql]', :delayed
3737
action :create

test/cookbooks/test/recipes/no_repos_install.rb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@
2020
version '15'
2121

2222
server_config({
23-
'max_connections' => 110,
24-
'shared_buffers' => '128MB',
25-
'dynamic_shared_memory_type' => 'posix',
26-
'max_wal_size' => '1GB',
27-
'min_wal_size' => '80MB',
28-
'log_destination' => 'stderr',
29-
'logging_collector' => true,
30-
'log_directory' => 'log',
31-
'log_filename' => 'postgresql-%a.log',
32-
'log_rotation_age' => '1d',
33-
'log_rotation_size' => 0,
34-
'log_truncate_on_rotation' => true,
35-
'log_line_prefix' => '%m [%p]',
36-
'log_timezone' => 'Etc/UTC',
37-
'datestyle' => 'iso, mdy',
38-
'timezone' => 'Etc/UTC',
39-
'lc_messages' => 'C',
40-
'lc_monetary' => 'C',
41-
'lc_numeric' => 'C',
42-
'lc_time' => 'C',
43-
'default_text_search_config' => 'pg_catalog.english',
44-
})
23+
'max_connections' => 110,
24+
'shared_buffers' => '128MB',
25+
'dynamic_shared_memory_type' => 'posix',
26+
'max_wal_size' => '1GB',
27+
'min_wal_size' => '80MB',
28+
'log_destination' => 'stderr',
29+
'logging_collector' => true,
30+
'log_directory' => 'log',
31+
'log_filename' => 'postgresql-%a.log',
32+
'log_rotation_age' => '1d',
33+
'log_rotation_size' => 0,
34+
'log_truncate_on_rotation' => true,
35+
'log_line_prefix' => '%m [%p]',
36+
'log_timezone' => 'Etc/UTC',
37+
'datestyle' => 'iso, mdy',
38+
'timezone' => 'Etc/UTC',
39+
'lc_messages' => 'C',
40+
'lc_monetary' => 'C',
41+
'lc_numeric' => 'C',
42+
'lc_time' => 'C',
43+
'default_text_search_config' => 'pg_catalog.english',
44+
})
4545

4646
notifies :restart, 'postgresql_service[postgresql]', :delayed
4747
action :create

0 commit comments

Comments
 (0)