Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task routes: :environment do
- Base.routes.each_with_index do |route, n|
- method = route.request_method
- path = route.path.gsub(':version', route.version || '').sub('(.json)', '').sub('(.:format)', '')
- puts "#{pad(method, 10)} #{pad(path, 50)} #{route.description}"
- end
- end
- def pad(str, length)
- str << ' ' * (length - str.length) if str.length < length
- str
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement