Skip to content

Instantly share code, notes, and snippets.

@mindscratch
Created November 6, 2012 02:25
Show Gist options
  • Select an option

  • Save mindscratch/4022171 to your computer and use it in GitHub Desktop.

Select an option

Save mindscratch/4022171 to your computer and use it in GitHub Desktop.
ruby "complex" stuff - from Matt Aimonetti presentation
GC::Profiler.enable
# your code
puts GC::Profiler.result
# GC.disable
puts ObjectSpace.count_objects.inspect
# 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