Module: Vagrant::Util::ShellQuote
- Defined in:
- lib/vagrant/util/shell_quote.rb
Class Method Summary collapse
-
.escape(text, quote) ⇒ Object
This will auto-escape the text with the given quote mark type.
Class Method Details
.escape(text, quote) ⇒ Object
This will auto-escape the text with the given quote mark type.
11 12 13 14 15 |
# File 'lib/vagrant/util/shell_quote.rb', line 11 def self.escape(text, quote) text.gsub(/#{quote}/) do |m| "#{m}\\#{m}#{m}" end end |