Breefield/typecatcher

Error with running

Opened this issue · 2 comments

I tried running the program, but this is what I get:

unknownf81edfea7052:typecatcher jimmyliu$ ruby run.rb hxj2gfu
run.rb:41: odd number list for Hash
family: font.match(/font-family:"(.+?)"/i)[1],
^
run.rb:41: syntax error, unexpected ':', expecting '}'
family: font.match(/font-family:"(.+?)"/i)[1],
^
run.rb:42: syntax error, unexpected ':', expecting '='
data: font.match(/src:url(data:.+?base64,(.+?))/i)[1],
^
run.rb:43: syntax error, unexpected ':', expecting '='
weight: font.match(/font-weight:(.+?);/i)[1],
^
run.rb:44: syntax error, unexpected ':', expecting '='
style: font.match(/font-style:(.+?);/i)[1]
^
run.rb:45: syntax error, unexpected '}', expecting kEND
run.rb:73: syntax error, unexpected $end, expecting kEND

This is a syntax error due to different ruby versions. You must be using Ruby < 1.9.
Ruby 1.9+ introduced a new hash syntax. I.e.

{:key => 'value'}

becomes

{key: 'value'}

I would suggest using homebrew to install RVM, then
rvm use 2.0 before running this script.

Let me know if you have any questions/need any help getting ruby 2 working. Alternatively I can remove that syntax from this project and push. Should fix things for you.