From 43802a088e204c32564c243d8f99f8980b150279 Mon Sep 17 00:00:00 2001 From: Olivier Lacan Date: Thu, 17 Aug 2023 17:28:16 -0700 Subject: [PATCH] [ruby/io-console] [DOC] IO::console.getpass usage example There were no clear example of this very useful method's usage anywhere in the IO or IO::Console docs, which was a shame. https://github.com/ruby/io-console/commit/4d324586a8 --- ext/io/console/console.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 6dadc8d0d6..836391f370 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -1578,6 +1578,12 @@ str_chomp(VALUE str) * see String#chomp!. * * You must require 'io/console' to use this method. + * + * require 'io/console' + * IO::console.getpass("Enter password: ") + * Enter password: + * # => "mypassword" + * */ static VALUE console_getpass(int argc, VALUE *argv, VALUE io)