rumblelabs/asset_sync — pull request #166 by georgedrummond (2013-03-05 23:11:32+00:00)
Title: Upload original font files as well as compiled and call uniq on uploaded assets

Sprockets has some difficulties with fonts in engines and the recommended approach seems to be to create an erb file and call ```asset_path``` to include the path to the file, as in the [twitter-bootstrap-rails](https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/vendor/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb) gem.

```erb
@font-face{
font-family:"FontAwesome";
src:url("<%= asset_path 'fontawesome-webfont.eot?v=3.0.2' %>");
```

This results in a rendered file with a link to asset without the fingerprinted hash appended to it.

```
@font-face{
font-family:"FontAwesome";
src:url("/assets/fontawesome-webfont.eot?v=3.0.2");
```

asset_sync currently only uploads fingerprinted assets meaning we have no fonts on our s3 server! This pull request uploads the original font file.

---

I have also called ```uniq!``` as described in #163 as from my log file I can see some assets are being uploaded twice.

```
Uploading: assets/large-flags/FJ-a7cd8f1613a7a8a8598100dc209f3133.png
Uploading: assets/large-flags/FJ-a7cd8f1613a7a8a8598100dc209f3133.png
Uploading: assets/large-flags/FK-e29acab007e1afed453c0f4015b5ad63.png
Uploading: assets/large-flags/FK-e29acab007e1afed453c0f4015b5ad63.png
```