百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

reline

> 编程语言
开源

与 Ruby 的 stdlib 'readline' API 兼容的库

310 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

与 Ruby 的 stdlib 'readline' API 兼容的库

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

ruby
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
bash
$ 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.

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

Releasing

bash
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.

Issues· 44 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyhacktoberfestruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言