Skip to content

Instantly share code, notes, and snippets.

@ecavazos
Created July 24, 2010 05:32
Show Gist options
  • Save ecavazos/488436 to your computer and use it in GitHub Desktop.
Save ecavazos/488436 to your computer and use it in GitHub Desktop.
# Alias each_line to each so your ruby 1.8 code will still
# work in 1.9
unless ''.respond_to?(:each)
String.class_eval do
alias_method :each, :each_line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment