Skip to content

Commit 56a0bcb

Browse files
committed
Handle ArgumentError correctly on Rubinius
1 parent 577fcc4 commit 56a0bcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/thor/command.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ def local_method?(instance, name)
8888
end
8989

9090
def sans_backtrace(backtrace, caller) #:nodoc:
91-
saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) }
91+
saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) || (frame =~ /^kernel\// && RUBY_ENGINE =~ /rbx/) }
9292
saned - caller
9393
end
9494

9595
def handle_argument_error?(instance, error, caller)
96-
not_debugging?(instance) && error.message =~ /wrong number of arguments/ && begin
96+
not_debugging?(instance) && (error.message =~ /wrong number of arguments/ || error.message =~ /given \d*, expected \d*/) && begin
9797
saned = sans_backtrace(error.backtrace, caller)
9898
# Ruby 1.9 always include the called method in the backtrace
9999
saned.empty? || (saned.size == 1 && RUBY_VERSION >= '1.9')

0 commit comments

Comments
 (0)