ruby 1.9标准库的变动
还在开发版本的ruby 1.9对标准库进行了大量的修改,主要的修改包括:
1、base64库被删除,改用Array#pack和String#unpack来代替
2、增加了CMath库,提高数学运算速度
3、Enumerator已经内建
4、增加了Fiber库,引入了协程编程这种新的并发编程技术
5、jcode被删除,编码信息可以用注释来声明
6、增加了json库
7、SOAP库被删除
8、调用Windows改用了DL库
详细的ChangeLog如下:
引用
* The base64 library has been removed. Use Array#pack and String#unpack instead.
* Much of the Complex and Rational libraries are now built in to the interpreter. However, requiring the external libraries adds additional functionally. In the case of Rational, this functionality is minimal.
* The CMath library has been added.
* The Enumerator library is now built in.
* Added Fiber library (adds coroutine support to fibers).
* Removed ftools (replaced by fileutils).
* The Generator library has been removed (use Fibers).
* Added notes on using irb from inside applications.
* jcode is removed in favor of built-in encoding support.
* The json library is added.
* The matrix library no longer requires that you include mathn.
* The mutex library is now built in.
* parsedate has been removed. The Date class handles most of its functionality.
* readbytes has been removed. IO now supports the method directly.
* require_relative added.
* Add description of Ripper.
* Add description of SecureRandom.
* I've omitted the shell library, as it seems more like a curiosity than something folks would use (and it's broken under 1.9).
* The soap library is removed.
* I've omitted the sync library. It is broken under 1.9, and the monitor library seems to be cleaner.
* Win32API is now deprecated in favor of using the DL library.