module Git module Switcher class Menu Submenu = Struct.new(:label, :menu_items) do def to_s header = Rainbow(label).steelblue "\n\t#{header}\n\n" + menu_items.join("\n") end end MenuItem = Struct.new(:repo, :shortcut, :reference, :next) do HEAD = Rainbow(' <- HEAD ***').bold.aquamarine.freeze def head? reference.targets?(repo.head) end def to_s name = reference.name label = format('[%2s]', shortcut) format( " %