decision-labs / gcm

A gem that helps developers send data from ruby backend servers to their Mobile applications on devices via Google Cloud Messaging (GCM).
MIT License
385 stars 61 forks source link

little bug in example code #1

Closed alokat closed 12 years ago

alokat commented 12 years ago

Hi sabman,

if I use your example code in a script ruby says there is an error with the following line

options = {body: data: {key: "value"}}

./trigger_push.rb:5: odd number list for Hash
options = {body: data:{key: "value"}}
                ^
./trigger_push.rb:5: syntax error, unexpected ':', expecting '}'
options = {body: data:{key: "value"}}
                ^
./trigger_push.rb:5: odd number list for Hash
options = {body: data:{key: "value"}}
                           ^
./trigger_push.rb:5: syntax error, unexpected '}', expecting $end
options = {body: data:{key: "value"}}

Both Ruby 1.8.7 and 1.9.3

I fixed it by changing your example script a little. If you want feel free to pull.

Regards, fritjof

sabman commented 12 years ago

cool thanks I merged it!