Last active
December 26, 2015 04:49
-
-
Save kyanny/7096634 to your computer and use it in GitHub Desktop.
Put this file to `lib/tasks/routes.rake`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://hermes.vertigem.xxx/2013/04/02/rake-routes-no-grape/ | |
desc "API Routes" | |
task routes_for_grape: :environment do | |
API::Base.routes.each do |api| | |
method = api.route_method.ljust(10) | |
path = api.route_path | |
puts " #{method} #{path}" | |
end | |
end | |
Rake::Task[:routes].enhance() do | |
Rake::Task[:routes_for_grape].invoke | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
これ不要らしい。 Rake は同名でタスクを登録すると上書きせず定義された順にすべて実行するため。
http://d.hatena.ne.jp/benikujyaku/20111211/1323583384