reline

0.6.0last stable release 1 month ago
Complexity Score
Medium
Open Issues
43
Dependent Projects
19
Weekly Downloadsglobal
36

License

  • Ruby

    Downloads

    Readme

    This is a screen capture of 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

    Documentation

    Reline::Face

    You can modify the text color and text decorations in your terminal emulator. See doc/reline/face.md

    Contributing

    Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/reline.

    Run tests

    Note Please make sure you have libvterm installed for yamatanooroti tests (integration tests).

    If you use Homebrew, you can install it by running brew install libvterm.

    WITH_VTERM=1 bundle install
    WITH_VTERM=1 bundle exec rake test test_yamatanooroti
    

    Releasing

    rake release
    gh release create vX.Y.Z --generate-notes
    

    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.

    Dependencies

    CVE IssuesActive
    0
    Scorecards Score
    No Data
    Test Coverage
    No Data
    Follows Semver
    No
    Github Stars
    266
    Dependenciestotal
    1
    DependenciesOutdated
    0
    DependenciesDeprecated
    0
    Threat Modelling
    No
    Repo Audits
    No

    Learn how to distribute reline in your own private RubyGems registry

    gem install reline
    Processing...
    Done

    67 Releases

    RubyGems on Cloudsmith

    Getting started with RubyGems on Cloudsmith is fast and easy.