Sha256: 6998fd6b15fc049f789912ced997b66edc8623c64aad35462599c3f6e80e7a19

Contents?: true

Size: 392 Bytes

Versions: 1

Compression:

Stored size: 392 Bytes

Contents

exports.replace = function(code, sandbox, pkg, format) {
  var match, url, replacement;
  while (match = code.match(/(sc_static|static_url)\(['"]([^'"\(\)]+)['"]\)/)) {
    url = sandbox.spade.loader.resolveUrl(pkg.name+"/~resources/"+match[2], pkg);
    replacement = format ? format.replace('{url}', url) : '"'+url+'"';
    code = code.replace(match[0], replacement);
  }
  return code;
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spade-0.0.1 packages/sproutcore-preprocessor/lib/sc_static.js