Skip to content

Commit

Permalink
Refactor #extract_param_name
Browse files Browse the repository at this point in the history
String#split without arg depends on "$;", however it's better to not
depend on "$;" for supporting multiple ruby version.

This is based on suggestion by nobu
518aefd#r124738493
  • Loading branch information
yui-knk committed Aug 21, 2023
1 parent 97427e4 commit 0060a86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lrama/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def user_args
end

def extract_param_name(param)
/\A(\W*)([a-zA-Z0-9_]+)\z/.match(param.split.last)[2]
param[/\b([a-zA-Z0-9_]+)(?=\s*\z)/]
end

def parse_param_name
Expand Down

0 comments on commit 0060a86

Please sign in to comment.