Skip to content

Commit 72f50f3

Browse files
committed
Layout/IndentHeredoc
1 parent 54c20a6 commit 72f50f3

File tree

4 files changed

+23
-29
lines changed

4 files changed

+23
-29
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Layout/CaseIndentation:
1515
Layout/IndentHash:
1616
EnforcedStyle: consistent
1717

18+
Layout/IndentHeredoc:
19+
EnforcedStyle: powerpack
20+
1821
Lint/EndAlignment:
1922
EnforcedStyleAlignWith: variable
2023

.rubocop_todo.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ Layout/EmptyLineAfterMagicComment:
2626
- 'spec/mysql2/result_spec.rb'
2727
- 'spec/mysql2/statement_spec.rb'
2828

29-
# Offense count: 3
30-
# Cop supports --auto-correct.
31-
# Configuration parameters: EnforcedStyle, SupportedStyles.
32-
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
33-
Layout/IndentHeredoc:
34-
Exclude:
35-
- 'support/ruby_enc_to_mysql.rb'
36-
- 'tasks/compile.rake'
37-
3829
# Offense count: 2
3930
# Cop supports --auto-correct.
4031
Layout/SpaceInsidePercentLiteralDelimiters:

support/ruby_enc_to_mysql.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
"eucjpms" => "eucJP-ms",
4141
}
4242

43-
puts <<-header
44-
%readonly-tables
45-
%enum
46-
%define lookup-function-name mysql2_mysql_enc_name_to_rb
47-
%define hash-function-name mysql2_mysql_enc_name_to_rb_hash
48-
%struct-type
49-
struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; }
50-
%%
43+
puts <<-header.strip_indent
44+
%readonly-tables
45+
%enum
46+
%define lookup-function-name mysql2_mysql_enc_name_to_rb
47+
%define hash-function-name mysql2_mysql_enc_name_to_rb_hash
48+
%struct-type
49+
struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; }
50+
%%
5151
header
5252

5353
mysql_to_rb.each do |mysql, ruby|

tasks/compile.rake

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ Rake::ExtensionTask.new("mysql2", Mysql2::GEMSPEC) do |ext|
3333
spec.files << 'lib/mysql2/mysql2.rb'
3434
spec.files << 'vendor/libmysql.dll'
3535
spec.files << 'vendor/README'
36-
spec.post_install_message = <<-POST_INSTALL_MESSAGE
36+
spec.post_install_message = <<-POST_INSTALL_MESSAGE.strip_indent
3737
38-
======================================================================================================
38+
======================================================================================================
3939
40-
You've installed the binary version of #{spec.name}.
41-
It was built using MySQL Connector/C version #{CONNECTOR_VERSION}.
42-
It's recommended to use the exact same version to avoid potential issues.
40+
You've installed the binary version of #{spec.name}.
41+
It was built using MySQL Connector/C version #{CONNECTOR_VERSION}.
42+
It's recommended to use the exact same version to avoid potential issues.
4343
44-
At the time of building this gem, the necessary DLL files were retrieved from:
45-
#{vendor_mysql_url(spec.platform)}
44+
At the time of building this gem, the necessary DLL files were retrieved from:
45+
#{vendor_mysql_url(spec.platform)}
4646
47-
This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.
47+
This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.
4848
49-
======================================================================================================
49+
======================================================================================================
5050
5151
POST_INSTALL_MESSAGE
5252
end
@@ -64,9 +64,9 @@ end
6464
file 'lib/mysql2/mysql2.rb' do |t|
6565
name = Mysql2::GEMSPEC.name
6666
File.open(t.name, 'wb') do |f|
67-
f.write <<-END_OF_RUBY
68-
RUBY_VERSION =~ /(\\d+.\\d+)/
69-
require "#{name}/\#{$1}/#{name}"
67+
f.write <<-END_OF_RUBY.strip_indent
68+
RUBY_VERSION =~ /(\\d+.\\d+)/
69+
require "#{name}/\#{$1}/#{name}"
7070
END_OF_RUBY
7171
end
7272
end

0 commit comments

Comments
 (0)