example.rb in cliprompt-0.0.3 vs example.rb in cliprompt-0.0.4
- old
+ new
@@ -38,10 +38,19 @@
showguess 'SOMEVAR', "what is your var?", 42
showguess 'SOMEVAR', "what is your var?", boolean: true
showguess 'SOMEVAR', "what is your var?", [12, 'aa']
end
+ def biglist
+ puts '-------------------'
+ puts 'a long list of choices'
+ show 'a list with default?', [22, 33, 44, '=55', 66, 77, 'something else']
+ show 'a list without default?', [22, 33, 44, '55', 66, 77, 'something else']
+ show 'a big list of choices but not in list?', choices: [22, 33, 44, '=55', 66, 77, 'something else'], aslist: false
+ show 'a small list of choices but we want it in list?', choices: [22, 33, '=44'], aslist: true
+ end
+
def show(*args)
it = ask *args
puts "-- returned #{it.inspect}"
puts
end
@@ -53,7 +62,8 @@
end
end
m = Myclass.new
-m.guessit
-m.askit
+#m.guessit
+#m.askit
+m.biglist