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

Version Path
houston-core-0.9.2 lib/tasks/events.rake
houston-core-0.9.1 lib/tasks/events.rake
houston-core-0.9.0 lib/tasks/events.rake
houston-core-0.9.0.rc1 lib/tasks/events.rake
houston-core-0.8.4 lib/tasks/events.rake
houston-core-0.8.3 lib/tasks/events.rake
houston-core-0.8.2 lib/tasks/events.rake
houston-core-0.8.1 lib/tasks/events.rake
houston-core-0.8.0 lib/tasks/events.rake
houston-core-0.8.0.pre2 lib/tasks/events.rake
houston-core-0.8.0.pre lib/tasks/events.rake
houston-core-0.7.0 lib/tasks/events.rake
houston-core-0.7.0.beta4 lib/tasks/events.rake