[前][次][番号順一覧][スレッド一覧]

ruby-changes:21018

From: drbrain <ko1@a...>
Date: Thu, 25 Aug 2011 09:52:20 +0900 (JST)
Subject: [ruby-changes:21018] drbrain:r33067 (ruby_1_9_3): * backport r33066 from trunk.

drbrain	2011-08-25 09:52:10 +0900 (Thu, 25 Aug 2011)

  New Revision: 33067

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33067

  Log:
    * backport r33066 from trunk.
    
    * ext/openssl/lib/openssl/bn.rb:  Hide copyright info from RDoc.
    * ext/openssl/lib/openssl/digest.rb:  ditto
    * ext/openssl/lib/openssl/cipher.rb:  ditto
    
    * backport r33065 from trunk.
    
    * ext/openssl/ossl_digest.c:  Document OpenSSL::Digest::digest and add
      an example to OpenSSL::Digest.  Patch by Sylvain Daubert.
      [Ruby 1.9 - Bug #5166]
    * ext/openssl/lib/openssl/digest.rb (module OpenSSL):  ditto

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/openssl/lib/openssl/bn.rb
    branches/ruby_1_9_3/ext/openssl/lib/openssl/cipher.rb
    branches/ruby_1_9_3/ext/openssl/lib/openssl/digest.rb
    branches/ruby_1_9_3/ext/openssl/ossl_digest.c

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 33066)
+++ ruby_1_9_3/ChangeLog	(revision 33067)
@@ -1,3 +1,20 @@
+Thu Aug 25 09:43:16 2011  Eric Hodel  <drbrain@s...>
+
+	* backport r33066 from trunk.
+
+	* ext/openssl/lib/openssl/bn.rb:  Hide copyright info from RDoc.
+	* ext/openssl/lib/openssl/digest.rb:  ditto
+	* ext/openssl/lib/openssl/cipher.rb:  ditto
+
+Thu Aug 25 09:25:48 2011  Eric Hodel  <drbrain@s...>
+
+	* backport r33065 from trunk.
+
+	* ext/openssl/ossl_digest.c:  Document OpenSSL::Digest::digest and add
+	  an example to OpenSSL::Digest.  Patch by Sylvain Daubert.
+	  [Ruby 1.9 - Bug #5166]
+	* ext/openssl/lib/openssl/digest.rb (module OpenSSL):  ditto
+
 Thu Aug 25 08:19:43 2011  Koichi Sasada  <ko1@a...>
 
 	* vm.c (vm_make_env_each): work around to solve Bug #2729.
Index: ruby_1_9_3/ext/openssl/ossl_digest.c
===================================================================
--- ruby_1_9_3/ext/openssl/ossl_digest.c	(revision 33066)
+++ ruby_1_9_3/ext/openssl/ossl_digest.c	(revision 33067)
@@ -403,6 +403,17 @@
      *   sha256 << data2
      *   sha256 << data3
      *   digest = sha256.digest
+     *
+     * === Reuse a Digest instance
+     *
+     *   data1 = File.read('file1')
+     *   sha256 = OpenSSL::Digest::SHA256.new
+     *   digest1 = sha256.digest(data1)
+     *   
+     *   data2 = File.read('file2')
+     *   sha256.reset
+     *   digest2 = sha256.digest(data2)
+     *
      */
     cDigest = rb_define_class_under(mOSSL, "Digest", rb_path2class("Digest::Class"));
     /* Document-class: OpenSSL::Digest::DigestError
Index: ruby_1_9_3/ext/openssl/lib/openssl/bn.rb
===================================================================
--- ruby_1_9_3/ext/openssl/lib/openssl/bn.rb	(revision 33066)
+++ ruby_1_9_3/ext/openssl/lib/openssl/bn.rb	(revision 33067)
@@ -1,19 +1,23 @@
-=begin
-= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for BN
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space definitions that completes C-space funcs for BN
+# 
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002  Michal Rokos <m.rokos@s...>
+# All rights reserved.
+# 
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+# 
+# = Version
+# $Id$
+#
+#++
 
-= Info
-  'OpenSSL for Ruby 2' project
-  Copyright (C) 2002  Michal Rokos <m.rokos@s...>
-  All rights reserved.
-
-= Licence
-  This program is licenced under the same licence as Ruby.
-  (See the file 'LICENCE'.)
-
-= Version
-  $Id$
-=end
-
 module OpenSSL
   class BN
     include Comparable
Index: ruby_1_9_3/ext/openssl/lib/openssl/digest.rb
===================================================================
--- ruby_1_9_3/ext/openssl/lib/openssl/digest.rb	(revision 33066)
+++ ruby_1_9_3/ext/openssl/lib/openssl/digest.rb	(revision 33067)
@@ -1,19 +1,23 @@
-=begin
-= $RCSfile$ -- Ruby-space predefined Digest subclasses
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space predefined Digest subclasses
+# 
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002  Michal Rokos <m.rokos@s...>
+# All rights reserved.
+# 
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+# 
+# = Version
+# $Id$
+#
+#++
 
-= Info
-  'OpenSSL for Ruby 2' project
-  Copyright (C) 2002  Michal Rokos <m.rokos@s...>
-  All rights reserved.
-
-= Licence
-  This program is licenced under the same licence as Ruby.
-  (See the file 'LICENCE'.)
-
-= Version
-  $Id$
-=end
-
 module OpenSSL
   class Digest
 
@@ -22,6 +26,17 @@
       alg += %w(SHA224 SHA256 SHA384 SHA512)
     end
 
+    # Return the +data+ hash computed with +name+ Digest. +name+ is either the
+    # long name or short name of a supported digest algorithm.
+    #
+    # === Examples
+    #
+    #   OpenSSL::Digest.digest("SHA256, "abc")
+    #
+    # which is equivalent to:
+    #
+    #   OpenSSL::Digest::SHA256.digest("abc")
+
     def self.digest(name, data)
         super(data, name)
     end
Index: ruby_1_9_3/ext/openssl/lib/openssl/cipher.rb
===================================================================
--- ruby_1_9_3/ext/openssl/lib/openssl/cipher.rb	(revision 33066)
+++ ruby_1_9_3/ext/openssl/lib/openssl/cipher.rb	(revision 33067)
@@ -1,19 +1,23 @@
-=begin
-= $RCSfile$ -- Ruby-space predefined Cipher subclasses
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space predefined Cipher subclasses
+# 
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002  Michal Rokos <m.rokos@s...>
+# All rights reserved.
+# 
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+# 
+# = Version
+# $Id$
+#
+#++
 
-= Info
-  'OpenSSL for Ruby 2' project
-  Copyright (C) 2002  Michal Rokos <m.rokos@s...>
-  All rights reserved.
-
-= Licence
-  This program is licenced under the same licence as Ruby.
-  (See the file 'LICENCE'.)
-
-= Version
-  $Id$
-=end
-
 module OpenSSL
   class Cipher
     %w(AES CAST5 BF DES IDEA RC2 RC4 RC5).each{|name|

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]