Class: Palaver::PasswordBox

Inherits:
Base
  • Object
show all
Defined in:
lib/palaver/passwordbox.rb

Instance Method Summary collapse

Methods inherited from Base

#height, #text, #width, #with_tempfile

Constructor Details

#initialize(options) ⇒ PasswordBox

Returns a new instance of PasswordBox.



6
7
8
# File 'lib/palaver/passwordbox.rb', line 6

def initialize(options)
  super(options)
end

Instance Method Details

#showObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/palaver/passwordbox.rb', line 10

def show
  answer = nil
  with_tempfile do |fname|
    cmd = "dialog #@common_options --passwordbox '#@text' #@height #@width 2> #{fname}"
    success = system cmd
    if success  then
      answer = File.read(fname)
    end
  end
  return answer      
end