File: limit.rb

package info (click to toggle)
ruby-highline 1.6.21-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 676 kB
  • ctags: 497
  • sloc: ruby: 4,805; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
#!/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"

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