dtas.git  about / heads / tags
duct tape audio suite for *nix
blob d4586a3e302c21f0ee8132351003d1bb481d8bf8 592 bytes (raw)
$ git show v0.18.0:lib/dtas/xs.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 
# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
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(Array(ary).map(&:b))
  end
end

git clone git://80x24.org/dtas.git
git clone https://80x24.org/dtas.git