Skip to content

Instantly share code, notes, and snippets.

@kyanny
Last active December 26, 2015 04:49
Show Gist options
  • Save kyanny/7096634 to your computer and use it in GitHub Desktop.
Save kyanny/7096634 to your computer and use it in GitHub Desktop.
Put this file to `lib/tasks/routes.rake`
# 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
@kyanny
Copy link
Author

kyanny commented Oct 22, 2013

Rake::Task[:routes].enhance() do
  Rake::Task[:routes_for_grape].invoke
end

これ不要らしい。 Rake は同名でタスクを登録すると上書きせず定義された順にすべて実行するため。

http://d.hatena.ne.jp/benikujyaku/20111211/1323583384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment