Skip to content

Instantly share code, notes, and snippets.

@eval
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eval/9410525 to your computer and use it in GitHub Desktop.
Save eval/9410525 to your computer and use it in GitHub Desktop.
# Usage:
# $ rails new blog -m https://gist.githubusercontent.com/eval/9410525/raw/template.rb
annotate_version = ask("What annotate version should I bundle? [2.6.2]")
gem 'annotate', annotate_version.presence || '2.6.2'
generate(:model, "person", "name:string")
inject_into_class 'app/models/person.rb', 'Person', " A = 1\n"
rake "db:migrate"
run "bundle exec annotate"
/Users/gert/tmp/annotate-issue/blog/app/models/person.rb:2: warning: already initialized constant Person::A
/Users/gert/tmp/annotate-issue/blog/app/models/person.rb:2: warning: previous definition of A was here
Annotated (1): Person
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment