aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-05-15 13:47:03 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-05-15 14:08:43 +0900
commit52fd432987da17fa5d2843cd856e0e85c38d2856 (patch)
tree8c5e66c8ae94148493b99353e000888dd88961de
parent9529e46adf33ce88bb7804f0dd1dda96cd4ab1bb (diff)
downloadruby-topic/openssl-inspect.tar.gz
ext/openssl: add OpenSSL::BN#inspect and OpenSSL::X509::Name#inspecttopic/openssl-inspect
In Ruby >= 2.0.0, Kernel#inspect no longer calls #to_s even if #inspect is missing. [ruby-dev:48217] [Bug #9833] * ext/openssl/lib/openssl/bn.rb (inspect): Added. * ext/openssl/lib/openssl/x509.rb (X509::Name#inspect): Added.
-rw-r--r--ChangeLog6
-rw-r--r--ext/openssl/lib/openssl/bn.rb4
-rw-r--r--ext/openssl/lib/openssl/x509.rb4
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d95160..18f6965 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun May 15 14:07:40 2016 Kazuki Yamaguchi <k@rhe.jp>
+
+ * ext/openssl/lib/openssl/bn.rb (inspect): Added.
+
+ * ext/openssl/lib/openssl/x509.rb (X509::Name#inspect): Added.
+
Sun May 15 10:57:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even
diff --git a/ext/openssl/lib/openssl/bn.rb b/ext/openssl/lib/openssl/bn.rb
index 6d6c96e..e3a6bd2 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 aef3456..3caaacf 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