Skip to content

Instantly share code, notes, and snippets.

@nathany
Last active December 20, 2015 00:59
Show Gist options
  • Save nathany/6046171 to your computer and use it in GitHub Desktop.
Save nathany/6046171 to your computer and use it in GitHub Desktop.
Ruby 2.0 backwards incompatible changes

Ruby 2.0 backwards incompatible changes

From Peter Cooper's Walkthrough:

  • lines, bytes, chars, codepoints returned an Enumerator in 1.9 -> use each_lines, each_bytes, each_chars, each_codepoints instead for an Enumerator
  • # encoding: utf-8 is the default (which impacts regular expressions that expect it to be us-ascii, eg. vpim)
  • respond_to? on a protected method returns false (was true)
  • inspect doesn't use the redefined to_s
  • Array#values_at returns nil for each number outside of the array
  • CSV.dump & CSV.load are gone (object serialization)
  • iconv encoding library is gone
  • tempfile.mkdir and rmdir are gone
  • YAML syck support is gone (uses Psych)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment