%w<delim><string><delim> == string.split(/\s+/) (maybe not exactly that regexp, but basically it's an array of the words--hence the w)
%<delim><string><delim> == string, but without needing to escape the quotes. It's the same as using %Q (ie, it understands escape sequences and interpolated expressions inside, while %q is a literal string) HTH -foca On Tue, Feb 3, 2009 at 4:49 PM, James Byrne <li...@ruby-forum.com> wrote: > In the cucumber rake task I see this construct: > > t.rcov_opts = %w{--rails --exclude > lib\/ruby,lib64\/ruby,\/usr,osx\/objc,gems\/,test\/,spec\/,features\/} > t.rcov_opts << %[--output "coverage"] > > My questions is: What do %w and % represent with respect to the > "block"? in the first case and the "array"? in the second? I cannot > find an explanation of either usage in the documentation. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users