Percent w and other ruby percent syntax

If you can’t find what you want to know about ruby percent notations ( %w, %q, %r, %x), then have a look over there:

http://old.blog.jimhoskins.com/?p=8

Jim has obviously some other information sources than Google (where trying to search for %w is like trying to find your way in a dense steam room!)

The way to remember things is easy though:

  • %w is for White-spaced delimited arrays
  • %q works like Quotes
  • %r wraps up nicely Regular expressions
  • %x simply eXecutes system calls

comments

  • IvanDM Thu, 10 Mar 2011 - 22:47

    Let me say 2 things here: 1) Thanks for helping us with the Chef recipe: your Ruby-ness was very helpful 2) This syntax is awful

Comments are disabled temporarily until I find a suitable system, but you can still send a comment by email and I'll add it to this post. Thanks!