Created
November 6, 2012 02:25
-
-
Save mindscratch/4022171 to your computer and use it in GitHub Desktop.
ruby "complex" stuff - from Matt Aimonetti presentation
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
| GC::Profiler.enable | |
| # your code | |
| puts GC::Profiler.result | |
| # GC.disable | |
| puts ObjectSpace.count_objects.inspect |
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
| # src: http://www.confreaks.com/videos/714-rubyconf2011-complex-ruby-concepts-dummified | |
| ?> require 'ripper' | |
| >> require 'pp' | |
| >> src = "puts 'Hello Rubyworld'" | |
| >> puts "source: #{src}" | |
| >> puts "tokenized:" | |
| >> pp Ripper.tokenize src | |
| ?> pp Ripper.lex src | |
| >> | |
| ?> pp Ripper.sexp src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment