Forum: Ruby Re: nuby: %w to understand quotes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6087a044557d6b59ab52e7dd20f94da8?d=identicon&s=25 Peña, Botp (Guest)
on 2006-04-24 03:05
(Received via mailing list)
David Corbin [mailto:dcorbin@machturtle.com] :

# But why?  %w is intended as a shortcut when everthing is a
# single word.  For
# anything else, use quotes.

yes, you're right. maybe, i was looking for a shortcut on word or
"phrases of words" :)

kind regards -botp
A9b6a93b860020caf9d2d1d58c32478f?d=identicon&s=25 Ross Bamford (Guest)
on 2006-04-24 03:21
(Received via mailing list)
On Mon, 2006-04-24 at 10:03 +0900, Peña wrote:
> David Corbin [mailto:dcorbin@machturtle.com] :
>
> # But why?  %w is intended as a shortcut when everthing is a
> # single word.  For
> # anything else, use quotes.
>
> yes, you're right. maybe, i was looking for a shortcut on word or "phrases of words" :)

Perhaps you are looking for shellwords?

require 'shellwords'
Shellwords.shellwords %{this is "just a" test}
# => ["this", "is", "just a", "test"]
This topic is locked and can not be replied to.