Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
String#shellescape
str.shellescape => string
lib/shellwords.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/shellwords.rb, line 226
def shellescape
Shellwords.escape(self)
end
Escapes str so that it can be safely used in a Bourne shell command line.
See Shellwords.shellescape for details.