Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Unexpected behaviour of Highline metod ask!

Reply
Thread Tools

Unexpected behaviour of Highline metod ask!

 
 
Buda & Nada
Guest
Posts: n/a
 
      06-17-2009
Hi!

I am having an unexpected behaviour when the follwoing code is
executed:

pass = ask("Enter your password: ") { |q| q.echo = "x" }

As I enter characters there is not instantenious echo of the "x"
character. Instead, nothing is echoed until <enter> is hit when all
"x" characters do appear. Is this the intention here. For would
think that "x" characters should after each press of any character.

I would apprecite a commnet.

Bud M
 
Reply With Quote
 
 
 
 
Axel
Guest
Posts: n/a
 
      06-17-2009
In case you don't get a better answer (I've experiences with highline,
but not with 'echo'):

If you are on Windows, maybe it does not work.

If you are on Linux/Unix, do you have everything from the
documentation:

"
echo:
This requires HighLine’s character reader. See the character attribute
for details.

Note: When using HighLine to manage echo on Unix based systems, we
recommend installing the termios gem. Without it, it’s possible to
type fast enough to have letters still show up (when reading character
by character only).
"

-Axel
 
Reply With Quote
 
 
 
 
James Gray
Guest
Posts: n/a
 
      06-17-2009
On Jun 17, 2009, at 12:10 AM, Buda &amp; Nada wrote:

> Hi!


Hello.

> I am having an unexpected behaviour when the follwoing code is
> executed:
>
> pass = ask("Enter your password: ") { |q| q.echo = "x" }
>
> As I enter characters there is not instantenious echo of the "x"
> character. Instead, nothing is echoed until <enter> is hit when all
> "x" characters do appear. Is this the intention here. For would
> think that "x" characters should after each press of any character.
>
> I would apprecite a commnet.


As Axel pointed out, your platform may matter in this case. Can you
tell us what you are using?

James Edward Gray II

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected behaviour for dispatching events... Mark Java 4 01-12-2011 04:21 PM
Metod Documentation in WSDL SMeddows ASP .Net Web Services 1 01-16-2009 08:18 PM
ostringstream unexpected behaviour Old Wolf C++ 1 02-04-2004 04:38 AM
unexpected map behaviour Steven Van den Berghe C++ 2 08-28-2003 11:59 AM
Re: Tool for Visualizing external / internal metod calls Ira Baxter Java 0 06-27-2003 06:13 PM



Advertisments