Skip to content

Instantly share code, notes, and snippets.

@ujihisa ujihisa/patchy.rb
Created Aug 23, 2009

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.