ハイラインを使用する gem/cli があり、常に使用できるように独自のコマンドを設定できるかどうか疑問に思っていました (「ヘルプ」に似ています)。
require 'rubygems'
require 'highline/import'
say("\nThis is the new mode (default)...")
choose do |menu|
menu.prompt = "Please choose your favorite programming language? "
menu.choice :ruby do say("Good choice!") end
menu.choices(:python, :perl) do say("Not from around here, are you?") end
end
say("\nThis is letter indexing...")
choose do |menu|
menu.index = :letter
menu.index_suffix = ") "
menu.prompt = "Please choose your favorite programming language? "
menu.choice :ruby do say("Good choice!") end
menu.choices(:python, :perl) do say("Not from around here, are you?") end
end
say("\nThis is with a different layout...")
choose do |menu|
menu.layout = :one_line
menu.header = "Languages"
menu.prompt = "Favorite? "
menu.choice :ruby do say("Good choice!") end
menu.choices(:python, :perl) do say("Not from around here, are you?") end
end
ありがとう!