Sha256: 5be595f7c8b3f117b98cb2fcdf7b20656a91babe4ab5dfbd5340b53fbd83caa3
Contents?: true
Size: 520 Bytes
Versions: 13
Compression:
Stored size: 520 Bytes
Contents
namespace :houston do desc "Lists registered events and their descriptions" task :events do longest_name = Houston.events.map { |event| event.name.length }.max longest_params = Houston.events.map { |event| event.params.join(", ").length }.max Houston.events.sort_by(&:name).each do |event| params = "#{event.params.join(", ")}" if event.params.any? puts " \e[36m#{event.name.ljust(longest_name)}\e[0m \e[96m#{params.to_s.ljust(longest_params)}\e[0m #{event.description}" end end end
Version data entries
13 entries across 13 versions & 1 rubygems