mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Use delete_prefix instead of sub(/\Afixed-pattern/, '')
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a94cbf81e1
commit
c01a5ee85e
6 changed files with 8 additions and 8 deletions
|
@ -47,7 +47,7 @@ def setup(options = "", *long_options)
|
|||
end
|
||||
long_options.each do |s|
|
||||
opt_name, arg_name = s.split(/(?=[\s=])/, 2)
|
||||
opt_name.sub!(/\A--/, '')
|
||||
opt_name.delete_prefix!('--')
|
||||
s = "--#{opt_name.gsub(/([A-Z]+|[a-z])([A-Z])/, '\1-\2').downcase}#{arg_name}"
|
||||
puts "#{opt_name}=>#{s}" if $DEBUG
|
||||
opt_name = opt_name.intern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue