aboutsummaryrefslogtreecommitdiffstats
path: root/lib/un.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-04 08:22:10 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-04 08:22:10 +0000
commitc01a5ee85e2d6a7128cccafb143bfa694284ca87 (patch)
treef2022f55e2ea3047ffda6f3288e43c9d407fd7d3 /lib/un.rb
parenta94cbf81e1fcef1f50af631e3b1117c2bf68df7f (diff)
downloadruby-c01a5ee85e2d6a7128cccafb143bfa694284ca87.tar.gz
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
Diffstat (limited to 'lib/un.rb')
-rw-r--r--lib/un.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/un.rb b/lib/un.rb
index d109a3417b..14f5b10fec 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -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