Advertisement
Guest User

Untitled

a guest
May 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. task routes: :environment do
  2. Base.routes.each_with_index do |route, n|
  3. method = route.request_method
  4. path = route.path.gsub(':version', route.version || '').sub('(.json)', '').sub('(.:format)', '')
  5. puts "#{pad(method, 10)} #{pad(path, 50)} #{route.description}"
  6. end
  7. end
  8.  
  9. def pad(str, length)
  10. str << ' ' * (length - str.length) if str.length < length
  11. str
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement