Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions doc/echo.rb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be added?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be added?

You mean the example (echo)? Or the page?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action on this (yet).

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'reline'

puts 'Welcome to the Echo program!'
puts ' To exit, type Ctrl-d in empty line.'

# Words for completion.
Words = %w[ foo_foo foo_bar foo_baz qux ]
Reline.completion_proc = proc { |word| Words }

# REPL (Read-Evaluate-Print Loop).
while line = Reline.readline(prompt = 'echo> ', history = true)
puts "You typed: '#{line.chomp}'."
end
Loading