<commit_before># PostCSS Rails Asset URLs

PostCSS plugin to swap CSS URLs with the Rails SASS helper, `asset-url`. This is useful for CSS postprocessor compilation outside of the Rails pipeline when you still want to deploy assets through Rails. `asset-url` in the Rails pipeline will handle fingerprinting and asset paths for you as part of the normal Rails compilation.

## Installation

Install via npm:

   ```sh
  npm install --save-dev postcss-rails-asset-urls
   ```

## Example

  ```js
  var postcss = require('postcss');
  var railsAssetUrls = require('postcss-rails-asset-urls');

  var css = '@font-face {font-family:Test;src:url("test.woff") format("woff"),url("test.otf") format("otf")}';
  console.log(postcss(railsAssetUrls()).process(css).css);

  // => '@font-face {font-family:Test;src:asset-url("test.woff") format("woff"),asset-url("test.otf") format("otf")}'
  ```

To use with [grunt-postcss](https://github.com/nDmitry/grunt-postcss "Grunt PostCSS"), add this to your Gruntfile:

  ```js
  postcss: {
    options: {
      processors: [
        require('postcss-rails-asset-urls')()
      ]
    },
    dist: {
      src: 'dist/css/*.css'
    }
  }
  ```

## Contributing

Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.

## License

MIT © <NAME>

[ci]:      https://travis-ci.org/ryanbahniuk/postcss-rails-asset-urls
[npm]:     http://badge.fury.io/js/postcss-discard-font-face
[postcss]: https://github.com/postcss/postcss<commit_msg>fixing indentation in readme<commit_after># PostCSS Rails Asset URLs

PostCSS plugin to swap CSS URLs with the Rails SASS helper, `asset-url`. This is useful for CSS postprocessor compilation outside of the Rails pipeline when you still want to deploy assets through Rails. `asset-url` in the Rails pipeline will handle fingerprinting and asset paths for you as part of the normal Rails compilation.

## Installation

Install via npm:

 ```sh
npm install --save-dev postcss-rails-asset-urls
 ```

## Example

```js
var postcss = require('postcss');
var railsAssetUrls = require('postcss-rails-asset-urls');

var css = '@font-face {font-family:Test;src:url("test.woff") format("woff"),url("test.otf") format("otf")}';
console.log(postcss(railsAssetUrls()).process(css).css);

// => '@font-face {font-family:Test;src:asset-url("test.woff") format("woff"),asset-url("test.otf") format("otf")}'
```

To use with [grunt-postcss](https://github.com/nDmitry/grunt-postcss "Grunt PostCSS"), add this to your Gruntfile:

```js
postcss: {
  options: {
    processors: [
      require('postcss-rails-asset-urls')()
    ]
  },
  dist: {
    src: 'dist/css/*.css'
  }
}
```

## Contributing

Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.

## License

MIT © <NAME>

[ci]:      https://travis-ci.org/ryanbahniuk/postcss-rails-asset-urls
[npm]:     http://badge.fury.io/js/postcss-discard-font-face
[postcss]: https://github.com/postcss/postcss
{'fraction_non_alphanumeric': 0.15172876804296745, 'fraction_numerical': 0.0, 'mean_word_length': 4.068027210884353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '844738', 'n_tokens_mistral': 1023, 'n_tokens_neox': 984, 'n_words': 266}