Ruby arrays: %w vs %W
%w quotes like single quotes ''
(no variable interpolation, fewer escape sequences), while %W quotes like double quotes ""
.
irb(main):001:0> foo="hello"
=> "hello"
irb(main):002:0> %W(foo bar baz #{foo})
=> ["foo", "bar", "baz", "hello"]
irb(main):003:0> %w(foo bar baz #{foo})
=> ["foo", "bar", "baz", "\#{foo}"]
An application I've found for %W vs %w:
greetings = %W(hi hello #{"how do you do"})
# => ["hi", "hello", "how do you do"]