Skip to content

Instantly share code, notes, and snippets.

@ujihisa
Created August 23, 2009 22:03
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 ujihisa/173478 to your computer and use it in GitHub Desktop.
Save ujihisa/173478 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby192
def try(it)
puts "# '#{it}' in four rubies"
puts
{
"1.9.2'" => 'ruby192',
"1.9.1" => 'ruby191',
"1.8.7" => '/opt/local/bin/ruby',
"1.8.6" => '/usr/bin/ruby'
}.each do |k, v|
system "#{v} -e 'p(#{it})' >& tmptmptmp.txt"
puts "## in #{k}"
puts File.read "tmptmptmp.txt"
end
end
DATA.each_line {|l|
try(l.chomp)
puts
}
__END__
{}
{1 => 2}
{1}
{|x| 1 }
{ p 1 => 2 }
{ p(1) => 2 }
{ p(1 => 2) }
{ p {} => {} }
{p:p}
{ p, p = 1, 2, 3 }
p { 1 }
p({ 1 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment