Here's a top-level overview of some of the changes to date in the standard library that comes with Ruby 1.9. (These are the libraries that you get preinstalled with Ruby, but that you have to require into your code.)
- The
base64library has been removed. UseArray#packandString#unpackinstead. - Much of the
ComplexandRationallibraries are now built in to the interpreter. However, requiring the external libraries adds additional functionally. In the case ofRational, this functionality is minimal. - The
CMathlibrary has been added. - The
Enumeratorlibrary is now built in. - Added
Fiberlibrary (adds coroutine support to fibers). - Removed
ftools(replaced byfileutils). - The
Generatorlibrary has been removed (use Fibers). - Added notes on using
irbfrom inside applications. jcodeis removed in favor of built-in encoding support.- The
jsonlibrary is added. - The
matrixlibrary no longer requires that you includemathn. - The
mutexlibrary is now built in. parsedatehas been removed. TheDateclass handles most of its functionality.readbyteshas been removed.IOnow supports the method directly.require_relativeadded.- Add description of
Ripper. - Add description of
SecureRandom. - I've omitted the
shelllibrary, as it seems more like a curiosity than something folks would use (and it's broken under 1.9). - The
soaplibrary is removed. - I've omitted the
synclibrary. It is broken under 1.9, and themonitorlibrary seems to be cleaner. Win32APIis now deprecated in favor of using theDLlibrary.
It's interesting to me just how much is still changing in Ruby 1.9. But, as I use it more and more, it's also gratifying to see how some of the new idioms make coding just that little sweeter.
I just pushed a new beta of the PickAxe Third Edition with all the library changes.





Comments