sproutcore / abbot

SproutCore Build Tools [deprecated]
http://www.sproutcore.com
88 stars 44 forks source link

"@include slices" directive does not support single quotes #23

Closed levi closed 13 years ago

levi commented 13 years ago

When using:

@include slices('images/toolbar.png', $left: 0, $width: 20, $repeat: repeat-x);

Build tools throws a file not found exception and fails to slice the image. However, when the single quotes are changed to double quotes, the file is found and the image is sliced. Chance clearly does not support single quotes in this directive, and probably should be supported in the future.

ialexi commented 13 years ago

Ah yeah. Oops. I did not want to write my own string parser, so used the JSON parser, but JSON doesn't support single quotes.

I know of a semi-hacky way to fix it: replace the beginning and ending quote with double quotes before parsing it with JSON.

If you want to try to fix it, see this code: https://github.com/sproutcore/abbot/blob/master/vendor/chance/lib/chance/parser.rb#L267

wagenet commented 13 years ago

Alex, has this been fixed?

wagenet commented 13 years ago

This has been fixed.