Class: Bcome::RenderIrb
Instance Method Summary collapse
Instance Method Details
#list_items(parent_collection, items) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/render_irb.rb', line 3 def list_items(parent_collection, items) if !items || !items.any? print "\nNo resources collections found. Maybe you forgot to add any?".headsup else print "\n #{parent_collection}\n\n".colorize(:green) # are available:\n\n".colorize(:green) items.each do |item| colour = item.highlight? ? :yellow : :green print "* #{item.do_describe}\n".colorize(colour) end end print "\n" end |
#menu(menu_items, stack_level_instance) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/render_irb.rb', line 16 def (, stack_level_instance) = ::Bcome::Orchestrator::Recipe.(stack_level_instance) += if .any? = "\n** Commands **\n\n" = "\n\The following commands are available: \n\n" .each do |item| command = item[:command] description = item[:description] usage = item[:usage] += "> #{command}\n" += "- #{description}\n" += "e.g. #{usage}\n" if usage += "\n" end += "\n\n" print . end |