Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix no method and arg error handling on rbx

  • Loading branch information...
commit 999ba6a584b83a73636c3936e99567a16be8033f 1 parent 6de8a75
@cldwalker authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/boson/bare_runner.rb
View
9 lib/boson/bare_runner.rb
@@ -44,7 +44,8 @@ def execute_command(cmd, args)
raise if !allowed_argument_error?($!, cmd, args)
abort_with "'#{cmd}' was called incorrectly.\nUsage: " + Command.usage(cmd)
rescue NoMethodError => err
- raise if !err.backtrace.first.include?('`full_invoke')
+ index = RUBY_ENGINE == 'rbx' ? 1 : 0
+ raise if !err.backtrace[index].include?('`full_invoke')
no_command_error cmd
end
@@ -55,8 +56,10 @@ def no_command_error(cmd)
# Determines if a user command argument error or an internal Boson one
def allowed_argument_error?(err, cmd, args)
- (err.message[/wrong number of arguments/] &&
- (cmd_obj = Command.find(cmd)) && cmd_obj.arg_size != args.size)
+ msg = RUBY_ENGINE == 'rbx' && err.class == ArgumentError ?
+ /given \d+, expected \d+/ : /wrong number of arguments/
+ (err.message[msg] && (cmd_obj = Command.find(cmd)) &&
+ cmd_obj.arg_size != args.size)
end
def option_parser
Please sign in to comment.
Something went wrong with that request. Please try again.