Skip to content

Instantly share code, notes, and snippets.

@hyoshida
Last active August 29, 2015 14:02
Show Gist options
  • Save hyoshida/11082eadd1bde94c9a04 to your computer and use it in GitHub Desktop.
Save hyoshida/11082eadd1bde94c9a04 to your computer and use it in GitHub Desktop.
notesタスクの対象にHACKとXXXを加える
# refs http://crypt.codemancers.com/posts/2013-07-12-redefine-rake-routes-to-add-your-own-custom-tag-in-Rails/
#
# for re-defining the Rake task
# otherwise the previous Rake task is still called
ADDITIONAL_NOTES = %w( hack xxx )
task(:notes).clear
desc "Enumerate all annotations (use notes:optimize, :fixme, :todo, :#{ADDITIONAL_NOTES.join(', :')} for focus)"
task :notes do
SourceAnnotationExtractor.enumerate "OPTIMIZE|FIXME|TODO|#{ADDITIONAL_NOTES.map(&:upcase).join('|')}", tag: true
end
namespace :notes do
ADDITIONAL_NOTES.each do |task_name|
task(task_name).clear
task task_name do
SourceAnnotationExtractor.enumerate task_name.upcase, tag: true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment