From: "NARUSE, Yui" Date: 2010-02-24T01:28:24+09:00 Subject: [ruby-dev:40467] Re: [ruby-cvs:33954] Ruby:r26739 (trunk): * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the 成瀬です。 (2010/02/24 0:51), knu@ruby-lang.org wrote: > knu 2010-02-24 00:51:01 +0900 (Wed, 24 Feb 2010) > > New Revision: 26739 > > http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26739 > > Log: > * ext/openssl/ossl_digest.c (GetDigestPtr): Allow to pass the > OpenSSL::Digest class in place of where either an instance of > the class or the algorithm name was demanded. For example, > OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1, key, data) is now > accepted as well as the usual > OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new, key, data) and > OpenSSL::HMAC.digest("SHA1", key, data). > > Modified files: > trunk/ChangeLog > trunk/ext/openssl/ossl_digest.c 議論なしのAPI変更に加えて、ext/openssl への変更なのであまり感心しないんですが、 とりあえず、 irb(main):002:0> OpenSSL::HMAC.digest(1,"foo","bar") TypeError: wrong argument (Fixnum)! (Expected kind of OpenSSL::Digest) だったエラーが、 TypeError: can't convert Fixnum into String というエラーに変わっているのは意図していますか。 また、API変更をよしとするならば、テストも追加するべきじゃありませんか。 -- NARUSE, Yui