Class: Pwl::Dialog::SystemDialog

Inherits:
Base
  • Object
show all
Defined in:
lib/pwl/dialog/base.rb

Overview

Base class for dialogs implemented by executing a system command.

Direct Known Subclasses

CocoaDialog, GnomeDialog

Instance Attribute Summary

Attributes inherited from Base

#prompt, #title

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Pwl::Dialog::Base

Instance Method Details

#commandObject



32
33
34
# File 'lib/pwl/dialog/base.rb', line 32

def command
  raise "Not implemented. A derived class is expected to provide the OS command for prompting a password."
end

#get_inputObject

Raises:



26
27
28
29
30
# File 'lib/pwl/dialog/base.rb', line 26

def get_input
  out, err, rc = Open3.capture3(command)
  raise Cancelled.new(rc.exitstatus) unless 0 == rc.exitstatus
  out.chomp
end