Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.