Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created October 24, 2011 19:35
Show Gist options
  • Save fowlmouth/1309925 to your computer and use it in GitHub Desktop.
Save fowlmouth/1309925 to your computer and use it in GitHub Desktop.
abstk-rb
packages = []
('A'..'Z').each_with_index { |_, i|
packages << ["Package#{_}", :"stage#{i%3+1}"]
}
class MyWizard < AbsTK::Curses::Wizard
screen 'Welcome' do
text_area :irrelevant, text: <<eos
Welcome to the blah blah installer!
*This doesn't actually do anything*
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
Wall of text, wall of text, wall of text, wall of text, wall of text.
eos
end
screen 'User Setup' do
# the screen should automatically handle nav buttons (back, next, exit, etc)
text_input 'Username', max_length: 32
password 'Password', max_length: 32
checkbox 'Super User Permissions'
end
screen 'Package Selection' do
radiolist 'Predefined Package Sets' do
option 'Base' do
# to be evalulated when the user selects this option
form['Packages'].each { |p|
if p.data[1] == :stage1
p.select
else
p.unselect
end
}
end
option 'Typical', default: true do
form['Packages'].each { |p|
p.data == :stage3 ?
p.unselect :
p.select
}
end
option 'Full' do
form['Packages'].each { |p| p.select }
end
end
checklist :packages, title: 'Packages', data: packages
button :irrelevant, text: 'Check Dependencies' do
#logic here to fill out dependencies
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment