highline

Ruby - Passing Blocks To Methods

I'm trying to do Ruby password input with the Highline gem and since I have the user input the password twice, I'd like to eliminate the duplication on the blocks I'm passing in. For example, a simple version of what I'm doing right now is: new_pass = ask("Enter your new password: ") { |prompt| prompt.echo = false } verify_pass = ask("E...

Ruby? How to ignore newlines in cut and pasted user input?

I've written a little Ruby script that requires some user input. I anticipate that users might be a little lazy at some point during the data entry where long entries are required and that they might cut and paste from another document containing newlines. I've been playing with the Highline gem and quite like it. I suspect I am just ...

Rewrite a ruby class on the fly

Hi there, I'm using HighLine to write my console application and I would like to modify the HighLine::Question::in_range! function so that tab completion stayed activated but that highline do not bother checking if the words typed are in the range. So let's say I have a tab completion list like %w{app1, app2, app3} I'd like to be able...

Getting 'choice' to work in Highline Ruby Gem without error and getting variable from it

I'm having a couple of problems using Highline in Ruby, and trying to get the choice element, detailed here, to work. At the moment the following code produces the error "error: wrong number of arguments (0 for 1). Use --trace to view backtrace" How do I get the variable out of choice? At the moment I have the 'do' setup, but I have ...

Watir changes highline's "ask" method

Hello! I've encoutered some strange functionality, when using Watir and Highline together. Here is simple example: require 'highline/import' comp = ask("Company? ") { |q| q.default = "MySuperCompany" } puts comp require 'watir' comp = ask("Company? ") { |q| q.default = "MySuperCompany" } puts comp Here is an output: Company? |M...