Skip to content

Instantly share code, notes, and snippets.

@mchung
Created February 13, 2010 00:55
Show Gist options
  • Save mchung/303164 to your computer and use it in GitHub Desktop.
Save mchung/303164 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'parse_tree'
require 'parse_tree_extensions'
require 'ruby2ruby'
require 'spec'
def code_for_a_proc(proc)
proc.to_ruby
end
my_proc = proc {|a,b| return "I want this proc as a string or sexp." }
code_for_a_proc(my_proc).should == "proc { |a, b| return \"I want this proc as a string or sexp.\" }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment