summaryrefslogtreecommitdiff
path: root/examples/limit.rb
blob: 6115580edf2cc22bf0de7efa98941c22fe8585d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env ruby -w

# limit.rb
#
#  Created by James Edward Gray II on 2008-11-12.
#  Copyright 2008 Gray Productions. All rights reserved.

require "rubygems"
require "highline/import"

puts "Using: #{HighLine.default_instance.terminal.class}"
puts

text = ask("Enter text (max 10 chars): ") { |q| q.limit = 10 }
puts "You entered: #{text}!"