ruby-changes:31587
From: zzak <ko1@a...>
Date: Wed, 13 Nov 2013 18:06:23 +0900 (JST)
Subject: [ruby-changes:31587] zzak:r43666 (trunk): * ext/openssl/ossl_asn1.c: [DOC] Document parts of
zzak 2013-11-13 18:06:17 +0900 (Wed, 13 Nov 2013) New Revision: 43666 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43666 Log: * ext/openssl/ossl_asn1.c: [DOC] Document parts of OpenSSL::ASN1::ObjectId included a fix for the class overview, which previously showed the documentation for Constructive due to missing ObjectId overview. This patch also includes a note for Primative. Based on a patch by @vbatts via GH-436 https://github.com/ruby/ruby/pull/436 Modified files: trunk/ChangeLog trunk/ext/openssl/ossl_asn1.c Index: ChangeLog =================================================================== --- ChangeLog (revision 43665) +++ ChangeLog (revision 43666) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Nov 13 18:03:00 2013 Zachary Scott <e@z...> + + * ext/openssl/ossl_asn1.c: [DOC] Document parts of + OpenSSL::ASN1::ObjectId included a fix for the class overview, which + previously showed the documentation for Constructive due to missing + ObjectId overview. This patch also includes a note for Primative. + + Based on a patch by @vbatts via GH-436 + https://github.com/ruby/ruby/pull/436 + Wed Nov 13 17:19:36 2013 Zachary Scott <e@z...> * ext/openssl/lib/openssl/config.rb: In #parse use +string+ for +str+ Index: ext/openssl/ossl_asn1.c =================================================================== --- ext/openssl/ossl_asn1.c (revision 43665) +++ ext/openssl/ossl_asn1.c (revision 43666) @@ -1358,6 +1358,17 @@ ossl_asn1cons_each(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1358 return self; } +/* + * call-seq: + * ObjectId.register(object_id, short_name, long_name) + * + * This adds a new ObjectId to the internal tables. Where +object_id+ is the + * numerical form, +short_name+ is the short name, and +long_name+ is the long + * name. + * + * Returns +true+ if successful. Raises an ASN1Error otherwise. + * + */ static VALUE ossl_asn1obj_s_register(VALUE self, VALUE oid, VALUE sn, VALUE ln) { @@ -1371,6 +1382,14 @@ ossl_asn1obj_s_register(VALUE self, VALU https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1382 return Qtrue; } +/* Document-method: OpenSSL::ASN1::ObjectId#sn + * + * The short name of the ObjectId, as defined in +openssl/objects.h+. + */ +/* Document-method: OpenSSL::ASN1::ObjectId#short_name + * + * #short_name is an alias to #sn + */ static VALUE ossl_asn1obj_get_sn(VALUE self) { @@ -1384,6 +1403,14 @@ ossl_asn1obj_get_sn(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1403 return ret; } +/* Document-method: OpenSSL::ASN1::ObjectId#ln + * + * The long name of the ObjectId, as defined in +openssl/objects.h+. + */ +/* Document-method: OpenSSL::ASN1::ObjectId.long_name + * + * #long_name is an alias to #ln + */ static VALUE ossl_asn1obj_get_ln(VALUE self) { @@ -1397,6 +1424,10 @@ ossl_asn1obj_get_ln(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1424 return ret; } +/* Document-method: OpenSSL::ASN1::ObjectId#oid + * + * The object identifier as a String. + */ static VALUE ossl_asn1obj_get_oid(VALUE self) { @@ -1778,6 +1809,10 @@ Init_ossl_asn1() https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1809 * * == OpenSSL::ASN1::ObjectId * + * While OpenSSL::ASN1::ObjectId.new will allocate a new ObjectId, it is + * not typically allocated this way, but rather that are recieved from + * parsed ASN1 encodings. + * * === Additional attributes * * +sn+: the short name as defined in <openssl/objects.h>. * * +ln+: the long name as defined in <openssl/objects.h>. @@ -1917,6 +1952,10 @@ do{\ https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L1952 OSSL_ASN1_DEFINE_CLASS(EndOfContent, Data); + /* Document-class: OpenSSL::ASN1::ObjectId + * + * Represents the primative object id for OpenSSL::ASN1 + */ #if 0 cASN1ObjectId = rb_define_class_under(mASN1, "ObjectId", cASN1Primitive); /* let rdoc know */ #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/