Skip to content

Instantly share code, notes, and snippets.

@eightbitraptor
Created October 12, 2011 09:36
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 eightbitraptor/1280749 to your computer and use it in GitHub Desktop.
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
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