From b1b8e7f08342c8864501338b92cc6d1dce9173b2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 13 Apr 2015 00:54:23 +0000 Subject: xs: allow taking a string as input This allows us to avoid unnecessary Array conversions in call sites --- lib/dtas/xs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dtas/xs.rb b/lib/dtas/xs.rb index 04ac252..7b3a0c2 100644 --- a/lib/dtas/xs.rb +++ b/lib/dtas/xs.rb @@ -9,6 +9,6 @@ require 'shellwords' # again, filesystems can use any byte value in names except '\0'. module DTAS::XS # :nodoc: def xs(ary) - Shellwords.join(ary.map(&:b)) + Shellwords.join(Array(ary).map(&:b)) end end -- cgit v1.2.3-24-ge0c7