routing_report/lib/tasks/routing_report.rake

14 lines
362 B
Ruby
Raw Normal View History

2017-07-20 18:20:18 +00:00
namespace :routing_report do
task :run => :environment do
# pre-load all controllers:
Dir.glob(Rails.root.join('app', 'controllers', '**', '*_controller.rb')).each do |path|
require_dependency(path)
end
RoutingReport::Report.new(
base_class: ActionController::Base,
routes: Rails.application.routes.set
).print
end
end