Sha256: 64da54b0a7d9b31e1f4870fe511c91802ad5478f41b9dcf2bf6c38b8278e5775

Contents?: true

Size: 580 Bytes

Versions: 5

Compression:

Stored size: 580 Bytes

Contents

# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require_relative '../dtas'
require 'shellwords'

# We always escape binary strings because paths on POSIX filesystems are
# encoding agnostic.  Shellwords.split does give UTF-8 strings, but nothing
# cares at that point if the encoding isn't valid (and it's right to not care,
# again, filesystems can use any byte value in names except '\0'.
module DTAS::XS # :nodoc:
  def xs(ary)
    Shellwords.join(ary.map { |s| s.b })
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dtas-0.7.0 lib/dtas/xs.rb
dtas-0.6.0 lib/dtas/xs.rb
dtas-0.5.0 lib/dtas/xs.rb
dtas-0.4.0 lib/dtas/xs.rb
dtas-0.3.0 lib/dtas/xs.rb