README.md in slim-grunt-helpers-0.1.0 vs README.md in slim-grunt-helpers-0.2.0

- old
+ new

@@ -48,13 +48,14 @@ ```ruby == sg_usemin_css('application.css', alt: '.tmp') do |usemin| - usemin << 'styles/bootstrap.css' - usemin.add 'styles/main.css', 'data-customattr' => 'customdata' + - usemin.include 'styles/secondary.css', 'data-customattr' => 'customdata' ``` -**Note:** You can either use **&lt;&lt;** or `add`, I prefer the first one but if you want use two params, +**Note:** You can either use **&lt;&lt;**, `add` or `include`, I prefer the first one but if you want use two params, the only way to do it is in this way: ```ruby - usemin.<<('param1', 'data-customattr' => 'customdata') ``` Which I consider quite horrible, so the method is aliased with `add` @@ -70,9 +71,18 @@ An object `usemin` will be yielded to the block which has only one method: **&lt;&lt;**. This method requires first argument which is path to your css file (http path) and the second argument is a hash of options which are appended as attributes to the link tag. Notice that on `link` tag, `rel="stylesheet"` is automatically appended (and can be overwritten by specifying a `rel` key in options). Additionally, notice that attributes with `nil` or `false` as value are not set (so you can remove `rel`), while those with `true` are set but without value and without `=""`. + +## usemin.require and usemin.require_tree +`require` allows to include files only if they are not already included. Uses same params as `include`. +`require_tree` instead, require an entire directory tree, using [Dir glob](http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob) pattern. It accepts the following parameters: + +- `root_path` which is the path will be used as base directory (and **omitted in tags**) +- `pattern` which is the pattern accepted by [Dir glob](http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob), used to search files +- `relative` which if it's true, ensures file path won't start with `/` when printed in html +- `options` which are directly passed to `require` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`)