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

# 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}!"