Skip to content

Instantly share code, notes, and snippets.

@kota
Created February 6, 2015 08:46
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 kota/4cfb08948eed38c966b4 to your computer and use it in GitHub Desktop.
Save kota/4cfb08948eed38c966b4 to your computer and use it in GitHub Desktop.
# usage: ruby insert_property_annotation.rb < file
lines = STDIN.readlines
lines.each do |line|
if !(line =~ / class /) && line =~ /(\s+?)(public|private) (.+?) (.+?)[\s;]/
puts %W(#{$1}@property("#{$4.underscore}"))
puts line
else
puts line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment