Skip to content

Commit

Permalink
Revert "Layout/IndentHeredoc"
Browse files Browse the repository at this point in the history
This reverts commit 72f50f3.
  • Loading branch information
sodabrew committed Mar 20, 2018
1 parent 7f9569e commit 620a055
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ Layout/CaseIndentation:
Layout/IndentHash:
EnforcedStyle: consistent

Layout/IndentHeredoc:
EnforcedStyle: powerpack

Lint/EndAlignment:
EnforcedStyleAlignWith: variable

Expand Down
9 changes: 9 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
Layout/IndentHeredoc:
Exclude:
- 'support/ruby_enc_to_mysql.rb'
- 'tasks/compile.rake'

# Offense count: 2
Metrics/AbcSize:
Max: 90
Expand Down
16 changes: 8 additions & 8 deletions support/ruby_enc_to_mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
"eucjpms" => "eucJP-ms",
}

puts <<-HEADER.strip_indent
%readonly-tables
%enum
%define lookup-function-name mysql2_mysql_enc_name_to_rb
%define hash-function-name mysql2_mysql_enc_name_to_rb_hash
%struct-type
struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; }
%%
puts <<-HEADER
%readonly-tables
%enum
%define lookup-function-name mysql2_mysql_enc_name_to_rb
%define hash-function-name mysql2_mysql_enc_name_to_rb_hash
%struct-type
struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; }
%%
HEADER

mysql_to_rb.each do |mysql, ruby|
Expand Down
24 changes: 12 additions & 12 deletions tasks/compile.rake
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ Rake::ExtensionTask.new("mysql2", Mysql2::GEMSPEC) do |ext|
spec.files << 'lib/mysql2/mysql2.rb'
spec.files << 'vendor/libmysql.dll'
spec.files << 'vendor/README'
spec.post_install_message = <<-POST_INSTALL_MESSAGE.strip_indent
spec.post_install_message = <<-POST_INSTALL_MESSAGE
======================================================================================================
======================================================================================================
You've installed the binary version of #{spec.name}.
It was built using MySQL Connector/C version #{CONNECTOR_VERSION}.
It's recommended to use the exact same version to avoid potential issues.
You've installed the binary version of #{spec.name}.
It was built using MySQL Connector/C version #{CONNECTOR_VERSION}.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files were retrieved from:
#{vendor_mysql_url(spec.platform)}
At the time of building this gem, the necessary DLL files were retrieved from:
#{vendor_mysql_url(spec.platform)}
This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.
This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.
======================================================================================================
======================================================================================================
POST_INSTALL_MESSAGE
end
Expand All @@ -64,9 +64,9 @@ end
file 'lib/mysql2/mysql2.rb' do |t|
name = Mysql2::GEMSPEC.name
File.open(t.name, 'wb') do |f|
f.write <<-END_OF_RUBY.strip_indent
RUBY_VERSION =~ /(\\d+.\\d+)/
require "#{name}/\#{$1}/#{name}"
f.write <<-END_OF_RUBY
RUBY_VERSION =~ /(\\d+.\\d+)/
require "#{name}/\#{$1}/#{name}"
END_OF_RUBY
end
end
Expand Down

0 comments on commit 620a055

Please sign in to comment.