Read more

Cryptic Ruby Global Variables and Their Meanings

Arne Hartherz
July 17, 2013Software engineer at makandra GmbH

The linked page lists and explains global Ruby "dollar" variables, such as:

  • $: (load path)
  • $* (ARGV)
  • $? (Last exit status)
  • $$ (PID)
  • $~ (MatchData from last successful match)
  • ...and many more you'll need when reading weird code.

Regex

  • $~ (last MatchData)
  • $1 $2 $3 $4 (match groups from the last pattern match)
  • $& (last matched string)
  • $+ (last match group)
  • `$`` (the string before the last match)
  • $' (the string after the last match
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

See this extensive list of variables Show archive.org snapshot .

Posted by Arne Hartherz to makandra dev (2013-07-17 12:19)