s = "Lorem IPSUM dolor Sit amet"puts s.gsub(/\b[[:upper:]]{2,}\b/){$&.capitalize}
Standard input is empty
Lorem Ipsum dolor Sit amet
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!