Created
February 4, 2016 13:57
-
-
Save andrei512/4944194b4f6d71a06120 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prop_regex = /@property\s*\([^\)]+\)\s+(?<type>\w+(\s*\*)?)\s*(?<name>\w+)/ | |
code = `pbpaste` | |
property_list = [] | |
code.scan(prop_regex) do |match| | |
type, name = match | |
type.gsub!(" ", "") | |
property_list << { | |
type: type, | |
name: name | |
} | |
end | |
output = "PTK_CODING_COPYING_EQUAL_HASH((selist(" + property_list.map {|x| x[:name]}.join(", ") + ") ))" | |
`echo #{output.inspect} | pbcopy` | |
PTK_CODING_COPYING_EQUAL_HASH((selist(alias, addressId, state, county, postCode, city, line1, line2, country, firstName, lastName) )) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment