diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-05-15 13:47:03 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-05-20 13:36:49 +0900 |
commit | 42396f022844525c093e056db1580a90f8836a23 (patch) | |
tree | bf94797ccb4e29ae3d5de69e815227270f65765e /ext/openssl | |
parent | e5058d33f2b5e23dcb3b5285005878985657b028 (diff) | |
download | ruby-42396f022844525c093e056db1580a90f8836a23.tar.gz |
openssl: add OpenSSL::BN#inspect and OpenSSL::X509::Name#inspect
* ext/openssl/lib/openssl/bn.rb (inspect): added. BN#inspect should be
implemented. Kernel#inspect used to call #to_s if #to_s is redefined
but no longer in >= Ruby 2.0.0. [ruby-dev:48217] [Bug #9833]
* ext/openssl/lib/openssl/x509.rb (X509::Name#inspect): ditto.
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/lib/openssl/bn.rb | 4 | ||||
-rw-r--r-- | ext/openssl/lib/openssl/x509.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/openssl/lib/openssl/bn.rb b/ext/openssl/lib/openssl/bn.rb index 6d6c96e42d..e3a6bd2b60 100644 --- a/ext/openssl/lib/openssl/bn.rb +++ b/ext/openssl/lib/openssl/bn.rb @@ -23,6 +23,10 @@ module OpenSSL q.text to_i.to_s } end + + def inspect + "#<#{self.class} #{to_s}>" + end end # BN end # OpenSSL diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb index aef3456e0f..3caaacff12 100644 --- a/ext/openssl/lib/openssl/x509.rb +++ b/ext/openssl/lib/openssl/x509.rb @@ -152,6 +152,10 @@ module OpenSSL q.text to_s(OpenSSL::X509::Name::RFC2253) } end + + def inspect + "#<#{self.class} #{to_s(RFC2253)}>" + end end class StoreContext |