meeech/nirv — Issue #1: Can't create a task containing an apostrophe
Author: kleinfelter
Created: 2011-11-27 19:23:37+00:00
State: open

When I try to create a task such as "Kevin's Task", nirv fails with a shell error:
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file

The problem is that task.rb does not escape apostrophes in the call to curl. I hacked around this by making the 'post' method look like this:

def post payload0
payload = payload0.sub("'","\\'")
result = `curl -sX POST 'https://api.nirvanahq.com/?api=json&authtoken=#{@token}' -d '#{payload}'`
end