File: overwrite.rb

package info (click to toggle)
ruby-highline 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 800 kB
  • sloc: ruby: 5,789; sh: 7; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env ruby
# encoding: utf-8

# overwrite.rb
#
#  Created by Jeremy Hinegardner on 2007-01-24
#  Copyright 2007 Jeremy Hinegardner.  All rights reserved

require "rubygems"
require "highline/import"

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

prompt = "here is your password:"
ask(
  "#{prompt} <%= color('mypassword', RED, BOLD) %> (Press Any Key to blank) "
) do |q|
  q.overwrite = true
  q.echo      = false  # overwrite works best when echo is false.
  q.character = true   # if this is set to :getc then overwrite does not work
end
say("<%= color('Look! blanked out!', GREEN) %>")