Coder Social home page Coder Social logo

reline's Introduction

Build Status

This is a screen capture of IRB improved by Reline.

IRB improved by Reline

Reline

Reline is compatible with the API of Ruby's stdlib 'readline', GNU Readline and Editline by pure Ruby implementation.

Usage

Single line editing mode

It's compatible with the readline standard library.

See the document of readline stdlib or bin/example.

Multi-line editing mode

require "reline"

prompt = 'prompt> '
use_history = true

begin
  while true
    text = Reline.readmultiline(prompt, use_history) do |multiline_input|
      # Accept the input until `end` is entered
      multiline_input.split.last == "end"
    end

    puts 'You entered:'
    puts text
  end
# If you want to exit, type Ctrl-C
rescue Interrupt
  puts '^C'
  exit 0
end
$ ruby example.rb
prompt> aaa
prompt> bbb
prompt> end
You entered:
aaa
bbb
end

See also: test/reline/yamatanooroti/multiline_repl

License

The gem is available as open source under the terms of the Ruby License.

Acknowledgments for rb-readline

In developing Reline, we have used some of the rb-readline implementation, so this library includes copyright notice, list of conditions and the disclaimer under the 3-Clause BSD License. Reline would never have been developed without rb-readline. Thank you for the tremendous accomplishments.

reline's People

Contributors

aycabta avatar nobu avatar osyo-manga avatar ima1zumi avatar yo4 avatar msp-greg avatar k0kubun avatar hsbt avatar mame avatar jeremyevans avatar znz avatar larskanis avatar ioquatix avatar ko1 avatar silverphoenix99 avatar fnordfish avatar richardmcmillen avatar olleolleolle avatar jethrodaniel avatar acammack-r7 avatar unak avatar tompng avatar cremno avatar kozinski avatar tomas avatar gettalong avatar tmtm avatar purintai avatar postmodern avatar peterzhu2118 avatar

Watchers

James Cloos avatar

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.