Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: Ruby  |  size: 0.31 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. java = File.open('./java')
  2.  
  3. File.open('./c').each_with_index do |line, number|
  4.     if (line[0] != '/')     #avoid comments
  5.         convert(line)
  6.        
  7.     end
  8. end
  9.        
  10. def convert(str)
  11.     name, params = string.gsub!(/_/, ' ').split(" ").drop(2))
  12.     "final Color #{name} = new Color(#{params}}"
  13. end