Giter Site home page Giter Site logo

answering in multiple lines about highline HOT 3 CLOSED

guyisra avatar guyisra commented on July 20, 2024 2
answering in multiple lines

from highline.

Comments (3)

abinoam avatar abinoam commented on July 20, 2024

I don't think so.
But I'll check it out.

from highline.

abinoam avatar abinoam commented on July 20, 2024

@guyisra

We can think about adding multiline support at HighLine itself. But I think I'll not have the time to implement it by now.

But, you can get multiline input as you would do within any Ruby script.

Something around the lines of:

#!/usr/bin/env ruby

# From: http://stackoverflow.com/a/13840066/875229

# HighLine uses gets or readline to gather input
# So it uses the same separator rules as other Ruby scripts
# A possible hack would be ...

require 'highline'

puts HighLine::VERSION

cli = HighLine.new

puts "Your current separator character is: #{$/.inspect}"
puts "Saving it for later..."

old_sep = $/

puts "Setting separator to the three letters EOF"

$/ = "EOF"

answer = cli.ask "Write a multiline short history about your day."

puts "Your answer was: #{answer}"

puts "Restoring separator to #{old_sep.inspect}"

$/ = old_sep

Do you think this would solve your problem? If so, please close this issue. But, feel free to discuss it futher. And thank you for reporting it. I think is something others may have a use to.

from highline.

abinoam avatar abinoam commented on July 20, 2024

Hi @guyisra,

I'm closing this issue as stall. But, feel free to reopen it if you find it necessary.

from highline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.