Created
October 12, 2011 09:36
-
-
Save eightbitraptor/1280749 to your computer and use it in GitHub Desktop.
Testing gist.el with some code from the post parser of ebr.com
This file contains 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
lines = File.open(path) | |
body = lines.map do |l| | |
if l.match /^::(.*)::(.*)$/ | |
instance_variable_set("@#{$1}", $2.strip ) | |
self.class.send(:attr_accessor, "#{$1}") | |
nil | |
else | |
l | |
end | |
end.compact! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment