Sha256: 941bde7ca8ebe223e099746a60c8006d96d30f67c4ca675918a33b656bebb157

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

# frozen_string_literal: true

# if windows os
require 'rbconfig'
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
if is_windows
  module Shellwords
    def shellescape(str)
      "\"#{str.gsub(/\\(?=\\*")/, '\\\\\\').gsub(/"/, '\\"').gsub(/\\$/, '\\\\\\').gsub('%', '%%')}\""
    end

    module_function :shellescape
    class << self
      alias escape shellescape
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina-1.2.5 lib/mina/windows_patches.rb