Class: Palaver::Checklist
- Inherits:
-
ListWithOptions
- Object
- Base
- ListWithOptions
- Palaver::Checklist
- Defined in:
- lib/palaver/checklist.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Checklist
constructor
A new instance of Checklist.
- #show ⇒ Object
Methods inherited from ListWithOptions
#list_height, #option, #options_string_no_status, #options_string_with_status
Methods inherited from Base
#height, #text, #width, #with_tempfile
Constructor Details
#initialize(options) ⇒ Checklist
Returns a new instance of Checklist.
8 9 10 |
# File 'lib/palaver/checklist.rb', line 8 def initialize() super() end |
Instance Method Details
#show ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/palaver/checklist.rb', line 12 def show choices = nil with_tempfile do |fname| cmd = "dialog --checklist '#@text' #@height #@width #@list_height #{} 2> #{fname}" success = system cmd if success then choices = File.read(fname).split(" ").map { |s| s[1..-2] } end end return choices end |