Sha256: 52c7b5cf7e216d3c25b1725016edae0a4878efe0622d8745f4547924bbb9d3fc

Contents?: true

Size: 448 Bytes

Versions: 4

Compression:

Stored size: 448 Bytes

Contents

require 'shellwords'
require 'rbconfig'

def shellescape(str)
    return str unless str
    if FFI::Platform::OS == 'windows'
        '"' + str.gsub('"', '""') + '"'
    else
        str.shellescape
    end
end

def shelljoin(args)
    if FFI::Platform::OS == 'windows'
        args.reduce { |cmd, arg| cmd + ' ' + shellescape(arg) }
    else
        args.shelljoin
    end
end

def shellsplit(str)
    return str unless str
    str.shellsplit
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ffi-compiler-1.3.2/lib/ffi-compiler/shell.rb
ffi-compiler-1.3.2 lib/ffi-compiler/shell.rb
ffi-compiler-1.3.1 lib/ffi-compiler/shell.rb
ffi-compiler2-2.3.0 lib/ffi-compiler/shell.rb