Parses a file with regex espressions and returns json formatted data - rails 2.3.18, ruby 1.8.7