Skip to content

Commit afee46b

Browse files
committed
rubocop fixes
1 parent dca9b14 commit afee46b

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.rubocop_todo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Metrics/BlockNesting:
4545
# Offense count: 1
4646
# Configuration parameters: CountComments, CountAsOne.
4747
Metrics/ClassLength:
48-
Max: 135
48+
Max: 141
4949

5050
# Offense count: 3
5151
# Configuration parameters: IgnoredMethods.

ext/mysql2/extconf.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def add_ssl_defines(header)
108108
warn "-----\nUsing --with-mysql-dir=#{File.dirname inc}\n-----"
109109
rpath_dir = lib
110110
have_library('mysqlclient')
111-
elsif (mc = (with_config('mysql-config') || Dir[GLOB].first))
111+
elsif (mc = with_config('mysql-config') || Dir[GLOB].first)
112112
# If the user has provided a --with-mysql-config argument, we must respect it or fail.
113113
# If the user gave --with-mysql-config with no argument means we should try to find it.
114114
mc = Dir[GLOB].first if mc == true

lib/mysql2/client.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def initialize(opts = {})
9898
end
9999

100100
def extract_password(opts)
101-
return (opts[:password] || opts[:pass]) if !opts[:password_provider]
101+
return opts[:password] || opts[:pass] unless opts[:password_provider]
102+
102103
klass = Kernel.const_get(opts[:password_provider])
103104

104105
obj = klass.new(opts)

spec/mysql2/statement_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def stmt_count
320320
result = @client.prepare("SELECT 1 UNION SELECT 2").execute(stream: true, cache_rows: false)
321321
expect do
322322
result.each {}
323-
result.each {} # rubocop:disable Style/CombinableLoops
323+
result.each {}
324324
end.to raise_exception(Mysql2::Error)
325325
end
326326
end

0 commit comments

Comments
 (0)