Sha256: 80a9d84e9da10d69df26698dbe6656da51162f8df15df60119899907f46e7c70

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

module Vagrant
  module Util
    module ShellQuote
      # This will auto-escape the text with the given quote mark type.
      #
      # @param [String] text Text to escape
      # @param [String] quote The quote character, such as "
      def self.escape(text, quote)
        text.gsub(/#{quote}/) do |m|
          "#{m}\\#{m}#{m}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/lib/vagrant/util/shell_quote.rb