seattlerb/debride

debride_rails_whitelist does not generate a whitelist from routes

Closed this issue · 3 comments

In rails 6, "rake routes" is replaced with "rails routes". I do not know if the output has changed.

Steps:

rails routes > routes.txt
touch nologs.txt
debride_rails_whitelist routes.txt nologs.txt

Expected: Get a list of whitelisted methods generated from routes.txt (to stdout)

Actual: the list is empty

the list is empty because you gave it no input to process:

10382 $ debride_rails_whitelist 
error: no files given
usage:
  rake routes > routes.txt
  debride_rails_whitelist routes.txt logfiles... | sort -u > whitelist.txt
10360 $ rails routes > routes.txt
10364 $ debride_rails_whitelist routes.txt log/* 2>/dev/null | sort -u
create
index
join_us
new
past
projects
show

I guess I don't see the point of passing the routes at all if it only grabs data from the logs.

you're welcome to read the code