CamelCase in Ruby

Example for versions Ruby 1.9
  1. Read the string from standard input (gets.chomp)
  2. Split the string into parts, separated with matches of regular expression, which describes a sequence of one or more non-letter characters
  3. Apply to each part function capitalise
  4. Concatenate the resulting strings (join) and print the result (puts)
puts gets.chomp.split( /[^a-zA-Z]+/ ).map {|w| w.capitalize}.join