Skip to content

Commit

Permalink
Support for Ruby 1.9.3 hash arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Nov 28, 2017
1 parent 6709b2b commit 8627a1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/mysql2/statement.rb
Expand Up @@ -5,14 +5,16 @@ class Statement
include Enumerable

if Thread.respond_to?(:handle_interrupt)
def execute(*args, **kwargs)
def execute(*args)
Thread.handle_interrupt(::Mysql2::Util::TIMEOUT_ERROR_CLASS => :never) do
_execute(*args, **kwargs)
options = args.last.is_a?(Hash) ? args.pop : {}
_execute(*args, options)
end
end
else
def execute(*args, **kwargs)
_execute(*args, **kwargs)
def execute(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
_execute(*args, options)
end
end
end
Expand Down

0 comments on commit 8627a1e

Please sign in to comment.