github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

luislavena / rb-readline

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 46
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (8)
  • Downloads (4)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • v0.1.2
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Pure-Ruby Readline Implementation — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Bumped version to 0.2.0. 
luislavena (author)
Tue Sep 15 13:12:00 -0700 2009
commit  05129008a3a5b197a63dbbc0c9175ffec07774ee
tree    e13bbf36e25a16e438669bbbf1efd6d50751d3f5
parent  b218364494959faf1a707978399a52273c6e8412
rb-readline /
name age
history
message
file .gitignore Fri Apr 10 15:42:40 -0700 2009 Initial code import. Thanks Park Heesob for wr... [luislavena]
file CHANGES Tue Sep 15 12:57:14 -0700 2009 Fix crash when performing reverse look search. ... [luislavena]
file LICENSE Sat Apr 11 08:22:16 -0700 2009 Relicense library as BSD. Since is a complete ... [luislavena]
file README Mon Sep 14 13:13:16 -0700 2009 Minor correction to README. [luislavena]
file Rakefile Tue Sep 15 13:12:00 -0700 2009 Bumped version to 0.2.0. [luislavena]
directory examples/ Sat Apr 25 17:18:49 -0700 2009 Added README, examples and tests, courtesy of D... [luislavena]
directory lib/ Tue Sep 15 13:12:00 -0700 2009 Bumped version to 0.2.0. [luislavena]
file setup.rb Fri Apr 10 15:42:40 -0700 2009 Initial code import. Thanks Park Heesob for wr... [luislavena]
directory test/ Mon May 18 19:00:25 -0700 2009 Yikes, removed brittle test. Testing internal ... [luislavena]
README
= Description

The readline library provides a pure Ruby implementation of the GNU
readline C library, as well as the Readline extension that ships as part
of the standard library.

= Synopsis
 require 'readline'

 loop do
    line = Readline::readline('> ')
    Readline::HISTORY.push(line)
    puts "You typed: #{line}"
    break if line == 'quit'
 end

= Motivation

First, building the GNU readline library on MS Windows with Visual C++ is
almost impossible. However, certain libraries depend on readline. By providing
a pure Ruby version we eliminate the entire compiler compatibility issue.

Second, even on distributions of Windows built with MinGW (that include
the readline library for Windows), the behavior was sometimes erratic and
would break.

Third, even on certain Unix distributions the GNU readline library is not
guaranteed to be installed. Providing a pure Ruby readline eliminates the
need to install a C library first. It's also one less link in the dependency
chain, meaning we don't need to worry about possible changes in the underlying
C library affecting our interface.

Fourth, by making the interface pure Ruby, we increase the likelihood of
receiving patches, feature requests, documentation updates, etc from the
community at large, since not everyone knows C.

Lastly, the Readline interface that ships as part of the standard library is
weak, and only provides a very limited subset of the actual GNU readline
library. By providing a pure Ruby implementation we allow 3rd party library
authors to write their own interface as they see fit.

= Tutorial

For an excellent tutorial on how to use Readline in practice, please see
Joseph Pecoraro's examples at http://bogojoker.com/readline/. There is also
documentation by Michael Fellinger at http://p.ramaze.net/18421.md.

= Alternatives

See Rawline for a library that began life in pure Ruby and provides an
interface that's probably more comfortable to Ruby programmer. It has certain
features that Readline does not. In addition, it provides a Readline
compatibility mode.

= Authors

* Park Heesob (C translation, code donated as part of bounty)
* Daniel Berger (Documentation and testing)
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server