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.
Peña, Botp (Guest)
on 2006-04-24 05:05
(Received via mailing list)
David C. [mailto:removed_email_address@domain.invalid] :

# 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
Ross B. (Guest)
on 2006-04-24 05:21
(Received via mailing list)
On Mon, 2006-04-24 at 10:03 +0900, Peña wrote:
> David C. [mailto:removed_email_address@domain.invalid] :
>
> # 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.